-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Add tree-sitter support for BASIC and FreeBASIC #14711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tree-sitter support for BASIC and FreeBASIC #14711
Conversation
b569590 to
34c04b7
Compare
runtime/queries/basic/tags.scm
Outdated
| variable: (identifier) @name.definition.variable) | ||
|
|
||
| (let_statement | ||
| variable: (identifier) @name.definition.variable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| variable: (identifier) @name.definition.variable) | |
| (let_statement | |
| variable: (identifier) @name.definition.variable) | |
| variable: (identifier) @definition.variable) | |
| (let_statement | |
| variable: (identifier) @definition.variable) |
tags.scm queries should only have @definition.*, @reference.* and @name captures, the definition and name one can't be combined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing! I’ve pushed the requested update. Let me know if anything else needs to be changed.
Remove invalid node references from query files: - basic: Remove while_statement, do_statement, function_definition, sub_definition, and if_statement (only for_statement is supported) - freebasic: Remove if_statement (not used for indentation in this grammar)
FreeBASIC grammar supports multi-line IF...THEN...END IF blocks that should be indented properly.
3546f4a to
f17989e
Compare
Summary
This PR adds tree-sitter grammar support for BASIC and FreeBASIC languages.
Changes
.basfiles).bas,.bifiles)tree-sitter-basic: https://github.com/Ra77a3l3-jar/tree-sitter-basictree-sitter-freebasic: https://github.com/Ra77a3l3-jar/tree-sitter-freebasicTesting
Tested with
hx --health basicandhx --health freebasic:Ran tests as per contribution guidelines:
cargo test --workspacecargo integration-testNotes
.basfile extension but can be distinguished by content.bi(include) files