Skip to content

Commit bc5b3a1

Browse files
authored
Add support for internal visibility modifier (#67)
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:
1 parent fca1e29 commit bc5b3a1

File tree

5 files changed

+191881
-198166
lines changed

5 files changed

+191881
-198166
lines changed

grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ const rules = {
10911091

10921092
static_modifier: $ => 'static',
10931093

1094-
visibility_modifier: $ => choice('public', 'protected', 'private'),
1094+
visibility_modifier: $ => choice('public', 'protected', 'private', 'internal'),
10951095

10961096
attribute_modifier: $ =>
10971097
seq('<<', com($.qualified_identifier, opt($.arguments), ','), '>>'),

src/grammar.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/node-types.json

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)