Open xmldev opened 1 year ago
What version of pyparsing are you using? It is recommended that you use version 2.47. With this version this string parses correctly.
FYI, Arelle has pyparsing 3.* as a dependency. Downgrading to pyparsing 2.4.7 worked for me.
declarations (from DQC us\2021\constant.xule) like
constant $REPORT_TYPE_EXCLUSIONS = set( 'S-1', 'S-3', 'S-4', 'S-6', 'S-8', 'S-11', 'S-20', 'S-1/A', 'S-3/A', 'S-4/A', 'S-6/A', 'S-8/A', 'S-11/A', 'S-20/A', 'F-1','F-3', '10-12G', '10-12G/A')
triggerpyparsing.exceptions.ParseException: Expected string_end, found '(' (at char 38), (line:1, col:39)
removing the space inside the
set
like inconstant $REPORT_TYPE_EXCLUSIONS = set('S-1','S-3','S-4','S-6','S-8','S-11','S-20','S-1/A','S-3/A','S-4/A','S-6/A','S-8/A','S-11/A','S-20/A','F-1','F-3','10-12G','10-12G/A')
parses successfully;the whitespace doesn't hurt when the list contains numbers, e.g.
constant $REPORT_TYPE_EXCLUSIONS = set(1, 2, 3, 4)
also parses successfully;same for
list
...