-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from janezpodhostnik/update-tree-sitter
Update tree sitter and bump version
- Loading branch information
Showing
4 changed files
with
73 additions
and
38 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "cadence" | ||
version = "0.0.1" | ||
version = "0.0.2" | ||
edition = "2021" | ||
|
||
[lib] | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
id = "cadence" | ||
name = "Cadence Syntax Highlighting" | ||
version = "0.0.1" | ||
version = "0.0.2" | ||
schema_version = 1 | ||
authors = [ | ||
"Janez Podhostnik <[email protected]>", | ||
|
@@ -11,7 +11,7 @@ repository = "https://github.com/janezpodhostnik/cadence.zed" | |
|
||
[grammars.cadence] | ||
repository = "https://github.com/bluesign/cadence-tree-sitter.git" | ||
commit = "1d6a4fbd3e068e01546474589c777498d4ccfd72" | ||
commit = "67f1b5e92159c3e3e6cf37ce6e77ec72dfaa1af8" | ||
|
||
[language_servers.cadence] | ||
name = "cadence" | ||
|
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 |
---|---|---|
@@ -1,36 +1,83 @@ | ||
[ | ||
(blockComment) | ||
(lineComment) | ||
] @comment @spell | ||
|
||
(compositeDeclaration) @type | ||
(importDeclaration) @include | ||
(identifier) @variable | ||
(addressLocation) @variable | ||
(field) @field | ||
|
||
(stringLiteral) @string | ||
(typeAnnotation) @type | ||
(TypeIdentifier) @type | ||
(TypeBuiltin) @type.builtin | ||
(Identifier) @variable | ||
((Identifier) @variable.builtin | ||
(#eq? @variable.builtin "self")) | ||
|
||
(InitDeclaration) @constructor | ||
(SpecialFunctionDeclaration) @function.builtin | ||
(SpecialFunctionIdentifier) @function.builtin | ||
(FunctionDeclaration name: (Identifier) @function) | ||
|
||
(parameter identifier: (identifier) @parameter) | ||
(StringLiteral) @string | ||
(PathExpression) @string | ||
(PathExpression (Identifier) @string) | ||
(Address) @number | ||
(IntegerLiteral) @number | ||
(FixedPointLiteral) @number | ||
(BooleanLiteral) @boolean | ||
|
||
(Parameter Identifier: (Identifier) @variable.parameter) | ||
[ | ||
"var" | ||
"let" | ||
] @type.qualifier | ||
|
||
(access) @keyword | ||
(Access) @keyword | ||
(transactionDeclaration) @keyword | ||
(EntitlementIdentifier) @label | ||
|
||
(InterfaceMarker) @keyword | ||
(CompositeDeclaration) @keyword | ||
|
||
[ | ||
"contract" | ||
"event" | ||
"struct" | ||
"resource" | ||
"interface" | ||
"enum" | ||
"event" | ||
"enum" | ||
"fun" | ||
"pre" | ||
"post" | ||
"execute" | ||
"return" | ||
"import" | ||
"from" | ||
"view" | ||
"create" | ||
"if" | ||
"mapping" | ||
] @keyword | ||
|
||
(invokeExpression target: (identifierExpression) @function.call) ; foo() | ||
(invokeExpression target: (memberAccessExpression) @function.call) ; foo() | ||
[ | ||
"(" | ||
")" | ||
"}" | ||
"{" | ||
"[" | ||
"]" | ||
] @punctuation.bracket | ||
|
||
[ | ||
"." | ||
"," | ||
";" | ||
"?" | ||
":" | ||
] @punctuation.delimiter | ||
|
||
(MultiplicativeOp) @operator | ||
(AdditiveOp) @operator | ||
(BitwiseShiftOp) @operator | ||
(BitwiseAnd) @operator | ||
(BitwiseXor) @operator | ||
(BitwiseOr) @operator | ||
(RelationalOP) @operator | ||
(NilCoalescing) @operator | ||
(EqualityOp) @operator | ||
(LogicalAnd) @operator | ||
(LogicalOr) @operator | ||
(Transfer) @operator | ||
(SwapStatement) @operator | ||
(Move) @operator | ||
|
||
(integerLiteral) @number | ||
(Comment) @comment |
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 |
---|---|---|
@@ -1,13 +1 @@ | ||
(importDeclaration (identifier) @definition.import) | ||
(functionDeclaration identifier: (identifier) @definition.function) | ||
(compositeDeclaration identifier: (identifier) @definition.namespace) | ||
|
||
; Scopes | ||
[ | ||
(compositeDeclaration) | ||
(forStatement) | ||
(ifStatement) | ||
(switchStatement) | ||
(functionDeclaration) | ||
(compositeDeclaration) | ||
] @scope | ||
(Program) @local.scope |