Skip to content

Commit

Permalink
fix: update grammars from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed May 25, 2021
1 parent 4ab2858 commit 307d85e
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 117 deletions.
143 changes: 71 additions & 72 deletions grammars/d.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
"type": {
"patterns": [
{
"include": "#base-type"
"include": "#typeof"
},
{
"include": "#type-ctor"
"include": "#base-type"
},
{
"include": "#typeof"
"include": "#type-ctor"
}
]
},
Expand Down Expand Up @@ -86,7 +86,7 @@
"typeof": {
"begin": "typeof\\s*\\(",
"end": "\\)",
"name": "storage.type.typeof.d",
"name": "keyword.token.typeof.d",
"patterns": [
{
"match": "return",
Expand All @@ -97,40 +97,6 @@
}
]
},
"nesting-expression": {
"patterns": [
{
"begin": "\\(",
"end": "\\)",
"patterns": [
{
"include": "#nesting-expression"
}
]
},
{
"begin": "\\[",
"end": "\\]",
"patterns": [
{
"include": "#nesting-expression"
}
]
},
{
"begin": "{",
"end": "}",
"patterns": [
{
"include": "#nesting-expression"
}
]
},
{
"include": "#expression"
}
]
},
"expression": {
"patterns": [
{
Expand Down Expand Up @@ -161,6 +127,9 @@
{
"include": "#traits-expression"
},
{
"include": "#is-expression"
},
{
"include": "#typeid-expression"
},
Expand Down Expand Up @@ -209,6 +178,12 @@
{
"include": "#functions"
},
{
"include": "#type"
},
{
"include": "#parentheses-expression"
},
{
"include": "#lexical"
}
Expand Down Expand Up @@ -375,10 +350,7 @@
},
"patterns": [
{
"include": "#comment"
},
{
"include": "#expression"
"include": "source.d"
}
]
}
Expand All @@ -404,7 +376,7 @@
"include": "#comment"
},
{
"include": "#nesting-expression"
"include": "#expression"
},
{
"include": "#comma"
Expand Down Expand Up @@ -465,7 +437,7 @@
"include": "#comment"
},
{
"include": "#nesting-expression"
"include": "#expression"
},
{
"include": "#comma"
Expand Down Expand Up @@ -645,9 +617,6 @@
{
"include": "#mixin-statement"
},
{
"include": "#is-statement"
},
{
"include": "#conditional-statement"
},
Expand Down Expand Up @@ -856,7 +825,7 @@
"include": "#comment"
},
{
"include": "#nesting-expression"
"include": "#expression"
},
{
"include": "#comma"
Expand Down Expand Up @@ -1117,7 +1086,7 @@
"include": "#comment"
},
{
"include": "#nesting-expression"
"include": "#expression"
},
{
"include": "#comma"
Expand All @@ -1126,27 +1095,27 @@
}
]
},
"is-statement": {
"is-expression": {
"patterns": [
{
"begin": "\\bis\\s*\\(",
"beginCaptures": {
"0": {
"name": "keyword.control.is.begin.d"
"name": "keyword.token.is.begin.d"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "keyword.control.is.end.d"
"name": "keyword.token.is.end.d"
}
},
"patterns": [
{
"include": "#comment"
},
{
"include": "#nesting-expression"
"include": "#expression"
},
{
"include": "#comma"
Expand All @@ -1155,6 +1124,19 @@
}
]
},
"parentheses-expression": {
"patterns": [
{
"begin": "\\(",
"end": "\\)",
"patterns": [
{
"include": "#expression"
}
]
}
]
},
"deprecated-statement": {
"patterns": [
{
Expand All @@ -1175,7 +1157,7 @@
"include": "#comment"
},
{
"include": "#nesting-expression"
"include": "#expression"
},
{
"include": "#comma"
Expand Down Expand Up @@ -1301,7 +1283,7 @@
{
"begin": "\\b(alias)\\b\\s*",
"beginCaptures": {
"0": {
"1": {
"name": "keyword.other.alias.d"
}
},
Expand Down Expand Up @@ -1367,7 +1349,7 @@
"function-prelude": {
"patterns": [
{
"match": "((\\.\\s*)?[_\\w][_\\d\\w]*)(\\s*\\.\\s*[_\\w][_\\d\\w]*)*\\s*(?=\\()",
"match": "(?!typeof|typeid)((\\.\\s*)?[_\\w][_\\d\\w]*)(\\s*\\.\\s*[_\\w][_\\d\\w]*)*\\s*(?=\\()",
"name": "entity.name.function.d"
}
]
Expand Down Expand Up @@ -1900,9 +1882,6 @@
{
"include": "#condition"
},
{
"include": "#declaration-block"
},
{
"match": "\\belse\\b",
"name": "keyword.control.else.d"
Expand Down Expand Up @@ -2031,13 +2010,13 @@
"begin": "\\bstatic\\s+if\\b\\s*\\(",
"beginCaptures": {
"0": {
"name": "keyword.other.static-if.begin.d"
"name": "keyword.control.static-if.begin.d"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "keyword.other.static-if.end.d"
"name": "keyword.control.static-if.end.d"
}
},
"patterns": [
Expand Down Expand Up @@ -2294,7 +2273,7 @@
"patterns": [
{
"match": "\\b0[xX][0-9a-fA-F_]*(\\.[0-9a-fA-F_]*)?(p-|P-|p\\+|P\\+|p|P)[0-9][0-9_]*[LfF]?i?\\b",
"name": "constant.numeric.fload.hexadecimal.d"
"name": "constant.numeric.float.hexadecimal.d"
}
]
},
Expand Down Expand Up @@ -2608,26 +2587,46 @@
"block-comment": {
"patterns": [
{
"begin": "/\\*",
"end": "\\*/",
"name": "comment.block.d"
"begin": "/((?!\\*/)\\*)+",
"beginCaptures": {
"0": {
"name": "comment.block.begin.d"
}
},
"end": "\\*+/",
"endCaptures": {
"0": {
"name": "comment.block.end.d"
}
},
"name": "comment.block.content.d"
}
]
},
"line-comment": {
"patterns": [
{
"match": "//.*$",
"match": "//+.*$",
"name": "comment.line.d"
}
]
},
"nesting-block-comment": {
"patterns": [
{
"begin": "/\\+",
"end": "\\+/",
"name": "comment.block.documentation.d",
"begin": "/((?!\\+/)\\+)+",
"beginCaptures": {
"0": {
"name": "comment.block.documentation.begin.d"
}
},
"end": "\\++/",
"endCaptures": {
"0": {
"name": "comment.block.documentation.end.d"
}
},
"name": "comment.block.documentation.content.d",
"patterns": [
{
"include": "#nesting-block-comment"
Expand Down Expand Up @@ -2814,7 +2813,7 @@
},
{
"match": "\\bfalse\\b",
"name": "keyword.token.false.d"
"name": "constant.language.boolean.false.d"
},
{
"match": "\\bfinal\\b",
Expand Down Expand Up @@ -2926,7 +2925,7 @@
},
{
"match": "\\bnull\\b",
"name": "keyword.token.null.d"
"name": "constant.language.null.d"
},
{
"match": "\\bout\\b",
Expand Down Expand Up @@ -3018,7 +3017,7 @@
},
{
"match": "\\btrue\\b",
"name": "keyword.token.true.d"
"name": "constant.language.boolean.true.d"
},
{
"match": "\\btry\\b",
Expand Down
Loading

0 comments on commit 307d85e

Please sign in to comment.