Skip to content

Commit

Permalink
Add support for internal visibility modifier (#67)
Browse files Browse the repository at this point in the history
Summary:
Modern Hacklang introduced modules and the internal visibility modifier
to mark methods and functions as only accessible from within the current
module.

The Hacklang treesitter grammar doesn't support the internal visibility
modifier yet. This diff addresses it.

Test Plan:

Grammar tests pass:
```
tree-sitter generate
tree-sitter test
```

Reviewers:

Subscribers:

Tasks:

Tags:
  • Loading branch information
andryak authored Jan 22, 2025
1 parent fca1e29 commit bc5b3a1
Show file tree
Hide file tree
Showing 5 changed files with 191,881 additions and 198,166 deletions.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ const rules = {

static_modifier: $ => 'static',

visibility_modifier: $ => choice('public', 'protected', 'private'),
visibility_modifier: $ => choice('public', 'protected', 'private', 'internal'),

attribute_modifier: $ =>
seq('<<', com($.qualified_identifier, opt($.arguments), ','), '>>'),
Expand Down
4 changes: 4 additions & 0 deletions src/grammar.json

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

8 changes: 6 additions & 2 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 bc5b3a1

Please sign in to comment.