Repository: benjamincorcoran/sasdocs

Issue:
Macro arguments don't resolve paths

Discussion:

Patch:
diff --git a/sasdocs/parsers.py b/sasdocs/parsers.py
index 6bbf1bf..11ff742 100644
--- a/sasdocs/parsers.py
+++ b/sasdocs/parsers.py
@@ -17,6 +17,9 @@ wrd = ps.regex(r'[a-zA-Z0-9_\-]+')
 # FilePath: String terminating in a quote (used only for include and libname)
 fpth = ps.regex(r'[^\'"]+')
 
+# QuotedString:
+qstr = ps.regex(r'[^\'"]*')
+
 # Whitespace and Optional whitespace
 spc = ps.regex(r'\s+')
 opspc = ps.regex(r'\s*')
@@ -186,7 +189,7 @@ program = (nl|mcvDef|cmnt|datastep|proc|lbnm|icld).many()
 
 mcroarg = ps.seq(
     arg = sasName << opspc,
-    default = (eq + opspc >> (ps.regex(r'(?:[a-zA-Z0-9_\-@\.\:]|\/(?!\*)|\\(?!\*))+')|mcv).many()).optional() << opspc,
+    default = (eq + opspc >> (ps.regex(r'(?:[a-zA-Z0-9_\-@\.\:]|\/(?!\*)|\\(?!\*))+')|mcv|(qte+qstr+qte)).many()).optional() << opspc,
     doc = opspc >> cmnt.optional()
 ).combine_dict(objects.macroargument)
 


Test patch:
diff --git a/tests/test_objects.py b/tests/test_objects.py
index 768e820..c522922 100644
--- a/tests/test_objects.py
+++ b/tests/test_objects.py
@@ -191,6 +191,9 @@ testcases = [
     ('%macro test (a=1/*Doc A*/,b/*Doc B*/); %mend;', macro(ref=['test'], arguments=[macroargument(arg=['a'],default=['1'],doc=comment(text="Doc A")), macroargument(arg=['b'],default=None,doc=comment(text="Doc B"))], contents='')),
     ('%macro test; data a; set b; run; %mend;', macro(ref=['test'], arguments=None, contents=[dataStep(outputs=[dataObject(library=None, dataset=['a'], options=None)], header=' ', inputs=[dataObject(library=None, dataset=['b'], options=None)], body=' ')])),                                                                    
     ('%macro test(a=1/*Doc A*/,b/*Doc B*/); data a; set b; run; %mend;', macro(ref=['test'], arguments=[macroargument(arg=['a'], default=['1'], doc=comment(text='Doc A')), macroargument(arg=['b'], default=None, doc=comment(text='Doc B'))], contents=[dataStep(outputs=[dataObject(library=None, dataset=['a'], options=None)], header=' ', inputs=[dataObject(library=None, dataset=['b'], options=None)], body=' ')])),
+    ('%macro test(a=""); %mend;', macro(ref=['test'], arguments=[macroargument(arg=['a'],default=['""'],doc=None)], contents='')),
+    ('%macro test(a=""/*Doc A*/); %mend;', macro(ref=['test'], arguments=[macroargument(arg=['a'],default=['""'],doc=comment(text='Doc A'))], contents='')),
+     
 ]
 
 @pytest.mark.parametrize("case,expected", testcases)