feat: add smithy (#4245)

This commit is contained in:
Amaan Qureshi 2023-01-31 09:14:58 -05:00 committed by GitHub
parent f6531e27fd
commit e00952111e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 126 additions and 0 deletions

View file

@ -295,6 +295,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [scss](https://github.com/serenadeai/tree-sitter-scss) (maintained by @elianiva)
- [x] [slint](https://github.com/jrmoulton/tree-sitter-slint) (experimental, maintained by @jrmoulton)
- [x] [smali](https://github.com/amaanq/tree-sitter-smali) (experimental, maintained by @amaanq)
- [x] [smithy](https://github.com/indoorvivants/tree-sitter-smithy) (maintained by @amaanq, @keynmol)
- [x] [solidity](https://github.com/YongJieYongJie/tree-sitter-solidity) (maintained by @YongJieYongJie)
- [x] [sparql](https://github.com/BonaBeavis/tree-sitter-sparql) (maintained by @BonaBeavis)
- [x] [sql](https://github.com/derekstride/tree-sitter-sql) (maintained by @derekstride)

View file

@ -368,6 +368,9 @@
"smali": {
"revision": "d7f535e176c928d33b0e202dd808ac247cacf2ff"
},
"smithy": {
"revision": "8516587df08b923e3bc6e6108b94abbafe7765c7"
},
"solidity": {
"revision": "52ed0880c0126df2f2c7693f215fe6f38e4a2e0a"
},

View file

@ -639,6 +639,14 @@ list.smali = {
experimental = true,
}
list.smithy = {
install_info = {
url = "https://github.com/indoorvivants/tree-sitter-smithy",
files = { "src/parser.c" },
},
maintainers = { "@amaanq", "@keynmol" },
}
list.haskell = {
install_info = {
url = "https://github.com/tree-sitter/tree-sitter-haskell",

View file

@ -0,0 +1,114 @@
; Preproc
(control_key) @preproc
; Namespace
(namespace) @namespace
; Includes
[
"use"
] @include
; Builtins
(primitive) @type.builtin
[
"enum"
"intEnum"
"list"
"map"
"set"
] @type.builtin
; Fields (Members)
; (field) @field
(key_identifier) @field
(shape_member
(field) @field)
(operation_field) @field
(operation_error_field) @field
; Constants
(enum_member
(enum_field) @constant)
; Types
(identifier) @type
(structure_resource
(shape_id) @type)
; Attributes
(mixins
(shape_id) @attribute)
(trait_statement
(shape_id (#set! "priority" 105)) @attribute)
; Operators
[
"@"
"-"
"="
":="
] @operator
; Keywords
[
"namespace"
"service"
"structure"
"operation"
"union"
"resource"
"metadata"
"apply"
"for"
"with"
] @keyword
; Literals
(string) @string
(escape_sequence) @string.escape
(number) @number
(float) @float
(boolean) @boolean
(null) @constant.builtin
; Misc
[
"$"
"#"
] @punctuation.special
["{" "}"] @punctuation.bracket
["(" ")"] @punctuation.bracket
["[" "]"] @punctuation.bracket
[
":"
"."
] @punctuation.delimiter
; Comments
[
(comment)
(documentation_comment)
] @comment @spell