parsers: Add FHIR Shorthand (FSH) (#4052)

This commit is contained in:
Matthew Gramigna 2023-01-18 09:58:45 -08:00 committed by GitHub
parent 052069ffab
commit 622baacdc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 104 additions and 0 deletions

View file

@ -208,6 +208,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [fish](https://github.com/ram02z/tree-sitter-fish) (maintained by @ram02z)
- [x] [foam](https://github.com/FoamScience/tree-sitter-foam) (experimental, maintained by @FoamScience)
- [ ] [fortran](https://github.com/stadelmanma/tree-sitter-fortran)
- [x] [fsh](https://github.com/mgramigna/tree-sitter-fsh) (maintained by @mgramigna)
- [x] [fusion](https://gitlab.com/jirgn/tree-sitter-fusion.git) (maintained by @jirgn)
- [x] [Godot (gdscript)](https://github.com/PrestonKnopp/tree-sitter-gdscript) (maintained by @Shatur)
- [x] [git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) (maintained by @gbprod)

View file

@ -107,6 +107,9 @@
"fortran": {
"revision": "edcb3374f4698aaedf24bc572f6b2f5ef0e89ac7"
},
"fsh": {
"revision": "f5b0489d44e588b0d5d77f5c5f50a20491c44441"
},
"fusion": {
"revision": "19db2f47ba4c3a0f6238d4ae0e2abfca16e61dd6"
},

View file

@ -242,6 +242,15 @@ list.rust = {
maintainers = { "@vigoux" },
}
list.fsh = {
install_info = {
url = "https://github.com/mgramigna/tree-sitter-fsh",
files = { "src/parser.c" },
branch = "main",
},
maintainers = { "@mgramigna" },
}
list.fusion = {
install_info = {
url = "https://gitlab.com/jirgn/tree-sitter-fusion.git",

View file

@ -0,0 +1,91 @@
[
"("
")"
] @punctuation.bracket
[
"^"
"="
":"
] @operator
[
"#"
".."
"*"
"->"
] @punctuation.special
; Entities
[
"Profile"
"Alias"
"Extension"
"Invariant"
"Instance"
"ValueSet"
"CodeSystem"
"Mapping"
"Logical"
"Resource"
"RuleSet"
] @keyword
; Metadata Keywords
[
"Parent"
"Title"
"Description"
"Id"
"Severity"
"InstanceOf"
"Usage"
"Source"
"XPath"
"Target"
] @keyword
; Rule Keywords
[
"contentReference"
"insert"
"and"
"or"
"contains"
"named"
"only"
"obeys"
"valueset"
"codes"
"from"
"include"
"exclude"
"where"
"system"
"exactly"
] @keyword.operator
; Types
[
"Reference"
"Canonical"
] @type.builtin
(sd_metadata (parent (name))) @type
(target_type (name)) @type
; Strings
(string) @string @spell
(multiline_string) @string @spell
; Constants
(strength_value) @constant
(bool) @constant.boolean
(flag) @constant
; Special Params
(code_value) @parameter
; Extras
(fsh_comment) @comment @spell