Guest User

Untitled

a guest
Feb 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.23 KB | None | 0 0
  1. { scopeName = 'source.plist.language-definition.test';
  2. firstLineMatch = '^\{(\s*[a-zA-Z])?$';
  3. foldingStartMarker = '(\{|\()';
  4. foldingStopMarker = '(\}|\))';
  5. patterns = (
  6. { begin = '(\{)';
  7. end = '(\})';
  8. captures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  9. patterns = (
  10. { include = '#comment'; },
  11. { comment = 'scopeName';
  12. name = 'meta.rule.tm-language-def';
  13. begin = '\b(scopeName)\s*(=)';
  14. end = '(;)';
  15. beginCaptures =
  16. { 1 = { name = 'support.constant.tm-language-def'; };
  17. 2 = { name = 'keyword.operator.dictionary.tm-language-def'; };
  18. };
  19. endCaptures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  20. patterns = (
  21. { include = '#scope-name'; },
  22. { include = '#comment'; },
  23. { include = '#catch-all'; },
  24. );
  25. },
  26. { comment = 'fileTypes';
  27. begin = '\b(fileTypes)\s*(=)';
  28. end = '(;)';
  29. beginCaptures =
  30. { 1 = { name = 'support.constant.tm-language-def'; };
  31. 2 = { name = 'keyword.operator.dictionary.tm-language-def'; };
  32. };
  33. endCaptures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  34. patterns = (
  35. { begin = '(\()';
  36. end = '(\))';
  37. captures = { 1 = { name = 'keyword.operator.array.tm-language-def'; }; };
  38. patterns = (
  39. { include = '#comment'; },
  40. { begin = '(?=[^\s,])';
  41. end = '(,)|(?=\))';
  42. endCaptures = { 1 = { name = 'keyword.operator.array-separator.tm-language-def'; }; };
  43. patterns = (
  44. { match = '\s+(?=//|/\*)'; },
  45. { include = '#comment'; },
  46. { name = 'invalid.illegal.missing-comma.tm-language-def';
  47. begin = '[[^\n]&&\s](?!\s*(,|\)|$)).*';
  48. end = '^(?=not)possible$';
  49. },
  50. { include = '#string'; },
  51. );
  52. },
  53. { include = '#catch-all'; },
  54. );
  55. }
  56. );
  57. },
  58. { comment = 'firstLineMatch, foldingStartMarker, foldingStopMarker';
  59. begin = '\b(firstLineMatch|folding(Start|Stop)Marker)\s*(=)';
  60. end = '(;)';
  61. beginCaptures =
  62. { 1 = { name = 'support.constant.tm-language-def'; };
  63. 3 = { name = 'keyword.operator.dictionary.tm-language-def'; };
  64. };
  65. endCaptures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  66. patterns = (
  67. { include = '#regexp'; },
  68. { include = '#comment'; },
  69. { include = '#catch-all'; },
  70. );
  71. },
  72. { include = '#patterns'; },
  73. { comment = 'repository';
  74. begin = '\b(repository)\s*(=)';
  75. end = '(;)';
  76. beginCaptures =
  77. { 1 = { name = 'support.constant.tm-language-def'; };
  78. 2 = { name = 'keyword.operator.dictionary.tm-language-def'; };
  79. };
  80. endCaptures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  81. patterns = (
  82. { begin = '(\{)';
  83. end = '(\})';
  84. captures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  85. patterns = (
  86. { begin = '(["'']?)([a-z][a-z0-9\-]+)\1\s*(=)';
  87. end = '(;)';
  88. beginCaptures =
  89. { 2 = { name = 'entity.name.repository.tm-language-def'; };
  90. 3 = { name = 'keyword.operator.dictionary.tm-language-def'; };
  91. };
  92. endCaptures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  93. patterns = (
  94. { include = '#rule';},
  95. { include = '#comment'; },
  96. { include = '#catch-all'; },
  97. );
  98. },
  99. { include = '#string'; },
  100. { include = '#comment'; },
  101. { begin = '(=)';
  102. end = '(;)';
  103. captures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  104. patterns = ( { include = '#any'; } );
  105. },
  106. { name = 'keyword.operator.dictionary.tm-language-def';
  107. match = ';';
  108. },
  109. { include = '#catch-all'; },
  110. );
  111. }
  112. );
  113. },
  114. { include = '#comment-keyword'; },
  115. { include = '#invalid-keyword'; },
  116. { include = '#string'; },
  117. { begin = '(=)';
  118. end = '(;)';
  119. captures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  120. patterns = ( { include = '#any'; } );
  121. },
  122. { name = 'keyword.operator.dictionary.tm-language-def';
  123. match = ';';
  124. },
  125. { include = '#catch-all'; },
  126. );
  127. }
  128. );
  129. repository =
  130. { comment = { patterns = (
  131. { name = 'comment.block.tm-language-def';
  132. begin = '/\*';
  133. end = '\*/';
  134. },
  135. { name = 'comment.line.double-slash.tm-language-def';
  136. match = '//.*$\n?';
  137. },
  138. );
  139. };
  140. patterns =
  141. { begin = '\b(patterns)\s*(=)';
  142. end = '(;)';
  143. beginCaptures =
  144. { 1 = { name = 'support.constant.tm-language-def'; };
  145. 2 = { name = 'keyword.operator.dictionary.tm-language-def'; };
  146. };
  147. endCaptures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  148. patterns = (
  149. { begin = '(\()';
  150. end = '(\))';
  151. captures = { 1 = { name = 'keyword.operator.array.tm-language-def'; }; };
  152. patterns = (
  153. { include = '#comment'; },
  154. { begin = '(?=[^\s,])';
  155. end = '(,)|(?=\))';
  156. endCaptures = { 1 = { name = 'keyword.operator.array-separator.tm-language-def'; }; };
  157. patterns = (
  158. { match = '\s+(?=//|/\*)'; },
  159. { include = '#comment'; },
  160. { name = 'invalid.illegal.missing-comma.tm-language-def';
  161. begin = '[[^\n]&&\s](?!\s*(,|\)|$)).*';
  162. end = '^(?=not)possible$';
  163. },
  164. { include = '#rule'; },
  165. );
  166. },
  167. { include = '#catch-all'; },
  168. );
  169. }
  170. );
  171. };
  172. any = { patterns = (
  173. { include = '#string'; },
  174. { include = '#array'; },
  175. { include = '#dictionary'; },
  176. { include = '#data'; },
  177. { include = '#comment'; },
  178. { include = '#catch-all'; },
  179. );
  180. };
  181. array =
  182. { begin = '(\()';
  183. end = '(\))';
  184. captures = { 1 = { name = 'keyword.operator.array.tm-language-def'; }; };
  185. patterns = (
  186. { include = '#comment'; },
  187. { begin = '(?=[^\s,])';
  188. end = '(,)|(?=\))';
  189. endCaptures = { 1 = { name = 'keyword.operator.array-separator.tm-language-def'; }; };
  190. patterns = (
  191. { match = '\s+(?=//|/\*)'; },
  192. { include = '#comment'; },
  193. { name = 'invalid.illegal.missing-comma.tm-language-def';
  194. begin = '[[^\n]&&\s](?!\s*(,|\)|$)).*';
  195. end = '^(?=not)possible$';
  196. },
  197. { include = '#any'; },
  198. );
  199. },
  200. { include = '#catch-all'; },
  201. );
  202. };
  203. catch-all = { patterns = (
  204. { match = '\s+'; },
  205. { name = 'invalid.illegal.unrecognized-character.tm-language-def';
  206. match = '.';
  207. },
  208. );
  209. };
  210. comment-keyword =
  211. { begin = '\b(comment)\s*(=)';
  212. end = '(;)';
  213. beginCaptures =
  214. { 1 = { name = 'support.constant.tm-language-def'; };
  215. 2 = { name = 'keyword.operator.dictionary.tm-language-def'; };
  216. };
  217. endCaptures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  218. patterns = (
  219. { name = 'string.quoted.single.tm-language-def';
  220. begin = "'";
  221. end = "'";
  222. contentName = 'comment.block.string.tm-language-def';
  223. },
  224. { name = 'string.quoted.double.tm-language-def';
  225. begin = '"';
  226. end = '"';
  227. contentName = 'comment.block.string.tm-language-def';
  228. },
  229. { include = '#comment'; },
  230. { include = '#catch-all'; },
  231. );
  232. };
  233. dictionary =
  234. { begin = '(\{)';
  235. end = '(\})';
  236. captures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  237. patterns = (
  238. { include = '#string'; },
  239. { include = '#comment'; },
  240. { begin = '(=)';
  241. end = '(;)';
  242. captures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  243. patterns = ( { include = '#any'; } );
  244. },
  245. { name = 'keyword.operator.dictionary.tm-language-def';
  246. match = ';';
  247. },
  248. { include = '#catch-all'; },
  249. );
  250. };
  251. invalid-keyword = { patterns = (
  252. { name = 'invalid.illegal.misplaced-keyword.tm-language-def';
  253. match = '\b(fileTypes|foldingStartMarker|foldingStopMarker|patterns|match|begin|end|include|scopeName|captures|beginCaptures|endCaptures|firstLineMatch|comment|repository|disabled|contentName|applyEndPatternLast)\b';
  254. },
  255. { name = 'invalid.illegal.deprecated-keyword.tm-language-def';
  256. match = '\b(swallow|foregroundColor|backgroundColor|fontStyle|elementForegroundColor|elementBackgroundColor|elementFontStyle|mode|highlightPairs|smartTypingPairs|increaseIndentPattern)\b';
  257. },
  258. { name = 'invalid.illegal.unknown-keyword.tm-language-def';
  259. match = '[-a-zA-Z_.]+(?=\s*=)';
  260. },
  261. );
  262. };
  263. regexp = { patterns = (
  264. { name = 'string.quoted.single.tm-language-def';
  265. begin = "'";
  266. end = "'";
  267. patterns = ( { include = 'source.regexp.oniguruma'; } );
  268. contentName = 'source.regexp.oniguruma.embedded.tm-language-def';
  269. },
  270. { name = 'string.quoted.double.tm-language-def';
  271. begin = '"';
  272. end = '"';
  273. patterns = ( { include = 'source.regexp.oniguruma'; } );
  274. contentName = 'source.regexp.oniguruma.embedded.tm-language-def';
  275. },
  276. );
  277. };
  278. rule = {
  279. begin = '(\{)';
  280. end = '(\})';
  281. captures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  282. patterns = (
  283. { include = '#comment'; },
  284. { comment = 'name, contentName';
  285. name = 'meta.rule.tm-language-def';
  286. begin = '\b((contentN|n)ame)\s*(=)';
  287. end = '(;)';
  288. beginCaptures =
  289. { 1 = { name = 'support.constant.tm-language-def'; };
  290. 3 = { name = 'keyword.operator.dictionary.tm-language-def'; };
  291. };
  292. endCaptures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  293. patterns = (
  294. { include = '#scope-name'; },
  295. { include = '#comment'; },
  296. { include = '#catch-all'; },
  297. );
  298. },
  299. { comment = 'begin, end, match';
  300. begin = '\b(begin|end|match)\s*(=)';
  301. end = '(;)';
  302. beginCaptures =
  303. { 1 = { name = 'support.constant.tm-language-def'; };
  304. 2 = { name = 'keyword.operator.dictionary.tm-language-def'; };
  305. };
  306. endCaptures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  307. patterns = (
  308. { include = '#regexp'; },
  309. { include = '#comment'; },
  310. { include = '#catch-all'; },
  311. );
  312. },
  313. { comment = 'include';
  314. begin = '\b(include)\s*(=)';
  315. end = '(;)';
  316. beginCaptures =
  317. { 1 = { name = 'support.constant.tm-language-def'; };
  318. 2 = { name = 'keyword.operator.dictionary.tm-language-def'; };
  319. };
  320. endCaptures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  321. patterns = (
  322. { include = '#string'; },
  323. { include = '#comment'; },
  324. { include = '#catch-all'; },
  325. );
  326. },
  327. { comment = ;},
  328. { include = '#patterns'; },
  329. { include = '#comment-keyword';},
  330. { include = '#invalid-keyword';},
  331. { include = '#string'; },
  332. { begin = '(=)';
  333. end = '(;)';
  334. captures = { 1 = { name = 'keyword.operator.dictionary.tm-language-def'; }; };
  335. patterns = ( { include = '#any'; } );
  336. },
  337. { name = 'keyword.operator.dictionary.tm-language-def';
  338. match = ';';
  339. },
  340. { include = '#catch-all'; },
  341. );
  342. };
  343. scope-name = { patterns = (
  344. { name = 'string.quoted.single.tm-language-def';
  345. match = "'([a-z][a-z0-9.\-]+)'";
  346. captures = { 1 = { name = 'entity.name.scope.tm-language-def'; }; };
  347. },
  348. { name = 'string.quoted.double.tm-language-def';
  349. match = '"([a-z][a-z0-9.\-]+)"';
  350. captures = { 1 = { name = 'entity.name.scope.tm-language-def'; }; };
  351. },
  352. );
  353. };
  354. string = { patterns = (
  355. { name = 'constant.numeric.tm-language-def';
  356. match = '\b[0-9]+\b';
  357. },
  358. { name = 'string.unquoted.tm-language-def';
  359. match = '[-a-zA-Z0-9_.]+';
  360. },
  361. { name = 'string.quoted.single.tm-language-def';
  362. begin = "'";
  363. end = "'";
  364. patterns = ( { include = '#string-constant'; } );
  365. },
  366. { name = 'string.quoted.double.tm-language-def';
  367. begin = '"';
  368. end = '"';
  369. patterns = ( { include = '#string-constant'; } );
  370. },
  371. );
  372. };
  373. string-constant =
  374. { name = 'constant.character.escape.tm-language-def';
  375. match = '\\([uU](\h{4}|\h{2})|\d{1,3}|.)';
  376. };
  377. };
  378. }
Add Comment
Please, Sign In to add comment