Repository: benjamincorcoran/sasdocs

Issue:
Multiple outputs in procedures 
# Issue 

Current parser does not capture multiple outputs in procedures.
```sas
proc summary data=test;
    class a;
    var b;
    output out=sum sum=;
    output out=cnt n=;
run;
```




Discussion:

Patch:
diff --git a/sasdocs/objects.py b/sasdocs/objects.py
index 0271f3c..59edb38 100644
--- a/sasdocs/objects.py
+++ b/sasdocs/objects.py
@@ -812,7 +812,7 @@ proc = ps.seq(
     _h1 = ps.regex(r'.*?(?=data)', flags=reFlags),
     inputs = (ps.regex(r'data', flags=re.IGNORECASE) + opspc + eq + opspc) >> dataObj,
     _h2 = ps.regex(r'.*?(?=out\s*=)', flags=reFlags).optional(),
-    outputs = ((ps.regex(r'out', flags=re.IGNORECASE) + opspc + eq + opspc) >> dataObj).optional(),
+    outputs = ((ps.regex(r'out', flags=re.IGNORECASE) + opspc + eq + opspc) >> dataObj).sep_by(ps.regex(r'(?:(?!run|quit).)*?(?=out\s*=)', flags=reFlags)).optional(),
     _h3 = ps.regex(r'.*?(?=run|quit)', flags=reFlags),
     _run = (run|qt) + opspc + col
 ).combine_dict(procedure)


Test patch:
diff --git a/tests/test_objects.py b/tests/test_objects.py
index 2eeba96..1b82569 100644
--- a/tests/test_objects.py
+++ b/tests/test_objects.py
@@ -69,7 +69,9 @@ def test_dataStep_parse(case, expected):
 
 
 testcases = [
-    ("proc summary data=lib2.test(where=(ax=b) rename=(a=b)); by x; output out=lib3.test2; run;", procedure(outputs=dataObject(library=['lib3'], dataset=['test2'], options=None), inputs=dataObject(library=['lib2'], dataset=['test'], options=[dataArg(option=['where'], setting='(ax=b)'), dataArg(option=['rename'], setting='(a=b)')]), type='summary'))
+    ("proc summary data=lib2.test(where=(ax=b) rename=(a=b)); by x; output out=lib3.test2; run;", procedure(outputs=dataObject(library=['lib3'], dataset=['test2'], options=None), inputs=dataObject(library=['lib2'], dataset=['test'], options=[dataArg(option=['where'], setting='(ax=b)'), dataArg(option=['rename'], setting='(a=b)')]), type='summary')),
+    ("proc summary data=lib2.test(where=(ax=b) rename=(a=b)); by x; output out=lib3.test2; out=lib4.test2; run;", procedure(outputs=[dataObject(library=['lib3'], dataset=['test2'], options=None), dataObject(library=['lib4'], dataset=['test2'], options=None)], inputs=dataObject(library=['lib2'], dataset=['test'], options=[dataArg(option=['where'], setting='(ax=b)'), dataArg(option=['rename'], setting='(a=b)')]), type='summary')),
+    ("proc summary data=lib2.test(where=(ax=b) rename=(a=b)); by x; output out=lib3.test2 sum=; out=lib4.test2 n=; run;", procedure(outputs=[dataObject(library=['lib3'], dataset=['test2'], options=None), dataObject(library=['lib4'], dataset=['test2'], options=None)], inputs=dataObject(library=['lib2'], dataset=['test'], options=[dataArg(option=['where'], setting='(ax=b)'), dataArg(option=['rename'], setting='(a=b)')]), type='summary'))
 ]
 
 @pytest.mark.parametrize("case,expected", testcases)