xbrlus / xule

An open-source XBRL processor for business rules, rendering and custom data reporting. See https://xbrl.us/xule for documentation and https://xbrl.us/xule-editor for a VS Code syntax highlighter.
Apache License 2.0
25 stars 10 forks source link

parse error for list/set with string members with whitespace between them #16

Open xmldev opened 1 year ago

xmldev commented 1 year ago

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') trigger pyparsing.exceptions.ParseException: Expected string_end, found '(' (at char 38), (line:1, col:39)

removing the space inside the set like in 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') 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 ...

campbellpryde commented 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.

jonathan-lord-compsci commented 1 year ago

FYI, Arelle has pyparsing 3.* as a dependency. Downgrading to pyparsing 2.4.7 worked for me.