|
| 1 | +--- |
| 2 | +"$schema": https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json |
| 3 | +scopeName: source.just |
| 4 | +name: JustLang |
| 5 | + |
| 6 | +patterns: |
| 7 | + - include: "#interpolate" |
| 8 | + - include: "#comments" |
| 9 | + - include: "#scripts" |
| 10 | + - include: "#strings" |
| 11 | + - include: "#assignments" |
| 12 | + - include: "#recipeDefinition" |
| 13 | + - include: "#keywords" |
| 14 | + |
| 15 | +repository: |
| 16 | + comments: |
| 17 | + patterns: |
| 18 | + - name: comment.line.just |
| 19 | + match: "^#[^!].*" |
| 20 | + |
| 21 | + scripts: |
| 22 | + patterns: |
| 23 | + - include: "#scripts_js" |
| 24 | + - include: "#scripts_lua" |
| 25 | + - include: "#scripts_perl" |
| 26 | + - include: "#scripts_ruby" |
| 27 | + - include: "#scripts_python" |
| 28 | + - include: "#scripts_shell" |
| 29 | + |
| 30 | + scripts_python: |
| 31 | + patterns: |
| 32 | + - name: markup.fenced_code.block.just |
| 33 | + begin: "^\\s+(#!\\s*(?:/usr)?/bin/(?:env\\s+)?)(python(?:-?\\d+(?:\\.\\d+)?)?)(?:\\s|$)" |
| 34 | + end: "^$" |
| 35 | + beginCaptures: |
| 36 | + "1": |
| 37 | + name: comment.line.shebang.just |
| 38 | + "2": |
| 39 | + name: keyword.other |
| 40 | + contentName: meta.embedded.block.python |
| 41 | + patterns: |
| 42 | + - include: source.python |
| 43 | + |
| 44 | + scripts_js: |
| 45 | + patterns: |
| 46 | + - name: markup.fenced_code.block.just |
| 47 | + begin: "^\\s+(#!\\s*(?:/usr)?/bin/(?:env\\s+)?)(node(?:js)?)(?:\\s|$)" |
| 48 | + end: "^$" |
| 49 | + beginCaptures: |
| 50 | + "1": |
| 51 | + name: comment.line.shebang.just |
| 52 | + "2": |
| 53 | + name: keyword.other |
| 54 | + contentName: meta.embedded.block.javascript |
| 55 | + patterns: |
| 56 | + - include: source.js |
| 57 | + |
| 58 | + scripts_perl: |
| 59 | + patterns: |
| 60 | + - name: markup.fenced_code.block.just |
| 61 | + begin: "^\\s+(#!\\s*(?:/usr)?/bin/(?:env\\s+)?)(perl)(?:\\s|$)" |
| 62 | + end: "^$" |
| 63 | + beginCaptures: |
| 64 | + "1": |
| 65 | + name: comment.line.shebang.just |
| 66 | + "2": |
| 67 | + name: keyword.other |
| 68 | + contentName: meta.embedded.block.perl |
| 69 | + patterns: |
| 70 | + - include: source.perl |
| 71 | + |
| 72 | + scripts_ruby: |
| 73 | + patterns: |
| 74 | + - name: markup.fenced_code.block.just |
| 75 | + begin: "^\\s+(#!\\s*(?:/usr)?/bin/(?:env\\s+)?)(ruby-?(?:-?\\d+(?:\\.\\d+)?)?)(?:\\s|$)" |
| 76 | + end: "^$" |
| 77 | + beginCaptures: |
| 78 | + "1": |
| 79 | + name: comment.line.shebang.just |
| 80 | + "2": |
| 81 | + name: keyword.other |
| 82 | + contentName: meta.embedded.block.ruby |
| 83 | + patterns: |
| 84 | + - include: source.ruby |
| 85 | + |
| 86 | + scripts_lua: |
| 87 | + patterns: |
| 88 | + - name: markup.fenced_code.block.just |
| 89 | + begin: "^\\s+(#!\\s*(?:/usr)?/bin/(?:env\\s+)?)(lua(?:-?\\d+(?:\\.\\d+)?)?)(?:\\s|$)" |
| 90 | + end: "^$" |
| 91 | + beginCaptures: |
| 92 | + "1": |
| 93 | + - name: comment.line.shebang.just |
| 94 | + "2": |
| 95 | + name: keyword.other |
| 96 | + contentName: meta.embedded.block.lua |
| 97 | + patterns: |
| 98 | + - include: source.lua |
| 99 | + |
| 100 | + scripts_shell: |
| 101 | + patterns: |
| 102 | + - name: markup.fenced_code.block.just |
| 103 | + begin: "^\\s+(#!\\s*(?:/usr)?/bin/(?:env\\s+)?)((?>fi|ba|c|k|z)?sh)(?:\\s|$)" |
| 104 | + end: "^$" |
| 105 | + beginCaptures: |
| 106 | + "1": |
| 107 | + name: comment.line.shebang.just |
| 108 | + "2": |
| 109 | + name: keyword.other |
| 110 | + contentName: meta.embedded.block.shellscript |
| 111 | + patterns: |
| 112 | + - include: source.shell |
| 113 | + - name: markup.inline.raw.just |
| 114 | + begin: "`" |
| 115 | + end: "`" |
| 116 | + contentName: meta.embedded.line.shellscript |
| 117 | + patterns: |
| 118 | + - include: source.shell |
| 119 | + |
| 120 | + strings: |
| 121 | + patterns: |
| 122 | + - name: string.quoted.double.just |
| 123 | + begin: "\"" |
| 124 | + end: "\"" |
| 125 | + - name: string.quoted.single.just |
| 126 | + begin: "'" |
| 127 | + end: "'" |
| 128 | + |
| 129 | + assignments: |
| 130 | + patterns: |
| 131 | + - match: "^((?:export|set)\\s+)?([a-zA-Z_][a-zA-Z0-9_-]*)\\s*:?=" |
| 132 | + captures: |
| 133 | + "1": |
| 134 | + name: storage.type.just |
| 135 | + "2": |
| 136 | + name: variable.name.just |
| 137 | + |
| 138 | + recipeDefinition: |
| 139 | + patterns: |
| 140 | + - match: "^(@)?([a-zA-Z_][a-zA-Z0-9_-]*)([a-zA-Z0-9=\\s_-`'\"]*):([\\sa-zA-Z0-9_-]*).*$" |
| 141 | + captures: |
| 142 | + "1": |
| 143 | + name: entity.name.function.just |
| 144 | + "2": |
| 145 | + name: entity.name.function.just |
| 146 | + "3": |
| 147 | + patterns: |
| 148 | + - name: constant.character.escape.just |
| 149 | + match: "[\\s]*[a-zA-Z0-9-_]*(=?)(.*)" |
| 150 | + captures: |
| 151 | + "0": |
| 152 | + name: variable.name.just |
| 153 | + "1": |
| 154 | + name: constant.other.just |
| 155 | + "2": |
| 156 | + name: variable.parameter.just |
| 157 | + "4": |
| 158 | + name: support.type.property-name.just |
| 159 | + |
| 160 | + interpolate: |
| 161 | + patterns: |
| 162 | + - name: string.interpolated.just |
| 163 | + begin: "\\{\\{" |
| 164 | + end: "\\}\\}" |
| 165 | + |
| 166 | + keywords: |
| 167 | + patterns: |
| 168 | + - name: keyword.control.just |
| 169 | + match: "\\b(arch|os|os_family|env_var|env_var_or_default)\\b" |
0 commit comments