diff --git a/package.json b/package.json index 574e422..76377e0 100644 --- a/package.json +++ b/package.json @@ -298,10 +298,10 @@ "constant.numeric" ], "variable": [ - "variable.other.readwrite" + "variable.other.field" ], "symbol": [ - "variable.other.constant" + "variable.other.numeric" ], "constant": [ "constant.other.numeric" diff --git a/resources/semantic.gif b/resources/semantic.gif index f270a24..0aaf77a 100644 Binary files a/resources/semantic.gif and b/resources/semantic.gif differ diff --git a/server/src/macroLanguageService/services/macroSemantic.ts b/server/src/macroLanguageService/services/macroSemantic.ts index 9c83fd9..0b50ca8 100644 --- a/server/src/macroLanguageService/services/macroSemantic.ts +++ b/server/src/macroLanguageService/services/macroSemantic.ts @@ -45,12 +45,14 @@ export class MacroSemantic { if (type === nodes.ValueType.Variable) { builder.push(pos.line, pos.character, variable.symbol.length, TokenTypes.variable, 0); } - if (type === nodes.ValueType.Constant || type === nodes.ValueType.Numeric) { + else if (type === nodes.ValueType.Constant) { if (!RegExp(/(true)|(false)/i).test(variable.symbol.getText())) { builder.push(pos.line, pos.character, variable.symbol.length, TokenTypes.constant, 0); } } - + else if (type === nodes.ValueType.Numeric) { + builder.push(pos.line, pos.character, variable.symbol.length, TokenTypes.symbol, 0); + } else if (type === nodes.ValueType.NcCode) { builder.push(pos.line, pos.character, variable.symbol.length, TokenTypes.code, 0); } diff --git a/syntaxes/key_words.txt b/syntaxes/key_words.txt index 82020f8..c85def1 100644 --- a/syntaxes/key_words.txt +++ b/syntaxes/key_words.txt @@ -30,7 +30,7 @@ meta.definition.variable.macro punctuation.definition.keyword.variable.macro // @ variable.other.symbol.macro // @ -meta.symbol.macro // any symbol +variable.macro // any symbol variable.language.macro // $LIST, $INCLUDE, $, %, #, .. @@ -53,10 +53,10 @@ comment.line.macro // /*, ; "constant.numeric" ], "variable": [ - "variable.other.readwrite" + "variable.other.field" ], "symbol": [ - "variable.other.constant" + "variable.other.numeric" ], "constant": [ "constant.other.numeric" diff --git a/syntaxes/macro.tmLanguage.json b/syntaxes/macro.tmLanguage.json index adc845b..4252549 100644 --- a/syntaxes/macro.tmLanguage.json +++ b/syntaxes/macro.tmLanguage.json @@ -201,7 +201,7 @@ "name":"keyword.operator.assignment.macro" }, "symbol" : { - "name":"meta.symbol.macro", + "name":"variable.macro", "match":"\\b([\\w\\_])*(?=[a-zA-Z])([\\w\\_])+\\b" }, "sequence" : { @@ -263,7 +263,7 @@ }, "assignment":{ "begin" : "(?=#?\\w+\\s*\\=)|(?<=\\=)(\\w*)", - "end" : "(?=\\(|\/|\\,)|$", + "end" : "(?=\\(|\/|\\;)|$", "name":"meta.var.expr.macro", "patterns":[ {