Add finally, instance of, typeof, in to js grammar

This commit is contained in:
Max Brunsfeld 2014-06-11 11:28:49 -07:00
parent c91c5cb730
commit 4ad6278334
8 changed files with 47167 additions and 21103 deletions

View file

@ -45,9 +45,15 @@ namespace tree_sitter_examples {
{ "try_statement", seq({
keyword("try"),
sym("statement"),
optional(sym("catch_clause")),
optional(sym("finally_clause")) }) },
{ "catch_clause", seq({
keyword("catch"),
in_parens(err(sym("identifier"))),
sym("statement") }) },
{ "finally_clause", seq({
keyword("finally"),
sym("statement") }) },
{ "switch_statement", seq({
keyword("switch"),
in_parens(err(sym("expression"))),
@ -100,7 +106,13 @@ namespace tree_sitter_examples {
sym("false"),
sym("null"),
sym("identifier"),
sym("in_expression"),
sym("instanceof_expression"),
sym("typeof_expression"),
in_parens(sym("expression")) }) },
{ "in_expression", infix_op("in", "expression", 3) },
{ "instanceof_expression", infix_op("instanceof", "expression", 3) },
{ "typeof_expression", prefix_op("typeof", "expression", 3) },
{ "math_op", choice({
prefix_op("++", "expression", 3),
prefix_op("--", "expression", 3),