Use GLR for for-in loop conlfict in javascript grammar

This commit is contained in:
Max Brunsfeld 2015-10-06 10:50:56 -07:00
parent 03e7fc49fd
commit 624e4651d2
2 changed files with 11 additions and 10 deletions

View file

@ -99,10 +99,9 @@ extern const Grammar javascript = Grammar({
str("for"),
str("("),
optional(str("var")),
prec(PREC_REL, seq({
sym("identifier"),
str("in"),
sym("_expression") })),
sym("identifier"),
str("in"),
sym("_expression"),
str(")"),
sym("_statement") }) },
@ -351,6 +350,8 @@ extern const Grammar javascript = Grammar({
sym("comment"),
sym("_line_break"),
pattern("[ \t\r]"),
}).expected_conflicts({
{ "for_in_statement", "_expression" },
});
} // namespace tree_sitter_examples