Skip to content

Modify child functions to return a single node or multiple depending on count #24

@johnedquinn

Description

@johnedquinn

For rule:

some_rule
    : other_rule PLUS other_rule --> rule_name
    ;

The generate rule looks like:

data class RuleName(...) : SomeRule(...) {
    public fun otherRule(): List<OtherRule> = {...}
    public fun PLUS(): List<TerminalNode> = {...}
}

But, we KNOW that only a single PLUS can be present, so, the function should be:

    public fun PLUS(): TerminalNode = {...}

We need to account for generated/hidden nodes while counting too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions