routeros.json 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. {
  2. "aliases": [
  3. "routeros",
  4. "mikrotik"
  5. ],
  6. "case_insensitive": true,
  7. "lexemes": ":?[\\w\\-]+",
  8. "keywords": {
  9. "literal": "true false yes no nothing nil null",
  10. "keyword": "foreach do while for if from to step else on-error and or not in :foreach :do :while :for :if :from :to :step :else :on-error :and :or :not :in :global :local :beep :delay :put :len :typeof :pick :log :time :set :find :environment :terminal :error :execute :parse :resolve :toarray :tobool :toid :toip :toip6 :tonum :tostr :totime"
  11. },
  12. "contains": [
  13. {
  14. "variants": [
  15. {
  16. "begin": "^@",
  17. "end": "$"
  18. },
  19. {
  20. "begin": "\\\/\\*",
  21. "end": "\\*\\\/"
  22. },
  23. {
  24. "begin": "%%",
  25. "end": "$"
  26. },
  27. {
  28. "begin": "^'",
  29. "end": "$"
  30. },
  31. {
  32. "begin": "^\\s*\\\/[\\w\\-]+=",
  33. "end": "$"
  34. },
  35. {
  36. "begin": "\\\/\\\/",
  37. "end": "$"
  38. },
  39. {
  40. "begin": "^\\[\\<",
  41. "end": "\\>\\]$"
  42. },
  43. {
  44. "begin": "<\\\/",
  45. "end": ">"
  46. },
  47. {
  48. "begin": "^facet ",
  49. "end": "\\}"
  50. },
  51. {
  52. "begin": "^1\\.\\.(\\d+)$",
  53. "end": "$"
  54. }
  55. ],
  56. "illegal": "."
  57. },
  58. {
  59. "className": "comment",
  60. "begin": "^#",
  61. "end": "$",
  62. "contains": [
  63. {
  64. "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"
  65. },
  66. {
  67. "className": "doctag",
  68. "begin": "(?:TODO|FIXME|NOTE|BUG|XXX):",
  69. "relevance": 0
  70. }
  71. ]
  72. },
  73. {
  74. "className": "string",
  75. "begin": "\"",
  76. "end": "\"",
  77. "contains": [
  78. {
  79. "begin": "\\\\[\\s\\S]",
  80. "relevance": 0
  81. },
  82. {
  83. "className": "variable",
  84. "variants": [
  85. {
  86. "begin": "\\$[\\w\\d#@][\\w\\d_]*"
  87. },
  88. {
  89. "begin": "\\$\\{(.*?)}"
  90. }
  91. ]
  92. },
  93. {
  94. "className": "variable",
  95. "begin": "\\$\\(",
  96. "end": "\\)",
  97. "contains": [
  98. {
  99. "$ref": "#contains.2.contains.0"
  100. }
  101. ]
  102. }
  103. ]
  104. },
  105. {
  106. "className": "string",
  107. "begin": "'",
  108. "end": "'"
  109. },
  110. {
  111. "$ref": "#contains.2.contains.1"
  112. },
  113. {
  114. "begin": "[\\w\\-]+\\=([^\\s\\{\\}\\[\\]\\(\\)]+)",
  115. "relevance": 0,
  116. "returnBegin": true,
  117. "contains": [
  118. {
  119. "className": "attribute",
  120. "begin": "[^=]+"
  121. },
  122. {
  123. "begin": "=",
  124. "endsWithParent": true,
  125. "relevance": 0,
  126. "contains": [
  127. {
  128. "$ref": "#contains.2"
  129. },
  130. {
  131. "$ref": "#contains.3"
  132. },
  133. {
  134. "$ref": "#contains.2.contains.1"
  135. },
  136. {
  137. "className": "literal",
  138. "begin": "\\b(true|false|yes|no|nothing|nil|null)\\b"
  139. },
  140. {
  141. "begin": "(\"[^\"]*\"|[^\\s\\{\\}\\[\\]]+)"
  142. }
  143. ]
  144. }
  145. ]
  146. },
  147. {
  148. "className": "number",
  149. "begin": "\\*[0-9a-fA-F]+"
  150. },
  151. {
  152. "begin": "\\b(add|remove|enable|disable|set|get|print|export|edit|find|run|debug|error|info|warning)([\\s[(]|])",
  153. "returnBegin": true,
  154. "contains": [
  155. {
  156. "className": "builtin-name",
  157. "begin": "\\w+"
  158. }
  159. ]
  160. },
  161. {
  162. "className": "built_in",
  163. "variants": [
  164. {
  165. "begin": "(\\.\\.\/|\/|\\s)((traffic-flow|traffic-generator|firewall|scheduler|aaa|accounting|address-list|address|align|area|bandwidth-server|bfd|bgp|bridge|client|clock|community|config|connection|console|customer|default|dhcp-client|dhcp-server|discovery|dns|e-mail|ethernet|filter|firewall|firmware|gps|graphing|group|hardware|health|hotspot|identity|igmp-proxy|incoming|instance|interface|ip|ipsec|ipv6|irq|l2tp-server|lcd|ldp|logging|mac-server|mac-winbox|mangle|manual|mirror|mme|mpls|nat|nd|neighbor|network|note|ntp|ospf|ospf-v3|ovpn-server|page|peer|pim|ping|policy|pool|port|ppp|pppoe-client|pptp-server|prefix|profile|proposal|proxy|queue|radius|resource|rip|ripng|route|routing|screen|script|security-profiles|server|service|service-port|settings|shares|smb|sms|sniffer|snmp|snooper|socks|sstp-server|system|tool|tracking|type|upgrade|upnp|user-manager|users|user|vlan|secret|vrrp|watchdog|web-access|wireless|pptp|pppoe|lan|wan|layer7-protocol|lease|simple|raw);?\\s)+",
  166. "relevance": 10
  167. },
  168. {
  169. "begin": "\\.\\."
  170. }
  171. ]
  172. }
  173. ]
  174. }