|
| 1 | +{ |
| 2 | + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", |
| 3 | + "name": "Encode", |
| 4 | + "patterns": [ |
| 5 | + { |
| 6 | + "include": "#comments" |
| 7 | + }, |
| 8 | + { |
| 9 | + "include": "#keywords" |
| 10 | + }, |
| 11 | + { |
| 12 | + "include": "#operators" |
| 13 | + }, |
| 14 | + { |
| 15 | + "include": "#strings" |
| 16 | + }, |
| 17 | + { |
| 18 | + "include": "#types" |
| 19 | + }, |
| 20 | + { |
| 21 | + "include": "#values" |
| 22 | + } |
| 23 | + ], |
| 24 | + "repository": { |
| 25 | + "comments": { |
| 26 | + "patterns": [ |
| 27 | + { |
| 28 | + "name": "comment.block.encode", |
| 29 | + "begin": "/\\*", |
| 30 | + "end": "\\*/" |
| 31 | + }, |
| 32 | + { |
| 33 | + "name": "comment.line.double-slash.encode", |
| 34 | + "match": "//[^\n]*" |
| 35 | + } |
| 36 | + ] |
| 37 | + }, |
| 38 | + "keywords": { |
| 39 | + "patterns": [ |
| 40 | + { |
| 41 | + "name": "keyword.control.encode", |
| 42 | + "match": "\\b(if|elif|else|do|while|finally|return|break|continue)\\b" |
| 43 | + }, |
| 44 | + { |
| 45 | + "name": "keyword.other.encode", |
| 46 | + "match": "\\b(let)\\b" |
| 47 | + } |
| 48 | + ] |
| 49 | + }, |
| 50 | + "operators": { |
| 51 | + "patterns": [ |
| 52 | + { |
| 53 | + "name": "keyword.logical.encode", |
| 54 | + "match": "\\b(and|or|not|in)\\b" |
| 55 | + }, |
| 56 | + { |
| 57 | + "name": "keyword.operator.compound.encode", |
| 58 | + "match": "(\\+|-|\\*|\\/|%|~|&|\\||\\^|<<|>>|>>>|\\?\\?)=" |
| 59 | + }, |
| 60 | + { |
| 61 | + "name": "keyword.operator.encode", |
| 62 | + "match": "(\\+\\+|--|\\+|-|\\*|\\/|%|~|&|\\||\\^|<<|>>|>>>|\\?\\?|>=|<=|>|<|==|!=|=)" |
| 63 | + } |
| 64 | + ] |
| 65 | + }, |
| 66 | + "strings": { |
| 67 | + "patterns": [ |
| 68 | + { |
| 69 | + "name": "string.quoted.double.encode", |
| 70 | + "begin": "\"", |
| 71 | + "end": "\"", |
| 72 | + "patterns": [ |
| 73 | + { |
| 74 | + "name": "constant.character.escape.encode", |
| 75 | + "match": "\\\\." |
| 76 | + } |
| 77 | + ] |
| 78 | + }, |
| 79 | + { |
| 80 | + "name": "string.quoted.single.encode", |
| 81 | + "begin": "'", |
| 82 | + "end": "'", |
| 83 | + "patterns": [ |
| 84 | + { |
| 85 | + "name": "constant.character.escape.encode", |
| 86 | + "match": "\\\\." |
| 87 | + } |
| 88 | + ] |
| 89 | + } |
| 90 | + ] |
| 91 | + }, |
| 92 | + "types": { |
| 93 | + "patterns": [ |
| 94 | + { |
| 95 | + "name": "support.type.encode", |
| 96 | + "match": "\\b(bool|(i|u|b)(8|16|32|64)|(r|x)(32|64)|string)\\b" |
| 97 | + } |
| 98 | + ] |
| 99 | + }, |
| 100 | + "values": { |
| 101 | + "patterns": [ |
| 102 | + { |
| 103 | + "name": "constant.numeric.encode", |
| 104 | + "match": "\\b([0-9]+(\\.[0-9]+(i|I|j|J)?)?)\\b" |
| 105 | + }, |
| 106 | + { |
| 107 | + "name": "constant.numeric.binary.encode", |
| 108 | + "match": "\\b(0b([01][01_]*[01]|[01]))\\b" |
| 109 | + }, |
| 110 | + { |
| 111 | + "name": "constant.numeric.octal.encode", |
| 112 | + "match": "\\b(0o([0-7][0-7_]*[0-7]|[0-7]))\\b" |
| 113 | + }, |
| 114 | + { |
| 115 | + "name": "constant.numeric.hex.encode", |
| 116 | + "match": "\\b(0x([0-9a-fA-F][0-9a-fA-F_]*[0-9a-fA-F]|[0-9a-fA-F]))\\b" |
| 117 | + }, |
| 118 | + { |
| 119 | + "name": "constant.language.encode", |
| 120 | + "match": "\\b(true|false|(inf|NaN)(i|I|j|J)?)\\b" |
| 121 | + }, |
| 122 | + { |
| 123 | + "name": "variable.encode", |
| 124 | + "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b" |
| 125 | + } |
| 126 | + ] |
| 127 | + } |
| 128 | + }, |
| 129 | + "scopeName": "source.encode" |
| 130 | +} |
0 commit comments