Skip to content

Commit

Permalink
Add support for Amber-lang (#12021)
Browse files Browse the repository at this point in the history
Co-authored-by: Phoenix Himself <pkaras.it@gmail.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
  • Loading branch information
3 people authored Nov 21, 2024
1 parent 9e0d2d0 commit f305c72
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
1 change: 1 addition & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
| ada ||| | `ada_language_server` |
| adl |||| |
| agda || | | |
| amber || | | |
| astro || | | |
| awk ||| | `awk-language-server` |
| bash |||| `bash-language-server` |
Expand Down
11 changes: 11 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3931,3 +3931,14 @@ indent = { tab-width = 4, unit = " " }
[[grammar]]
name = "spade"
source = { git = "https://gitlab.com/spade-lang/tree-sitter-spade/", rev = "4d5b141017c61fe7e168e0a5c5721ee62b0d9572" }

[[language]]
name = "amber"
scope = "source.ab"
file-types = ["ab"]
comment-token = "//"
indent = { tab-width = 4, unit = " " }

[[grammar]]
name = "amber"
source = { git = "https://github.com/amber-lang/tree-sitter-amber", rev = "c6df3ec2ec243ed76550c525e7ac3d9a10c6c814" }
60 changes: 60 additions & 0 deletions runtime/queries/amber/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
(comment) @comment

[
"if"
"loop"
"for"
"return"
"fun"
"else"
"then"
"break"
"continue"
"and"
"or"
"not"
"let"
"pub"
"main"
"echo"
"exit"
"fun"
"import"
"from"
"as"
"in"
"fail"
"failed"
"silent"
"nameof"
"is"
"unsafe"
"trust"
] @keyword

; Literals
(boolean) @constant.builtin.boolean
(number) @constant.numeric
(null) @constant.numeric
(string) @string
(status) @keyword
(command) @string
(handler) @keyword
(block) @punctuation.delimiter
(variable_init) @keyword
(variable_assignment) @punctuation.delimiter
(variable) @variable
(escape_sequence) @constant.character.escape
(type_name_symbol) @type
(interpolation) @punctuation.delimiter
(reference) @keyword
(preprocessor_directive) @comment
(shebang) @comment
(function_definition
name: (variable) @function.method)
(function_call
name: (variable) @function.method)
(import_statement
"pub" @keyword
"import" @keyword
"from" @keyword)

0 comments on commit f305c72

Please sign in to comment.