def test_parse_select(self): SASDoc.from_string(''' SELECT; WHEN(&SEX='2') _AGESEX = 1; OTHERWISE; END; ''')
def test_parse_title(self): SASDoc.from_file('corpus/test-parse-title.sas')
def test_symio_001(self): SASDoc.from_file('corpus/test-symio-001.sas')
def test_parse_proc_format(self): SASDoc.from_file('corpus/test-parse-proc-format.sas')
def test_parse_proc_datasets(self): SASDoc.from_file('corpus/test-parse-proc-datasets.sas')
def test_parse_ods(self): print(SASDoc.from_file('corpus/test-parse-ods.sas'))
def test_parse_libname(self): SASDoc.from_file('corpus/test-parse-libname.sas')
def test_parse_do(self): SASDoc.from_file('corpus/test-parse-do.sas')
def test_nocrash_snf_profiles(self): SASDoc.from_file('corpus/snf-profiles.sas')
def test_nocrash_bene_characteristics(self): SASDoc.from_file('corpus/AC001_P03_Q01_20160628_S01.sas')
def test_parse_sql_sas_nonstandard(self): SASDoc.from_file('corpus/test-parse-sql-nonstandard.sas')
def test_parse_sql_create_view(self): SASDoc.from_file('corpus/test-parse-sql-create-view.sas')
def test_parse_sql_create_table(self): SASDoc.from_file('corpus/test-parse-sql-create-table.sas')
def test_parse_var(self): SASDoc.from_file('corpus/test-parse-var.sas')
def test_parse_toplevel(self): SASDoc.from_file('corpus/test-parse-toplevel.sas')
def test_parse_control(self): SASDoc.from_file('corpus/test-parse-control.sas')
def test_parse_data(self): SASDoc.from_file('corpus/test-parse-data.sas')
def test_nocrash_hospital_profiles(self): SASDoc.from_file('corpus/hospital-profiles.sas')
def test_parse_drop(self): SASDoc.from_file('corpus/test-parse-drop.sas')
def test_nocrash_awvcclfv6(self): SASDoc.from_file('corpus/awvcclfv6.sas')
def test_parse_macros(self): SASDoc.from_file('corpus/test-parse-macros.sas')
def test_empty_doc(self): SASDoc.from_string('')
def test_parse_options(self): SASDoc.from_file('corpus/test-parse-options.sas')
def test_empty_stmt(self): SASDoc.from_string(';')
def test_parse_proc_export(self): SASDoc.from_file('corpus/test-parse-proc-export.sas')
def test_ParseNode_comment_dump(self): SASDoc.from_string('*;').dump()
from sasparse import SASDoc if __name__ == '__main__': import sys inputfile = sys.stdin if sys.argv[1:]: inputfile = open(sys.argv[1]) sys.setrecursionlimit(3000) doc = SASDoc.from_fd(inputfile) from pprint import pprint pprint(doc.top, width=1) # print(doc.format(None))
def test_macro_macro_call_variable(self): SASDoc.from_string( '%IF "&LABELMAC" ne "" %THEN %&LABELMAC; *HCC labels;').dump()
def parsefile(sasfilepath): SASDoc.from_file(sasfilepath)
def test_parse_array(self): SASDoc.from_file('corpus/test-parse-array.sas')