Skip to content

Commit

Permalink
Merge branch 'main' into use-prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulyadav-57 committed Jun 27, 2024
2 parents 539881a + a25b635 commit 8621f35
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 53 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@minoru/react-dnd-treeview": "^3.4.1",
"@monaco-editor/react": "^4.5.1",
"@orbs-network/ton-access": "^2.3.0",
"@tact-lang/compiler": "^1.3.1",
"@tact-lang/compiler": "^1.4.0",
"@ton-community/func-js": "^0.5.0",
"@ton/core": "^0.56.3",
"@ton/sandbox": "^0.16.0",
Expand Down
137 changes: 92 additions & 45 deletions src/assets/ton/tact/tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
"include": "#literal"
},
{
"include": "#type"
"include": "#invalid"
},
{
"include": "#constant"
},
{
"include": "#type"
},
{
"include": "#expression"
},
Expand Down Expand Up @@ -60,7 +63,7 @@
"begin": "\\s*/\\*",
"beginCaptures": {
"0": {
"name": "comment.block.begin.tact"
"name": "comment.block.begin.tact punctuation.definition.comment.begin.tact"
}
},
"patterns": [
Expand All @@ -71,7 +74,7 @@
"end": "\\*/",
"endCaptures": {
"0": {
"name": "comment.block.end.tact"
"name": "comment.block.end.tact punctuation.definition.comment.end.tact"
}
}
}
Expand Down Expand Up @@ -176,7 +179,7 @@
{
"comment": "self",
"match": "(?<!\\.)\\b(self)\\b",
"name": "variable.language.self.tact"
"name": "variable.language.this.tact"
}
]
},
Expand All @@ -185,7 +188,7 @@
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.tact"
"name": "punctuation.definition.string.begin.tact"
}
},
"name": "string.quoted.double.tact",
Expand All @@ -197,32 +200,80 @@
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.tact"
"name": "punctuation.definition.string.end.tact"
}
}
},
"escape-sequence": {
"comment": "Allowed escape sequences in strings",
"match": "(\\\\)(([\\\\\"nrtvbf])|(x[a-fA-F0-9]{2})|(u[a-fA-F0-9]{4})|(u\\{[a-fA-F0-9]{1,6}\\}))",
"match": "(?:\\\\)(?:(\\\\)|(\")|([nrtvbf])|(x[a-fA-F0-9]{2})|(u[a-fA-F0-9]{4})|(u\\{[a-fA-F0-9]{1,6}\\}))",
"name": "constant.character.escape.tact",
"captures": {
"1": {
"name": "constant.character.escape.backslash.tact"
},
"2": {
"name": "constant.character.escape.special.tact"
"name": "constant.character.escape.double-quote.tact"
},
"3": {
"name": "constant.character.escape.hex.tact"
"name": "constant.character.escape.special.tact"
},
"4": {
"name": "constant.character.escape.unicode.tact"
"name": "constant.character.escape.hex.tact"
},
"5": {
"name": "constant.character.escape.unicode.tact"
},
"6": {
"name": "constant.character.escape.unicodepoint.tact"
}
}
},
"invalid": {
"patterns": [
{
"comment": "Anything starting with __gen or __tact",
"match": "\\b__(?:gen|tact)[a-zA-Z0-9_]*\\b",
"name": "invalid.illegal.identifier.tact"
}
]
},
"constant": {
"patterns": [
{
"comment": "self.storageReserve",
"match": "(?<=self\\.)(storageReserve)\\b",
"name": "constant.other.builtin.tact"
},
{
"comment": "Other constants from the core library",
"match": "(?<!\\.)\\b(SendRemainingValue|SendRemainingBalance|SendPayGasSeparately|SendIgnoreErrors|SendBounceIfActionFail|SendDestroyIfZero|ReserveExact|ReserveAllExcept|ReserveAtMost|ReserveAddOriginalBalance|ReserveInvertSign|ReserveBounceIfActionFail)\\b",
"name": "constant.other.builtin.tact"
},
{
"comment": "ALL CAPS constants",
"match": "\\b([A-Z]{2}[A-Z0-9_]*)\\b",
"name": "constant.other.caps.tact"
},
{
"comment": "Constant declaration or definition",
"match": "(?<!\\.)\\b(const)\\s+([a-zA-Z_][A-Za-z0-9_]*)\\b",
"captures": {
"1": {
"name": "keyword.other.tact"
},
"2": {
"name": "constant.other.declaration.tact"
}
}
},
{
"comment": "null",
"match": "(?<!\\.)\\b(null)\\b",
"name": "constant.language.null.tact"
}
]
},
"type": {
"patterns": [
{
Expand Down Expand Up @@ -299,13 +350,13 @@
}
},
"as-tlb": {
"comment": "Storage modifiers",
"comment": "Serialization",
"patterns": [
{
"match": "(?<!\\.)\\b(as)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"captures": {
"1": {
"name": "storage.modifier.tact"
"name": "keyword.other.as.tact storage.modifier.tact"
},
"2": {
"name": "entity.name.type.tact"
Expand All @@ -314,32 +365,6 @@
}
]
},
"constant": {
"patterns": [
{
"comment": "ALL CAPS constants",
"match": "\\b([A-Z]{2}[A-Z0-9_]*)\\b",
"name": "constant.other.caps.tact"
},
{
"comment": "Constant declaration or definition",
"match": "^\\s*(const)\\s+([A-Z][A-Za-z0-9_]*)\\b",
"captures": {
"1": {
"name": "storage.type.tact"
},
"2": {
"name": "constant.other.caps.tact"
}
}
},
{
"comment": "null",
"match": "(?<!\\.)\\b(null)\\b",
"name": "constant.language.null.tact"
}
]
},
"expression": {
"patterns": [
{
Expand Down Expand Up @@ -433,9 +458,14 @@
"match": "(?<!\\.)\\b(import)\\b",
"name": "keyword.control.import.tact"
},
{
"comment": "Control flow keywords, prefixed by more than one dot",
"match": "(?<=\\.\\.)\\b(else|catch|until|in(?!\\s*\\())\\b",
"name": "keyword.control.tact"
},
{
"comment": "Control flow keywords",
"match": "(?<!\\.)\\b(if|else|try|catch|repeat|do|until|while|foreach|in|return)\\b",
"match": "(?<!\\.)\\b(if|else|try|catch|repeat|do|until|while|foreach|in(?!\\s*\\()|return)\\b",
"name": "keyword.control.tact"
},
{
Expand All @@ -446,7 +476,7 @@
{
"comment": "Serialization",
"match": "(?<!\\.)\\b(as)\\b",
"name": "keyword.other.as.tact"
"name": "keyword.other.as.tact storage.modifier.tact"
},
{
"match": "(?<!\\.)\\b(struct)\\b",
Expand Down Expand Up @@ -476,7 +506,12 @@
},
{
"comment": "Function declaration/definition keywords",
"match": "(?<!\\.)\\b(fun|native|init|receive|bounced|external)\\b",
"match": "(?<!\\.)\\b(fun|native)\\b",
"name": "keyword.other.function.tact"
},
{
"comment": "Special functions",
"match": "(?<!\\.)\\b(init|receive|bounced|external)(?=\\s*\\()",
"name": "keyword.other.function.tact"
},
{
Expand All @@ -493,17 +528,29 @@
},
"function": {
"comment": "Function declaration, definition or call",
"match": "\\b((?:[a-zA-Z_][a-zA-Z0-9_]*))\\s*\\(",
"match": "\\b((?:[a-zA-Z_][a-zA-Z0-9_]*))\\s*(\\()",
"captures": {
"1": {
"name": "entity.name.function.tact"
},
"2": {
"name": "punctuation.brackets.round.tact"
}
}
},
"variable": {
"comment": "Any valid Tact identifier",
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"name": "variable.other.tact"
"patterns": [
{
"comment": "Any valid Tact identifier",
"match": "(?<!\\.)\\b(_)\\b",
"name": "comment.unused-identifier.tact"
},
{
"comment": "Any valid Tact identifier",
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"name": "variable.other.tact"
}
]
}
}
}

0 comments on commit 8621f35

Please sign in to comment.