mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-17 14:30:32 +00:00
This changes all the syntax files in the runtime directory and also changes how syntax highlighting is done from inside micro.
42 lines
No EOL
1.7 KiB
YAML
42 lines
No EOL
1.7 KiB
YAML
filetype: typescript
|
|
|
|
detect:
|
|
filename: "\\.ts$"
|
|
|
|
rules:
|
|
- constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
|
|
- constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
|
|
- constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
|
|
- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
|
|
- statement: "\\b(abstract|as|async|await|break|case|catch|class|const|constructor|continue)\\b"
|
|
- statement: "\\b(debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from)\\b"
|
|
- statement: "\\b(function|get|if|implements|import|in|instanceof|interface|is|let|module|namespace)\\b"
|
|
- statement: "\\b(new|of|package|private|protected|public|require|return|set|static|super|switch)\\b"
|
|
- statement: "\\b(this|throw|try|type|typeof|var|void|while|with|yield)\\b"
|
|
- constant: "\\b(false|true|null|undefined|NaN)\\b"
|
|
- type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Math)\\b"
|
|
- type: "\\b(Number|Object|RegExp|String|Symbol)\\b"
|
|
- type: "\\b(any|boolean|never|number|string|symbol)\\b"
|
|
- statement: "[-+/*=<>!~%?:&|]"
|
|
- constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*"
|
|
- constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]"
|
|
- comment:
|
|
start: "//"
|
|
end: "$"
|
|
rules: []
|
|
- comment:
|
|
start: "/\\*"
|
|
end: "\\*/"
|
|
rules:
|
|
- todo: "TODO:?"
|
|
- constant.string:
|
|
start: "\""
|
|
end: "\""
|
|
rules:
|
|
- constant.specialChar: "\\\\."
|
|
- constant.string:
|
|
start: "'"
|
|
end: "'"
|
|
rules:
|
|
- constant.specialChar: "\\\\."
|
|
|