kaby76 / Trash

Toolkit for grammars
MIT License
76 stars 5 forks source link

trclonereplace chokes on postgresql grammar refactoring because of alt labeling. #500

Open kaby76 opened 2 weeks ago

kaby76 commented 2 weeks ago
target_el
    : a_expr (AS collabel | ) # target_label
    | STAR                                # target_star
    ;

Crashes the tool because it tries to find "target_label" as a parser rule name. I hate these things. So useless.

kaby76 commented 2 weeks ago

There are two places where # labels create problems: 1) when computing the transitive closure of the references to parser rules, so that it does not try to find a non-existent rule named after the label; 2) when cloning the rule, the labels must be unique across all rules.