X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=runtime%2Fsyntax%2Ftypescript.yaml;h=9ce50ebd71216a61fd4a7d755eaf65a32a0f708e;hb=54c23cae72d7237bc898a59f79aad0acffdf0ffe;hp=541d3484f6b4c4207833792ba169b46e3d56ef86;hpb=b977bf5cca84f7dc762fe8d9967831502ee5cc87;p=micro.git diff --git a/runtime/syntax/typescript.yaml b/runtime/syntax/typescript.yaml index 541d3484..9ce50ebd 100644 --- a/runtime/syntax/typescript.yaml +++ b/runtime/syntax/typescript.yaml @@ -1,26 +1,44 @@ filetype: typescript -detect: +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.class: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]" + - 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.bool: "\\b(false|true|null|undefined|NaN)\\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" - - symbol.operator: "[\\-+/*=<>!~%?:&|]" + - statement: "[-+/*=<>!~%?:&|]" - constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*" - constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]" - - comment: "(^|[[:space:]])//.*" - - comment: "/\\*.+\\*/" - - todo: "TODO:?" - - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - comment: + start: "//" + end: "$" + rules: [] + - comment: + start: "/\\*" + end: "\\*/" + rules: + - todo: "TODO:?" + - constant.string: + start: "\"" + end: "\"" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\." + - constant.string: + start: "'" + end: "'" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\." +