Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xmldev opened this issue Mar 22, 2023 · 2 comments
Open

Comments

@xmldev
Copy link

xmldev commented Mar 22, 2023

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
Copy link
Contributor

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants