diff --git a/KSP configuration.JSON-tmLanguage b/KSP configuration.JSON-tmLanguage index 4d940f2..fbc2ec7 100644 --- a/KSP configuration.JSON-tmLanguage +++ b/KSP configuration.JSON-tmLanguage @@ -10,9 +10,19 @@ "match": "//.*", "comment": "Anything after 2 slashes is a comment." }, + { + "name": "variable.parameter", + "match": "(?<=[!\\[])([A-Za-z0-9\\*]*)(?=\\])", + "comment": "Alphanumeric characters inside square brackets is a parameter." + }, + { + "name": "support.function", + "match": "([!@%])(?=[A-Za-z]*)", + "comment": "These symbols before alphabetical characters are for ModuleManager syntax." + }, { "name": "keyword", - "match": "([A-Za-z0-9@%_]*\\s*)(?==)", + "match": "([A-Za-z0-9@%_,]*\\s*)(?=([\\*\\+])?=)", "comment": "Anything before an equal sign is a key in the key-value pairs." }, { @@ -27,17 +37,17 @@ }, { "name": "constant.numeric", - "match": "(?<==)(\\s*[Tt]rue||\\s*[Ff]alse)", + "match": "(?<==)(\\s*([Tt]rue|[Ff]alse))", "comment": "'True' or 'False' after an equal sign is a boolean." }, { "name": "constant.numeric", - "match": "\\s*-?[0-9\\.]+E?-?[0-9\\.]*", + "match": "(?<=[=,\\s])(\\s*-?[0-9\\.]+E?-?[0-9\\.]*)", "comment": "Numeric characters, including scientific notation, is a number." }, { "name": "constant.numeric", - "match": "(?<==)(\\s*NaN||\\s*Infinity||\\s*None)", + "match": "(?<==)(\\s*(NaN|Infinity|None))", "comment": "'NaN', 'Infinity', or 'None' after an equal sign is a non-numeric constant." }, { @@ -45,11 +55,6 @@ "match": "(?<==)(\\s?.*[A-Za-z].*)", "comment": "Anything else after an equal sign containing alphabetical characters is a string." }, - { - "name": "variable.parameter", - "match": "(?<=\\[)([A-Za-z0-9]*)(?=\\])", - "comment": "Alphanumeric characters inside square brackets is a parameter." - }, { "name": "support.function", "match": "(?<=:)([A-Za-z0-9]*)", @@ -57,7 +62,7 @@ }, { "name": "entity.name.class", - "match": "[A-Za-z0-9!@%/]*", + "match": "[A-Za-z0-9!@%\\*_\\./]*", "comment": "Anything else matching these symbols is a class name." } ] diff --git a/KSP configuration.tmLanguage b/KSP configuration.tmLanguage index 92a202b..7603d99 100644 --- a/KSP configuration.tmLanguage +++ b/KSP configuration.tmLanguage @@ -20,11 +20,27 @@ name comment + + comment + Alphanumeric characters inside square brackets is a parameter. + match + (?<=[!\[])([A-Za-z0-9\*]*)(?=\]) + name + variable.parameter + + + comment + These symbols before alphabetical characters are for ModuleManager syntax. + match + ([!@%])(?=[A-Za-z]*) + name + support.function + comment Anything before an equal sign is a key in the key-value pairs. match - ([A-Za-z0-9@%_]*\s*)(?==) + ([A-Za-z0-9@%_,]*\s*)(?=([\*\+])?=) name keyword @@ -48,7 +64,7 @@ comment 'True' or 'False' after an equal sign is a boolean. match - (?<==)(\s*[Tt]rue||\s*[Ff]alse) + (?<==)(\s*([Tt]rue|[Ff]alse)) name constant.numeric @@ -56,7 +72,7 @@ comment Numeric characters, including scientific notation, is a number. match - \s*-?[0-9\.]+E?-?[0-9\.]* + (?<=[=,\s])(\s*-?[0-9\.]+E?-?[0-9\.]*) name constant.numeric @@ -64,7 +80,7 @@ comment 'NaN', 'Infinity', or 'None' after an equal sign is a non-numeric constant. match - (?<==)(\s*NaN||\s*Infinity||\s*None) + (?<==)(\s*(NaN|Infinity|None)) name constant.numeric @@ -76,14 +92,6 @@ name string - - comment - Alphanumeric characters inside square brackets is a parameter. - match - (?<=\[)([A-Za-z0-9]*)(?=\]) - name - variable.parameter - comment Alphanumeric characters after a colon is a function. @@ -96,7 +104,7 @@ comment Anything else matching these symbols is a class name. match - [A-Za-z0-9!@%/]* + [A-Za-z0-9!@%\*_\./]* name entity.name.class