Skip to content

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

Description

@xmldev

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions