Skip to content

Commit

Permalink
Moved some things around, more support for ModuleManager; Todo: fix c…
Browse files Browse the repository at this point in the history
…lassnames
  • Loading branch information
NathanJang committed Dec 5, 2014
1 parent 8c2fb86 commit 728b188
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 23 deletions.
25 changes: 15 additions & 10 deletions KSP configuration.JSON-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -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."
},
{
Expand All @@ -27,37 +37,32 @@
},
{
"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."
},
{
"name": "string",
"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]*)",
"comment": "Alphanumeric characters after a colon is a function."
},
{
"name": "entity.name.class",
"match": "[A-Za-z0-9!@%/]*",
"match": "[A-Za-z0-9!@%\\*_\\./]*",
"comment": "Anything else matching these symbols is a class name."
}
]
Expand Down
34 changes: 21 additions & 13 deletions KSP configuration.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,27 @@
<key>name</key>
<string>comment</string>
</dict>
<dict>
<key>comment</key>
<string>Alphanumeric characters inside square brackets is a parameter.</string>
<key>match</key>
<string>(?&lt;=[!\[])([A-Za-z0-9\*]*)(?=\])</string>
<key>name</key>
<string>variable.parameter</string>
</dict>
<dict>
<key>comment</key>
<string>These symbols before alphabetical characters are for ModuleManager syntax.</string>
<key>match</key>
<string>([!@%])(?=[A-Za-z]*)</string>
<key>name</key>
<string>support.function</string>
</dict>
<dict>
<key>comment</key>
<string>Anything before an equal sign is a key in the key-value pairs.</string>
<key>match</key>
<string>([A-Za-z0-9@%_]*\s*)(?==)</string>
<string>([A-Za-z0-9@%_,]*\s*)(?=([\*\+])?=)</string>
<key>name</key>
<string>keyword</string>
</dict>
Expand All @@ -48,23 +64,23 @@
<key>comment</key>
<string>'True' or 'False' after an equal sign is a boolean.</string>
<key>match</key>
<string>(?&lt;==)(\s*[Tt]rue||\s*[Ff]alse)</string>
<string>(?&lt;==)(\s*([Tt]rue|[Ff]alse))</string>
<key>name</key>
<string>constant.numeric</string>
</dict>
<dict>
<key>comment</key>
<string>Numeric characters, including scientific notation, is a number.</string>
<key>match</key>
<string>\s*-?[0-9\.]+E?-?[0-9\.]*</string>
<string>(?&lt;=[=,\s])(\s*-?[0-9\.]+E?-?[0-9\.]*)</string>
<key>name</key>
<string>constant.numeric</string>
</dict>
<dict>
<key>comment</key>
<string>'NaN', 'Infinity', or 'None' after an equal sign is a non-numeric constant.</string>
<key>match</key>
<string>(?&lt;==)(\s*NaN||\s*Infinity||\s*None)</string>
<string>(?&lt;==)(\s*(NaN|Infinity|None))</string>
<key>name</key>
<string>constant.numeric</string>
</dict>
Expand All @@ -76,14 +92,6 @@
<key>name</key>
<string>string</string>
</dict>
<dict>
<key>comment</key>
<string>Alphanumeric characters inside square brackets is a parameter.</string>
<key>match</key>
<string>(?&lt;=\[)([A-Za-z0-9]*)(?=\])</string>
<key>name</key>
<string>variable.parameter</string>
</dict>
<dict>
<key>comment</key>
<string>Alphanumeric characters after a colon is a function.</string>
Expand All @@ -96,7 +104,7 @@
<key>comment</key>
<string>Anything else matching these symbols is a class name.</string>
<key>match</key>
<string>[A-Za-z0-9!@%/]*</string>
<string>[A-Za-z0-9!@%\*_\./]*</string>
<key>name</key>
<string>entity.name.class</string>
</dict>
Expand Down

0 comments on commit 728b188

Please sign in to comment.