Skip to content

No placeholders when using [] and maybe_placeholders=True #1568

@zimri-leisher

Description

@zimri-leisher

Describe the bug

If you define a rule which includes an alias inside of an optional [], e.g.:

rule: "something" [_alias_rule]

And parse it with maybe_placeholders=True, there won't be a placeholder None value. After inspection of the code, this is due to a problem with the _will_not_get_removed func in FindRuleSize, which doesn't count aliases. This leads to too few _EMPTY symbols produced in EBNF_BNF maybe handler. Replacing _alias_rule with a non-alias fixes the issue.

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