| 1 |
{ |
| 2 |
"name": "turtle", |
| 3 |
"scopeName": "source.turtle", |
| 4 |
"fileTypes": ["turtle", "ttl", "acl"], |
| 5 |
"patterns": [ |
| 6 |
{ |
| 7 |
"include": "#rule-constraint" |
| 8 |
}, |
| 9 |
{ |
| 10 |
"include": "#iriref" |
| 11 |
}, |
| 12 |
{ |
| 13 |
"include": "#prefix" |
| 14 |
}, |
| 15 |
{ |
| 16 |
"include": "#prefixed-name" |
| 17 |
}, |
| 18 |
{ |
| 19 |
"include": "#comment" |
| 20 |
}, |
| 21 |
{ |
| 22 |
"include": "#special-predicate" |
| 23 |
}, |
| 24 |
{ |
| 25 |
"include": "#literals" |
| 26 |
}, |
| 27 |
{ |
| 28 |
"include": "#language-tag" |
| 29 |
} |
| 30 |
], |
| 31 |
"uuid": "230498230498sdfkj8909-34df-23dfs", |
| 32 |
"repository": { |
| 33 |
"prefix": { |
| 34 |
"name": "keyword.operator.turtle", |
| 35 |
"match": "(?i:@?base|@?prefix)\\s" |
| 36 |
}, |
| 37 |
"iriref": { |
| 38 |
"name": "entity.name.type.iriref.turtle", |
| 39 |
"match": "<[^\\x20-\\x20<>\"{}|^`\\\\]*>" |
| 40 |
}, |
| 41 |
"prefixed-name": { |
| 42 |
"name": "constant.complex.turtle", |
| 43 |
"match": "(\\w*:)(\\w*)", |
| 44 |
"captures": { |
| 45 |
"1": { |
| 46 |
"name": "storage.type.PNAME_NS.turtle" |
| 47 |
}, |
| 48 |
"2": { |
| 49 |
"name": "support.variable.PN_LOCAL.turtle" |
| 50 |
} |
| 51 |
} |
| 52 |
}, |
| 53 |
"comment": { |
| 54 |
"name": "comment.line.number-sign.turtle", |
| 55 |
"match": "#.*$" |
| 56 |
}, |
| 57 |
"special-predicate": { |
| 58 |
"name": "meta.specialPredicate.turtle", |
| 59 |
"match": "\\s(a)\\s", |
| 60 |
"captures": { |
| 61 |
"1": { |
| 62 |
"name": "keyword.control.turtle" |
| 63 |
} |
| 64 |
} |
| 65 |
}, |
| 66 |
"literals": { |
| 67 |
"patterns": [ |
| 68 |
{ |
| 69 |
"include": "#string" |
| 70 |
}, |
| 71 |
{ |
| 72 |
"include": "#numeric" |
| 73 |
}, |
| 74 |
{ |
| 75 |
"include": "#boolean" |
| 76 |
} |
| 77 |
] |
| 78 |
}, |
| 79 |
"string": { |
| 80 |
"patterns": [ |
| 81 |
{ |
| 82 |
"include": "#triple-squote-string-literal" |
| 83 |
}, |
| 84 |
{ |
| 85 |
"include": "#triple-dquote-string-literal" |
| 86 |
}, |
| 87 |
{ |
| 88 |
"include": "#single-squote-string-literal" |
| 89 |
}, |
| 90 |
{ |
| 91 |
"include": "#single-dquote-string-literal" |
| 92 |
}, |
| 93 |
{ |
| 94 |
"include": "#triple-tick-string-literal" |
| 95 |
} |
| 96 |
] |
| 97 |
}, |
| 98 |
"single-squote-string-literal": { |
| 99 |
"name": "string.quoted.single.turtle", |
| 100 |
"begin": "'", |
| 101 |
"beginCaptures": { |
| 102 |
"0": { |
| 103 |
"name": "punctuation.definition.string.begin.turtle" |
| 104 |
} |
| 105 |
}, |
| 106 |
"end": "'", |
| 107 |
"endCaptures": { |
| 108 |
"1": { |
| 109 |
"name": "punctuation.definition.string.end.turtle" |
| 110 |
}, |
| 111 |
"2": { |
| 112 |
"name": "invalid.illegal.newline.turtle" |
| 113 |
} |
| 114 |
}, |
| 115 |
"patterns": [ |
| 116 |
{ |
| 117 |
"include": "#string-character-escape" |
| 118 |
} |
| 119 |
] |
| 120 |
}, |
| 121 |
"single-dquote-string-literal": { |
| 122 |
"name": "string.quoted.double.turtle", |
| 123 |
"begin": "\"", |
| 124 |
"beginCaptures": { |
| 125 |
"0": { |
| 126 |
"name": "punctuation.definition.string.begin.turtle" |
| 127 |
} |
| 128 |
}, |
| 129 |
"end": "\"", |
| 130 |
"endCaptures": { |
| 131 |
"0": { |
| 132 |
"name": "punctuation.definition.string.end.turtle" |
| 133 |
} |
| 134 |
}, |
| 135 |
"patterns": [ |
| 136 |
{ |
| 137 |
"include": "#string-character-escape" |
| 138 |
} |
| 139 |
] |
| 140 |
}, |
| 141 |
"triple-squote-string-literal": { |
| 142 |
"name": "string.quoted.triple.turtle", |
| 143 |
"begin": "'''", |
| 144 |
"end": "'''", |
| 145 |
"beginCaptures": { |
| 146 |
"0": { |
| 147 |
"name": "punctuation.definition.string.begin.turtle" |
| 148 |
} |
| 149 |
}, |
| 150 |
"endCaptures": { |
| 151 |
"0": { |
| 152 |
"name": "punctuation.definition.string.end.turtle" |
| 153 |
} |
| 154 |
}, |
| 155 |
"patterns": [ |
| 156 |
{ |
| 157 |
"include": "#string-character-escape" |
| 158 |
} |
| 159 |
] |
| 160 |
}, |
| 161 |
"triple-dquote-string-literal": { |
| 162 |
"name": "string.quoted.triple.turtle", |
| 163 |
"begin": "\"\"\"", |
| 164 |
"end": "\"\"\"", |
| 165 |
"beginCaptures": { |
| 166 |
"0": { |
| 167 |
"name": "punctuation.definition.string.begin.turtle" |
| 168 |
} |
| 169 |
}, |
| 170 |
"endCaptures": { |
| 171 |
"0": { |
| 172 |
"name": "punctuation.definition.string.end.turtle" |
| 173 |
} |
| 174 |
}, |
| 175 |
"patterns": [ |
| 176 |
{ |
| 177 |
"include": "#string-character-escape" |
| 178 |
} |
| 179 |
] |
| 180 |
}, |
| 181 |
"triple-tick-string-literal": { |
| 182 |
"name": "string.quoted.triple.turtle", |
| 183 |
"begin": "```", |
| 184 |
"end": "```", |
| 185 |
"beginCaptures": { |
| 186 |
"0": { |
| 187 |
"name": "punctuation.definition.string.begin.turtle" |
| 188 |
} |
| 189 |
}, |
| 190 |
"endCaptures": { |
| 191 |
"0": { |
| 192 |
"name": "punctuation.definition.string.end.turtle" |
| 193 |
} |
| 194 |
}, |
| 195 |
"patterns": [ |
| 196 |
{ |
| 197 |
"include": "#string-character-escape" |
| 198 |
} |
| 199 |
] |
| 200 |
}, |
| 201 |
"string-character-escape": { |
| 202 |
"name": "constant.character.escape.turtle", |
| 203 |
"match": "\\\\(x\\h{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)" |
| 204 |
}, |
| 205 |
"numeric": { |
| 206 |
"patterns": [ |
| 207 |
{ |
| 208 |
"include": "#integer" |
| 209 |
} |
| 210 |
] |
| 211 |
}, |
| 212 |
"integer": { |
| 213 |
"name": "constant.numeric.turtle", |
| 214 |
"match": "[+-]?(?:\\d+|[0-9]+\\.[0-9]*|\\.[0-9]+(?:[eE][+-]?\\d+)?)" |
| 215 |
}, |
| 216 |
"boolean": { |
| 217 |
"name": "constant.language.sparql", |
| 218 |
"match": "\\b(?i:true|false)\\b" |
| 219 |
}, |
| 220 |
"language-tag": { |
| 221 |
"name": "meta.string-literal-language-tag.turtle", |
| 222 |
"match": "@(\\w+)", |
| 223 |
"captures": { |
| 224 |
"1": { |
| 225 |
"name": "entity.name.class.turtle" |
| 226 |
} |
| 227 |
} |
| 228 |
}, |
| 229 |
"rule-constraint": { |
| 230 |
"name": "meta.rule-constraint.turtle", |
| 231 |
"begin": "(rule:content) (\"\"\")", |
| 232 |
"beginCaptures": { |
| 233 |
"1": { |
| 234 |
"patterns": [ |
| 235 |
{ |
| 236 |
"include": "#prefixed-name" |
| 237 |
} |
| 238 |
] |
| 239 |
}, |
| 240 |
"2": { |
| 241 |
"name": "string.quoted.triple.turtle" |
| 242 |
} |
| 243 |
}, |
| 244 |
"end": "\"\"\"", |
| 245 |
"endCaptures": { |
| 246 |
"0": { |
| 247 |
"name": "string.quoted.triple.turtle" |
| 248 |
} |
| 249 |
}, |
| 250 |
"patterns": [ |
| 251 |
{ |
| 252 |
"include": "source.srs" |
| 253 |
} |
| 254 |
] |
| 255 |
} |
| 256 |
} |
| 257 |
} |
| 258 |
|