Skip to content

Ambiguous Alternatives #1738

Answered by sveri
sveri asked this question in Q&A
Jan 12, 2022 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

It seems like something like this works:

$.MANY_SEP({
            SEP: T.Comma, DEF: () => {
                let element = $.SUBRULE($.argumentsWithSimpleType);
                $.OPTION(() => { 
                    $.OR([
                        { ALT: () => element += $.SUBRULE($.bracketWithSimpleTypeApplication)},
                        { ALT: () => element += $.SUBRULE($.bracketWithArgumentTypeApplication)},
                        // { ALT: () => element = $.SUBRULE($.bracketWithArgumentTypeApplicationAndType)},
                    ]);
                });
                argumentsWithType.push(element);
            }
        });

Is that good style?

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@bd82
Comment options

bd82 Jan 12, 2022
Maintainer

Answer selected by sveri
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