Skip to content

CONSUME inside OPTION can't be disambiguated #2032

Answered by k1w1
k1w1 asked this question in Q&A
Discussion options

You must be logged in to vote

But a bit more stepping through the code made me realize that there was a solution all along. The LABEL option for CONSUME exactly solves my problem:

property = this.RULE('property', () => {
    this.OPTION1(() => this.CONSUME1(Newline, { LABEL: 'Newline1' }));
    this.CONSUME2(Text);
    this.OPTION2(() => this.CONSUME3(Newline, { LABEL: 'Newline2' }));
    this.CONSUME4(Colon);
    this.OPTION3(() => this.CONSUME5(Newline, { LABEL: 'Newline3' }));
    this.CONSUME6(Text);
    this.OPTION4(() => this.CONSUME7(Newline, { LABEL: 'Newline4' }));
  });

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@k1w1
Comment options

@k1w1
Comment options

@k1w1
Comment options

Answer selected by k1w1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants