Closed ericzhang6222 closed 4 years ago
Now IdentExpr has a Bind method, so it behaves like a pattern when bound. It shouldn't do that. The correct structure/way is to wrap all exprs in ExprPattern instead of making them behave individually like patterns. Then the grammar:
pattern -> extra | %!patternterms(pattern|expr) | C* odelim="(" identpattern=IDENT cdelim=")" C* | IDENT | NUM | C* "(" exprpattern=expr:SEQ_COMMENT,? ")" C* | C* exprpattern=STR C*;
can be changed to:
pattern -> extra | %!patternterms(pattern|expr) | IDENT | NUM | C* "(" exprpattern=expr:SEQ_COMMENT,? ")" C* | C* exprpattern=STR C*;
C* odelim="(" identpattern=IDENT cdelim=")" C* will be removed.
C* odelim="(" identpattern=IDENT cdelim=")" C*
It comes from #442
Now IdentExpr has a Bind method, so it behaves like a pattern when bound. It shouldn't do that. The correct structure/way is to wrap all exprs in ExprPattern instead of making them behave individually like patterns. Then the grammar:
can be changed to:
C* odelim="(" identpattern=IDENT cdelim=")" C*
will be removed.