parent
2a77a2f7a5
commit
032e9a33ba
|
@ -9,7 +9,7 @@
|
||||||
"vscode": "*"
|
"vscode": "*"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"update-grammar": "node ../../build/npm/update-grammar.js jeff-hykin/better-go-syntax source/generated.tmLanguage.json ./syntaxes/go.tmLanguage.json"
|
"update-grammar": "node ../../build/npm/update-grammar.js jeff-hykin/better-go-syntax export/generated.tmLanguage.json ./syntaxes/go.tmLanguage.json"
|
||||||
},
|
},
|
||||||
"contributes": {
|
"contributes": {
|
||||||
"languages": [
|
"languages": [
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"information_for_contributors": [
|
"information_for_contributors": [
|
||||||
"This file has been converted from https://github.com/jeff-hykin/better-go-syntax/blob/master/source/generated.tmLanguage.json",
|
"This file has been converted from https://github.com/jeff-hykin/better-go-syntax/blob/master/export/generated.tmLanguage.json",
|
||||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||||
"Once accepted there, we are happy to receive an update request."
|
"Once accepted there, we are happy to receive an update request."
|
||||||
],
|
],
|
||||||
"version": "https://github.com/jeff-hykin/better-go-syntax/commit/302b427373ba8390786723a99f6cdf8e38833159",
|
"version": "https://github.com/jeff-hykin/better-go-syntax/commit/6175663a7a0e23d58ccf9aab95054cb6e5c92aff",
|
||||||
"name": "Go",
|
"name": "Go",
|
||||||
"scopeName": "source.go",
|
"scopeName": "source.go",
|
||||||
"patterns": [
|
"patterns": [
|
||||||
|
@ -673,22 +673,345 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"numeric_literals": {
|
"numeric_literals": {
|
||||||
"patterns": [
|
"match": "(?<!\\w)\\.?\\d(?:(?:[0-9a-zA-Z_\\.])|(?<=[eEpP])[+-])*",
|
||||||
{
|
"captures": {
|
||||||
"include": "#float"
|
"0": {
|
||||||
},
|
"patterns": [
|
||||||
{
|
{
|
||||||
"include": "#integer"
|
"begin": "(?=.)",
|
||||||
|
"end": "(?:\\n|$)",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?:(?:(?:(?:(?:\\G(?=[0-9.])(?!0[xXbBoO])([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)((?:(?<=[0-9])\\.|\\.(?=[0-9])))([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)?(?:(?<!_)([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)))?(i(?!\\w))?(?:\\n|$)|\\G(?=[0-9.])(?!0[xXbBoO])([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?<!_)([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))|\\G((?:(?<=[0-9])\\.|\\.(?=[0-9])))([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?:(?<!_)([eE])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)))?(i(?!\\w))?(?:\\n|$))|(\\G0[xX])_?([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)?(?<!_)([pP])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))|(\\G0[xX])_?([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?<!_)([pP])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))|(\\G0[xX])((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(?<!_)([pP])(\\+?)(\\-?)((?:[0-9](?:[0-9]|(?:(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*))(i(?!\\w))?(?:\\n|$))",
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "constant.numeric.decimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
},
|
||||||
|
"3": {
|
||||||
|
"name": "constant.numeric.decimal.point.go"
|
||||||
|
},
|
||||||
|
"4": {
|
||||||
|
"name": "constant.numeric.decimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"5": {
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
},
|
||||||
|
"6": {
|
||||||
|
"name": "keyword.other.unit.exponent.decimal.go"
|
||||||
|
},
|
||||||
|
"7": {
|
||||||
|
"name": "keyword.operator.plus.exponent.decimal.go"
|
||||||
|
},
|
||||||
|
"8": {
|
||||||
|
"name": "keyword.operator.minus.exponent.decimal.go"
|
||||||
|
},
|
||||||
|
"9": {
|
||||||
|
"name": "constant.numeric.exponent.decimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"10": {
|
||||||
|
"name": "keyword.other.unit.imaginary.go"
|
||||||
|
},
|
||||||
|
"11": {
|
||||||
|
"name": "constant.numeric.decimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"12": {
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
},
|
||||||
|
"13": {
|
||||||
|
"name": "keyword.other.unit.exponent.decimal.go"
|
||||||
|
},
|
||||||
|
"14": {
|
||||||
|
"name": "keyword.operator.plus.exponent.decimal.go"
|
||||||
|
},
|
||||||
|
"15": {
|
||||||
|
"name": "keyword.operator.minus.exponent.decimal.go"
|
||||||
|
},
|
||||||
|
"16": {
|
||||||
|
"name": "constant.numeric.exponent.decimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"17": {
|
||||||
|
"name": "keyword.other.unit.imaginary.go"
|
||||||
|
},
|
||||||
|
"18": {
|
||||||
|
"name": "constant.numeric.decimal.point.go"
|
||||||
|
},
|
||||||
|
"19": {
|
||||||
|
"name": "constant.numeric.decimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"20": {
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
},
|
||||||
|
"21": {
|
||||||
|
"name": "keyword.other.unit.exponent.decimal.go"
|
||||||
|
},
|
||||||
|
"22": {
|
||||||
|
"name": "keyword.operator.plus.exponent.decimal.go"
|
||||||
|
},
|
||||||
|
"23": {
|
||||||
|
"name": "keyword.operator.minus.exponent.decimal.go"
|
||||||
|
},
|
||||||
|
"24": {
|
||||||
|
"name": "constant.numeric.exponent.decimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"25": {
|
||||||
|
"name": "keyword.other.unit.imaginary.go"
|
||||||
|
},
|
||||||
|
"26": {
|
||||||
|
"name": "keyword.other.unit.hexadecimal.go"
|
||||||
|
},
|
||||||
|
"27": {
|
||||||
|
"name": "constant.numeric.hexadecimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"28": {
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
},
|
||||||
|
"29": {
|
||||||
|
"name": "constant.numeric.hexadecimal.go"
|
||||||
|
},
|
||||||
|
"30": {
|
||||||
|
"name": "constant.numeric.hexadecimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"31": {
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
},
|
||||||
|
"32": {
|
||||||
|
"name": "keyword.other.unit.exponent.hexadecimal.go"
|
||||||
|
},
|
||||||
|
"33": {
|
||||||
|
"name": "keyword.operator.plus.exponent.hexadecimal.go"
|
||||||
|
},
|
||||||
|
"34": {
|
||||||
|
"name": "keyword.operator.minus.exponent.hexadecimal.go"
|
||||||
|
},
|
||||||
|
"35": {
|
||||||
|
"name": "constant.numeric.exponent.hexadecimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"36": {
|
||||||
|
"name": "keyword.other.unit.imaginary.go"
|
||||||
|
},
|
||||||
|
"37": {
|
||||||
|
"name": "keyword.other.unit.hexadecimal.go"
|
||||||
|
},
|
||||||
|
"38": {
|
||||||
|
"name": "constant.numeric.hexadecimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"39": {
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
},
|
||||||
|
"40": {
|
||||||
|
"name": "keyword.other.unit.exponent.hexadecimal.go"
|
||||||
|
},
|
||||||
|
"41": {
|
||||||
|
"name": "keyword.operator.plus.exponent.hexadecimal.go"
|
||||||
|
},
|
||||||
|
"42": {
|
||||||
|
"name": "keyword.operator.minus.exponent.hexadecimal.go"
|
||||||
|
},
|
||||||
|
"43": {
|
||||||
|
"name": "constant.numeric.exponent.hexadecimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"44": {
|
||||||
|
"name": "keyword.other.unit.imaginary.go"
|
||||||
|
},
|
||||||
|
"45": {
|
||||||
|
"name": "keyword.other.unit.hexadecimal.go"
|
||||||
|
},
|
||||||
|
"46": {
|
||||||
|
"name": "constant.numeric.hexadecimal.go"
|
||||||
|
},
|
||||||
|
"47": {
|
||||||
|
"name": "constant.numeric.hexadecimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"48": {
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
},
|
||||||
|
"49": {
|
||||||
|
"name": "keyword.other.unit.exponent.hexadecimal.go"
|
||||||
|
},
|
||||||
|
"50": {
|
||||||
|
"name": "keyword.operator.plus.exponent.hexadecimal.go"
|
||||||
|
},
|
||||||
|
"51": {
|
||||||
|
"name": "keyword.operator.minus.exponent.hexadecimal.go"
|
||||||
|
},
|
||||||
|
"52": {
|
||||||
|
"name": "constant.numeric.exponent.hexadecimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"53": {
|
||||||
|
"name": "keyword.other.unit.imaginary.go"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?:(?:(?:\\G(?=[0-9.])(?!0[xXbBoO])([0-9](?:[0-9]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(i(?!\\w))?(?:\\n|$)|(\\G0[bB])_?([01](?:[01]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(i(?!\\w))?(?:\\n|$))|(\\G0[oO]?)_?((?:[0-7]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))+)(i(?!\\w))?(?:\\n|$))|(\\G0[xX])_?([0-9a-fA-F](?:[0-9a-fA-F]|((?<=[0-9a-fA-F])_(?=[0-9a-fA-F])))*)(i(?!\\w))?(?:\\n|$))",
|
||||||
|
"captures": {
|
||||||
|
"1": {
|
||||||
|
"name": "constant.numeric.decimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
},
|
||||||
|
"3": {
|
||||||
|
"name": "keyword.other.unit.imaginary.go"
|
||||||
|
},
|
||||||
|
"4": {
|
||||||
|
"name": "keyword.other.unit.binary.go"
|
||||||
|
},
|
||||||
|
"5": {
|
||||||
|
"name": "constant.numeric.binary.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"6": {
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
},
|
||||||
|
"7": {
|
||||||
|
"name": "keyword.other.unit.imaginary.go"
|
||||||
|
},
|
||||||
|
"8": {
|
||||||
|
"name": "keyword.other.unit.octal.go"
|
||||||
|
},
|
||||||
|
"9": {
|
||||||
|
"name": "constant.numeric.octal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"10": {
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
},
|
||||||
|
"11": {
|
||||||
|
"name": "keyword.other.unit.imaginary.go"
|
||||||
|
},
|
||||||
|
"12": {
|
||||||
|
"name": "keyword.other.unit.hexadecimal.go"
|
||||||
|
},
|
||||||
|
"13": {
|
||||||
|
"name": "constant.numeric.hexadecimal.go",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"match": "(?<=[0-9a-fA-F])_(?=[0-9a-fA-F])",
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"14": {
|
||||||
|
"name": "punctuation.separator.constant.numeric.go"
|
||||||
|
},
|
||||||
|
"15": {
|
||||||
|
"name": "keyword.other.unit.imaginary.go"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": "(?:(?:[0-9a-zA-Z_\\.])|(?<=[eEpP])[+-])+",
|
||||||
|
"name": "invalid.illegal.constant.numeric.go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
},
|
|
||||||
"float": {
|
|
||||||
"match": "(\\.\\d+([Ee][-+]\\d+)?i?)\\b|\\b\\d+\\.\\d*(([Ee][-+]\\d+)?i?\\b)?",
|
|
||||||
"name": "constant.numeric.floating-point.go"
|
|
||||||
},
|
|
||||||
"integer": {
|
|
||||||
"match": "\\b((0x[0-9a-fA-F]+)|(0[0-7]+i?)|(\\d+([Ee]\\d+)?i?)|(\\d+[Ee][-+]\\d+i?))\\b",
|
|
||||||
"name": "constant.numeric.integer.go"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue