2019-05-11 00:40:23 +02:00
|
|
|
syntax "typescript" "\.(ts)$"
|
2020-03-18 02:45:31 +01:00
|
|
|
header "^#!.*\/(env +)ts-node"
|
2019-05-11 00:40:23 +02:00
|
|
|
|
|
|
|
## Default
|
|
|
|
color white "^.+$"
|
|
|
|
|
2020-11-19 16:49:48 +01:00
|
|
|
## Decimal, octal and hexadecimal numbers
|
2019-05-11 00:40:23 +02:00
|
|
|
color yellow "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>"
|
|
|
|
|
|
|
|
## Floating point number with at least one digit before decimal point
|
|
|
|
color yellow "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
|
|
|
|
color yellow "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
|
|
|
|
|
|
|
|
## Keywords
|
2020-03-12 03:36:48 +01:00
|
|
|
color green "\<(as|abstract|asserts|boolean|break|byte|case|catch)\>"
|
2019-05-11 00:40:23 +02:00
|
|
|
color green "\<(class|const|continue|debugger|default|delete|readonly)\>"
|
|
|
|
color green "\<(do|else|enum|export|extends|finally|final|for)\>"
|
|
|
|
color green "\<(from|function|goto|if|implements|import|instanceof)\>"
|
2020-03-12 03:36:48 +01:00
|
|
|
color green "\<(var|interface|int|in|is|infer|let|new|package|private)\>"
|
2019-05-11 00:40:23 +02:00
|
|
|
color green "\<(protected|public|return|static|super|switch)\>"
|
2020-03-12 03:35:16 +01:00
|
|
|
color green "\<(this|throw|try|typeof|type)\>"
|
2019-05-11 00:40:23 +02:00
|
|
|
color green "\<(void|while|with|yield)\>"
|
2020-01-11 03:09:43 +01:00
|
|
|
color green "\<(async|await)\>"
|
2020-03-12 03:35:16 +01:00
|
|
|
color green "\<(set|get)\>"
|
|
|
|
color green "\<(module|namespace)\>"
|
|
|
|
color green "\<(declare)\>"
|
2019-05-11 00:40:23 +02:00
|
|
|
|
|
|
|
## Type specifiers
|
|
|
|
color red "\<(Array|Boolean|Date|Enumerator|Error|Function)\>"
|
|
|
|
color red "\<(Number|Object|RegExp|String)\>"
|
|
|
|
color red "\<(true|false)\>"
|
|
|
|
|
|
|
|
## String
|
|
|
|
color brightyellow "L?\"(\\"|[^"])*\""
|
|
|
|
color brightyellow "L?'(\'|[^'])*'"
|
|
|
|
color brightcyan "L?`(\`|[^`])*`"
|
|
|
|
color brightwhite,blue start="\$\{" end="\}"
|
|
|
|
|
|
|
|
## Escapes
|
|
|
|
color red "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
|
|
|
|
|
|
|
|
## Comments
|
|
|
|
color magenta start="/\*" end="\*/"
|
2019-12-02 14:28:54 +01:00
|
|
|
color magenta "^\s*//.*$"
|
2019-11-02 04:57:35 +01:00
|
|
|
|
|
|
|
## Trailing whitespace
|
|
|
|
color ,green "[[:space:]]+$"
|