moonscript.json 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. {
  2. "aliases": [
  3. "moon"
  4. ],
  5. "keywords": {
  6. "keyword": "if then not for in while do return else elseif break continue switch and or unless when class extends super local import export from using",
  7. "literal": "true false nil",
  8. "built_in": "_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug io math os package string table"
  9. },
  10. "illegal": "\\\/\\*",
  11. "contains": [
  12. {
  13. "className": "number",
  14. "begin": "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
  15. "relevance": 0,
  16. "starts": {
  17. "end": "(\\s*\/)?",
  18. "relevance": 0
  19. }
  20. },
  21. {
  22. "className": "string",
  23. "variants": [
  24. {
  25. "begin": "'",
  26. "end": "'",
  27. "contains": [
  28. {
  29. "begin": "\\\\[\\s\\S]",
  30. "relevance": 0
  31. }
  32. ]
  33. },
  34. {
  35. "begin": "\"",
  36. "end": "\"",
  37. "contains": [
  38. {
  39. "$ref": "#contains.1.variants.0.contains.0"
  40. },
  41. {
  42. "className": "subst",
  43. "begin": "#\\{",
  44. "end": "}",
  45. "keywords": {
  46. "$ref": "#keywords"
  47. },
  48. "contains": [
  49. {
  50. "$ref": "#contains.0"
  51. },
  52. {
  53. "$ref": "#contains.1"
  54. },
  55. {
  56. "className": "built_in",
  57. "begin": "@__[a-zA-Z]\\w*"
  58. },
  59. {
  60. "begin": "@[a-zA-Z]\\w*"
  61. },
  62. {
  63. "begin": "[a-zA-Z]\\w*\\\\[a-zA-Z]\\w*"
  64. }
  65. ]
  66. }
  67. ]
  68. }
  69. ]
  70. },
  71. {
  72. "$ref": "#contains.1.variants.1.contains.1.contains.2"
  73. },
  74. {
  75. "$ref": "#contains.1.variants.1.contains.1.contains.3"
  76. },
  77. {
  78. "$ref": "#contains.1.variants.1.contains.1.contains.4"
  79. },
  80. {
  81. "className": "comment",
  82. "begin": "--",
  83. "end": "$",
  84. "contains": [
  85. {
  86. "begin": "\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"
  87. },
  88. {
  89. "className": "doctag",
  90. "begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
  91. "relevance": 0
  92. }
  93. ]
  94. },
  95. {
  96. "className": "function",
  97. "begin": "^\\s*[A-Za-z$_][0-9A-Za-z$_]*\\s*=\\s*(\\(.*\\))?\\s*\\B[-=]>",
  98. "end": "[-=]>",
  99. "returnBegin": true,
  100. "contains": [
  101. {
  102. "className": "title",
  103. "begin": "[A-Za-z$_][0-9A-Za-z$_]*",
  104. "relevance": 0
  105. },
  106. {
  107. "className": "params",
  108. "begin": "\\([^\\(]",
  109. "returnBegin": true,
  110. "contains": [
  111. {
  112. "begin": "\\(",
  113. "end": "\\)",
  114. "keywords": {
  115. "$ref": "#keywords"
  116. },
  117. "contains": [
  118. "self",
  119. {
  120. "$ref": "#contains.0"
  121. },
  122. {
  123. "$ref": "#contains.1"
  124. },
  125. {
  126. "$ref": "#contains.1.variants.1.contains.1.contains.2"
  127. },
  128. {
  129. "$ref": "#contains.1.variants.1.contains.1.contains.3"
  130. },
  131. {
  132. "$ref": "#contains.1.variants.1.contains.1.contains.4"
  133. }
  134. ]
  135. }
  136. ]
  137. }
  138. ]
  139. },
  140. {
  141. "begin": "[\\(,:=]\\s*",
  142. "relevance": 0,
  143. "contains": [
  144. {
  145. "className": "function",
  146. "begin": "(\\(.*\\))?\\s*\\B[-=]>",
  147. "end": "[-=]>",
  148. "returnBegin": true,
  149. "contains": [
  150. {
  151. "$ref": "#contains.6.contains.1"
  152. }
  153. ]
  154. }
  155. ]
  156. },
  157. {
  158. "className": "class",
  159. "beginKeywords": "class",
  160. "end": "$",
  161. "illegal": "[:=\"\\[\\]]",
  162. "contains": [
  163. {
  164. "beginKeywords": "extends",
  165. "endsWithParent": true,
  166. "illegal": "[:=\"\\[\\]]",
  167. "contains": [
  168. {
  169. "$ref": "#contains.6.contains.0"
  170. }
  171. ]
  172. },
  173. {
  174. "$ref": "#contains.6.contains.0"
  175. }
  176. ]
  177. },
  178. {
  179. "className": "name",
  180. "begin": "[A-Za-z$_][0-9A-Za-z$_]*:",
  181. "end": ":",
  182. "returnBegin": true,
  183. "returnEnd": true,
  184. "relevance": 0
  185. }
  186. ]
  187. }