Skip to content

Commit

Permalink
Update from tree-sitter-python
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Actions committed Aug 18, 2024
1 parent e3783b9 commit 820c25c
Show file tree
Hide file tree
Showing 8 changed files with 60,550 additions and 62,305 deletions.
2 changes: 1 addition & 1 deletion bindings/go/binding_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/tree-sitter/tree-sitter-mojo

go 1.22

require github.com/smacker/go-tree-sitter v0.0.0-20230720070738-0d0a9f78d8f8
15 changes: 11 additions & 4 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ module.exports = grammar({
[$.named_expression, $.as_pattern],
[$.print_statement, $.primary_expression],
[$.type_alias_statement, $.primary_expression],
[$.match_statement, $.primary_expression],
],

supertypes: $ => [
Expand Down Expand Up @@ -806,6 +807,10 @@ module.exports = grammar({
field('argument', $.primary_expression),
)),

_not_in: _ => seq('not', 'in'),

_is_not: _ => seq('is', 'not'),

comparison_operator: $ => prec.left(PREC.compare, seq(
$.primary_expression,
repeat1(seq(
Expand All @@ -819,9 +824,9 @@ module.exports = grammar({
'>',
'<>',
'in',
alias(seq('not', 'in'), 'not in'),
alias($._not_in, 'not in'),
'is',
alias(seq('is', 'not'), 'is not'),
alias($._is_not, 'is not'),
)),
$.primary_expression,
)),
Expand Down Expand Up @@ -1173,11 +1178,13 @@ module.exports = grammar({
'exec',
'async',
'await',
'match',
),
$.identifier,
)),
alias('type', $.identifier),
alias(
choice('type', 'match'),
$.identifier,
),
),

true: _ => 'True',
Expand Down
2 changes: 2 additions & 0 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
"is"
"not"
"or"
"is not"
"not in"
] @operator

[
Expand Down
73 changes: 45 additions & 28 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 10 additions & 8 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 820c25c

Please sign in to comment.