-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat(lang): add hare language support #2289
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1a6979f
feat(lang): add hare language support
mek-yt 4f3dbe4
doc(lang): add hare language support
mek-yt 4ad90b4
Merge branch 'helix-editor:master' into master
mek-yt d857202
fix: improve highlights for hare language
mek-yt 02a8c08
doc(lang): hare language indent status
mek-yt 662b0e6
fix(lang): hare language
mek-yt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
[ | ||
"f32" | ||
"f64" | ||
"i16" | ||
"i32" | ||
"i64" | ||
"i8" | ||
"int" | ||
"rune" | ||
"str" | ||
"u16" | ||
"u32" | ||
"u64" | ||
"u8" | ||
"uint" | ||
"uintptr" | ||
"void" | ||
] @type | ||
|
||
|
||
[ | ||
"else" | ||
"if" | ||
"match" | ||
"switch" | ||
] @keyword.control.conditional | ||
|
||
[ | ||
"export" | ||
"use" | ||
] @keyword.control.import | ||
|
||
[ | ||
"continue" | ||
"for" | ||
"break" | ||
] @keyword.control.repeat | ||
|
||
"return" @keyword.control.return | ||
|
||
[ | ||
"abort" | ||
"assert" | ||
] @keyword.control.exception | ||
|
||
[ | ||
"def" | ||
"fn" | ||
] @keyword.function | ||
|
||
[ | ||
"alloc" | ||
"append" | ||
"as" | ||
"bool" | ||
"char" | ||
"const" | ||
"defer" | ||
"delete" | ||
"enum" | ||
"free" | ||
"is" | ||
"len" | ||
"let" | ||
"match" | ||
"nullable" | ||
"offset" | ||
"size" | ||
"static" | ||
"struct" | ||
"type" | ||
"union" | ||
] @keyword | ||
|
||
[ | ||
"." | ||
"!" | ||
"~" | ||
"?" | ||
"*" | ||
"/" | ||
"%" | ||
"+" | ||
"-" | ||
"<<" | ||
">>" | ||
"::" | ||
"<" | ||
"<=" | ||
">" | ||
">=" | ||
"==" | ||
"!=" | ||
"&" | ||
"|" | ||
"^" | ||
"&&" | ||
"||" | ||
"=" | ||
"+=" | ||
"-=" | ||
"*=" | ||
"/=" | ||
"%=" | ||
"&=" | ||
"|=" | ||
"<<=" | ||
">>=" | ||
"^=" | ||
"=>" | ||
] @operator | ||
|
||
[ | ||
"(" | ||
")" | ||
"[" | ||
"]" | ||
")" | ||
"{" | ||
"}" | ||
] @punctuation.bracket | ||
|
||
[ | ||
":" | ||
";" | ||
] @punctuation.delimiter | ||
|
||
"..." @special | ||
|
||
(comment) @comment | ||
|
||
[ | ||
"false" | ||
"null" | ||
"true" | ||
] @constant.builtin | ||
|
||
(string_constant) @string | ||
(escape_sequence) @constant.character.escape | ||
(rune_constant) @string | ||
(integer_constant) @constant.numeric.integer | ||
(floating_constant) @constant.numeric.float | ||
|
||
(call_expression | ||
(postfix_expression) @function) | ||
|
||
(function_declaration | ||
name: (identifier) @function) | ||
|
||
(parameter (name) @variable.parameter) | ||
|
||
(field_access_expression | ||
selector: (name) @variable.other.member) | ||
(decl_attr) @special | ||
(fndec_attrs) @special | ||
|
||
(identifier) @variable | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[ | ||
(struct_union_fields) | ||
(expression_list) | ||
] @indent | ||
|
||
[ | ||
"case" | ||
"}" | ||
"]" | ||
")" | ||
] @outdent | ||
|
||
; [ | ||
; "{" | ||
; "}" | ||
; ] @branch | ||
|
||
; [ | ||
; (comment) | ||
; ] @ignore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(unit) @local.scope | ||
|
||
(function_declaration) @local.scope | ||
|
||
(global_binding | ||
(identifier) @local.definition) | ||
(constant_binding | ||
(identifier) @local.definition) | ||
(type_bindings | ||
(identifier) @local.definition) | ||
|
||
(function_declaration | ||
(prototype | ||
(parameter_list | ||
(parameters | ||
(parameter | ||
(name) @local.definition))))) | ||
|
||
(identifier) @local.reference | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
A note for onlookers: this is the first grammar not hosted on GitHub. I don't think we have anything hardcoded to GitHub anywhere though so this shouldn't be a problem.