broomhlda 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.md +201 -0
  3. data/lib/hl/define.ay +131 -0
  4. data/lib/hl/formatters/html.ay +26 -0
  5. data/lib/hl/lexer.ay +99 -0
  6. data/lib/hl/lexers/atomy.ay +122 -0
  7. data/lib/hl/lexers/haskell.ay +89 -0
  8. data/lib/hl/lexers/imported/abap.ay +43 -0
  9. data/lib/hl/lexers/imported/actionscript.ay +31 -0
  10. data/lib/hl/lexers/imported/actionscript3.ay +47 -0
  11. data/lib/hl/lexers/imported/ada.ay +107 -0
  12. data/lib/hl/lexers/imported/antlr.ay +95 -0
  13. data/lib/hl/lexers/imported/apacheconf.ay +29 -0
  14. data/lib/hl/lexers/imported/applescript.ay +48 -0
  15. data/lib/hl/lexers/imported/aspectj.ay +42 -0
  16. data/lib/hl/lexers/imported/asymptote.ay +64 -0
  17. data/lib/hl/lexers/imported/autohotkey.ay +76 -0
  18. data/lib/hl/lexers/imported/autoit.ay +64 -0
  19. data/lib/hl/lexers/imported/awk.ay +42 -0
  20. data/lib/hl/lexers/imported/bash.ay +63 -0
  21. data/lib/hl/lexers/imported/batch.ay +45 -0
  22. data/lib/hl/lexers/imported/bbcode.ay +23 -0
  23. data/lib/hl/lexers/imported/befunge.ay +26 -0
  24. data/lib/hl/lexers/imported/blitzmax.ay +44 -0
  25. data/lib/hl/lexers/imported/boo.ay +55 -0
  26. data/lib/hl/lexers/imported/brainfuck.ay +28 -0
  27. data/lib/hl/lexers/imported/bro.ay +57 -0
  28. data/lib/hl/lexers/imported/bugs.ay +31 -0
  29. data/lib/hl/lexers/imported/c.ay +84 -0
  30. data/lib/hl/lexers/imported/ca65.ay +26 -0
  31. data/lib/hl/lexers/imported/cbmbasicv2.ay +25 -0
  32. data/lib/hl/lexers/imported/ceylon.ay +47 -0
  33. data/lib/hl/lexers/imported/cfengine3.ay +50 -0
  34. data/lib/hl/lexers/imported/clojure.ay +32 -0
  35. data/lib/hl/lexers/imported/cmake.ay +38 -0
  36. data/lib/hl/lexers/imported/cobol.ay +44 -0
  37. data/lib/hl/lexers/imported/coffeescript.ay +79 -0
  38. data/lib/hl/lexers/imported/coldfusion.ay +36 -0
  39. data/lib/hl/lexers/imported/commonlisp.ay +65 -0
  40. data/lib/hl/lexers/imported/coq.ay +59 -0
  41. data/lib/hl/lexers/imported/croc.ay +37 -0
  42. data/lib/hl/lexers/imported/css.ay +55 -0
  43. data/lib/hl/lexers/imported/cuda.ay +84 -0
  44. data/lib/hl/lexers/imported/cython.ay +128 -0
  45. data/lib/hl/lexers/imported/d.ay +102 -0
  46. data/lib/hl/lexers/imported/darcspatch.ay +45 -0
  47. data/lib/hl/lexers/imported/dart.ay +84 -0
  48. data/lib/hl/lexers/imported/debiancontrol.ay +51 -0
  49. data/lib/hl/lexers/imported/dg.ay +61 -0
  50. data/lib/hl/lexers/imported/diff.ay +22 -0
  51. data/lib/hl/lexers/imported/django.ay +46 -0
  52. data/lib/hl/lexers/imported/dtd.ay +62 -0
  53. data/lib/hl/lexers/imported/dylan.ay +60 -0
  54. data/lib/hl/lexers/imported/dylanlid.ay +17 -0
  55. data/lib/hl/lexers/imported/ecl.ay +57 -0
  56. data/lib/hl/lexers/imported/elixir.ay +93 -0
  57. data/lib/hl/lexers/imported/erlang.ay +47 -0
  58. data/lib/hl/lexers/imported/factor.ay +89 -0
  59. data/lib/hl/lexers/imported/fancy.ay +54 -0
  60. data/lib/hl/lexers/imported/fantom.ay +149 -0
  61. data/lib/hl/lexers/imported/felix.ay +140 -0
  62. data/lib/hl/lexers/imported/fortran.ay +39 -0
  63. data/lib/hl/lexers/imported/foxpro.ay +37 -0
  64. data/lib/hl/lexers/imported/fsharp.ay +61 -0
  65. data/lib/hl/lexers/imported/gas.ay +51 -0
  66. data/lib/hl/lexers/imported/gettext.ay +21 -0
  67. data/lib/hl/lexers/imported/gherkin.ay +97 -0
  68. data/lib/hl/lexers/imported/glshader.ay +31 -0
  69. data/lib/hl/lexers/imported/gnuplot.ay +111 -0
  70. data/lib/hl/lexers/imported/go.ay +40 -0
  71. data/lib/hl/lexers/imported/gooddatacl.ay +33 -0
  72. data/lib/hl/lexers/imported/gosu.ay +58 -0
  73. data/lib/hl/lexers/imported/groff.ay +38 -0
  74. data/lib/hl/lexers/imported/groovy.ay +45 -0
  75. data/lib/hl/lexers/imported/haskell.ay +89 -0
  76. data/lib/hl/lexers/imported/haxe.ay +186 -0
  77. data/lib/hl/lexers/imported/hxml.ay +22 -0
  78. data/lib/hl/lexers/imported/hybris.ay +42 -0
  79. data/lib/hl/lexers/imported/idl.ay +23 -0
  80. data/lib/hl/lexers/imported/ini.ay +18 -0
  81. data/lib/hl/lexers/imported/io.ay +34 -0
  82. data/lib/hl/lexers/imported/ioke.ay +88 -0
  83. data/lib/hl/lexers/imported/irclogs.ay +24 -0
  84. data/lib/hl/lexers/imported/jags.ay +36 -0
  85. data/lib/hl/lexers/imported/java.ay +42 -0
  86. data/lib/hl/lexers/imported/javascript.ay +45 -0
  87. data/lib/hl/lexers/imported/json.ay +47 -0
  88. data/lib/hl/lexers/imported/julia.ay +60 -0
  89. data/lib/hl/lexers/imported/kconfig.ay +71 -0
  90. data/lib/hl/lexers/imported/koka.ay +104 -0
  91. data/lib/hl/lexers/imported/lasso.ay +143 -0
  92. data/lib/hl/lexers/imported/lighttpdconf.ay +24 -0
  93. data/lib/hl/lexers/imported/livescript.ay +82 -0
  94. data/lib/hl/lexers/imported/llvm.ay +36 -0
  95. data/lib/hl/lexers/imported/logtalk.ay +133 -0
  96. data/lib/hl/lexers/imported/lua.ay +56 -0
  97. data/lib/hl/lexers/imported/maql.ay +32 -0
  98. data/lib/hl/lexers/imported/matlab.ay +43 -0
  99. data/lib/hl/lexers/imported/minid.ay +37 -0
  100. data/lib/hl/lexers/imported/modula2.ay +63 -0
  101. data/lib/hl/lexers/imported/moinwiki.ay +33 -0
  102. data/lib/hl/lexers/imported/monkey.ay +84 -0
  103. data/lib/hl/lexers/imported/moocode.ay +26 -0
  104. data/lib/hl/lexers/imported/moonscript.ay +52 -0
  105. data/lib/hl/lexers/imported/mscgen.ay +35 -0
  106. data/lib/hl/lexers/imported/mupad.ay +36 -0
  107. data/lib/hl/lexers/imported/mysql.ay +37 -0
  108. data/lib/hl/lexers/imported/nasm.ay +52 -0
  109. data/lib/hl/lexers/imported/newlisp.ay +34 -0
  110. data/lib/hl/lexers/imported/newspeak.ay +49 -0
  111. data/lib/hl/lexers/imported/nginxconf.ay +41 -0
  112. data/lib/hl/lexers/imported/nimrod.ay +84 -0
  113. data/lib/hl/lexers/imported/nsis.ay +55 -0
  114. data/lib/hl/lexers/imported/numpy.ay +116 -0
  115. data/lib/hl/lexers/imported/objectivej.ay +120 -0
  116. data/lib/hl/lexers/imported/ocaml.ay +59 -0
  117. data/lib/hl/lexers/imported/octave.ay +39 -0
  118. data/lib/hl/lexers/imported/ooc.ay +45 -0
  119. data/lib/hl/lexers/imported/opa.ay +153 -0
  120. data/lib/hl/lexers/imported/openedge.ay +40 -0
  121. data/lib/hl/lexers/imported/perl.ay +130 -0
  122. data/lib/hl/lexers/imported/php.ay +63 -0
  123. data/lib/hl/lexers/imported/postscript.ay +39 -0
  124. data/lib/hl/lexers/imported/povray.ay +28 -0
  125. data/lib/hl/lexers/imported/powershell.ay +49 -0
  126. data/lib/hl/lexers/imported/prolog.ay +39 -0
  127. data/lib/hl/lexers/imported/properties.ay +17 -0
  128. data/lib/hl/lexers/imported/protobuf.ay +43 -0
  129. data/lib/hl/lexers/imported/puppet.ay +50 -0
  130. data/lib/hl/lexers/imported/pypylog.ay +44 -0
  131. data/lib/hl/lexers/imported/python.ay +116 -0
  132. data/lib/hl/lexers/imported/python3.ay +113 -0
  133. data/lib/hl/lexers/imported/qml.ay +47 -0
  134. data/lib/hl/lexers/imported/racket.ay +62 -0
  135. data/lib/hl/lexers/imported/ragel.ay +70 -0
  136. data/lib/hl/lexers/imported/rd.ay +22 -0
  137. data/lib/hl/lexers/imported/redcode.ay +23 -0
  138. data/lib/hl/lexers/imported/regedit.ay +25 -0
  139. data/lib/hl/lexers/imported/rpmspec.ay +57 -0
  140. data/lib/hl/lexers/imported/rust.ay +56 -0
  141. data/lib/hl/lexers/imported/s.ay +61 -0
  142. data/lib/hl/lexers/imported/scala.ay +72 -0
  143. data/lib/hl/lexers/imported/scheme.ay +31 -0
  144. data/lib/hl/lexers/imported/scilab.ay +37 -0
  145. data/lib/hl/lexers/imported/scss.ay +115 -0
  146. data/lib/hl/lexers/imported/smali.ay +71 -0
  147. data/lib/hl/lexers/imported/smalltalk.ay +93 -0
  148. data/lib/hl/lexers/imported/snobol.ay +42 -0
  149. data/lib/hl/lexers/imported/sourcepawn.ay +58 -0
  150. data/lib/hl/lexers/imported/sourceslist.ay +37 -0
  151. data/lib/hl/lexers/imported/sql.ay +31 -0
  152. data/lib/hl/lexers/imported/squidconf.ay +29 -0
  153. data/lib/hl/lexers/imported/stan.ay +38 -0
  154. data/lib/hl/lexers/imported/systemverilog.ay +65 -0
  155. data/lib/hl/lexers/imported/tcl.ay +110 -0
  156. data/lib/hl/lexers/imported/tcsh.ay +52 -0
  157. data/lib/hl/lexers/imported/tex.ay +49 -0
  158. data/lib/hl/lexers/imported/typescript.ay +51 -0
  159. data/lib/hl/lexers/imported/vala.ay +70 -0
  160. data/lib/hl/lexers/imported/vbnet.ay +62 -0
  161. data/lib/hl/lexers/imported/velocity.ay +50 -0
  162. data/lib/hl/lexers/imported/verilog.ay +61 -0
  163. data/lib/hl/lexers/imported/vgl.ay +25 -0
  164. data/lib/hl/lexers/imported/vhdl.ay +54 -0
  165. data/lib/hl/lexers/imported/vim.ay +28 -0
  166. data/lib/hl/lexers/imported/xml.ay +38 -0
  167. data/lib/hl/lexers/imported/xslt.ay +38 -0
  168. data/lib/hl/lexers/imported/xtend.ay +48 -0
  169. data/lib/hl/lexers/ruby.ay +238 -0
  170. data/lib/hl/state.ay +31 -0
  171. data/lib/hl/token.ay +8 -0
  172. data/lib/hl.ay +17 -0
  173. metadata +244 -0
@@ -0,0 +1,143 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "Lasso"
6
+ aliases: ["lasso", "lassoscript"]
7
+ extensions: [".lasso", ".lasso[89]"]
8
+ mimetypes: ["text/x-lasso"]
9
+ start: .root
10
+ flags: Regexp IGNORECASE | Regexp MULTILINE
11
+
12
+ lex(anglebrackets):
13
+ r"\?>" is(comment.preproc) -> pop
14
+ any-of(lasso)
15
+
16
+ lex(nosquarebrackets):
17
+ r"<\?(LassoScript|lasso|=)" is(comment.preproc) -> go-to(anglebrackets)
18
+ r"<" is(other)
19
+ r"[^<]+" is(other)
20
+
21
+ lex(delimiters):
22
+ r"\[no_square_brackets\]" is(comment.preproc) -> go-to(nosquarebrackets)
23
+ r"\[noprocess\]" is(comment.preproc) -> go-to(noprocess)
24
+ r"\[" is(comment.preproc) -> go-to(squarebrackets)
25
+ r"<\?(LassoScript|lasso|=)" is(comment.preproc) -> go-to(anglebrackets)
26
+ r"<" is(other)
27
+ r"[^\[<]+" is(other)
28
+
29
+ lex(doublestring):
30
+ r"\"" is(literal.string.double) -> pop
31
+ r"[^\"\\]+" is(literal.string.double)
32
+ any-of(escape)
33
+ r"\\+" is(literal.string.double)
34
+
35
+ lex(escape):
36
+ r"\\(U[\da-f]{8}|u[\da-f]{4}|x[\da-f]{1,2}|[0-7]{1,3}|:[^:]+:|[abefnrtv?\\"\'\\]|$)" is(literal.string.escape)
37
+
38
+ lex(squarebrackets):
39
+ r"\]" is(comment.preproc) -> pop
40
+ any-of(lasso)
41
+
42
+ lex(signature):
43
+ r"=>" is(operator) -> pop
44
+ r"\)" is(punctuation) -> pop
45
+ r"[(,]" is(punctuation) -> go-to(parameter)
46
+ any-of(lasso)
47
+
48
+ lex(lassofile):
49
+ r"\]" is(comment.preproc) -> pop
50
+ r"\?>" is(comment.preproc) -> pop
51
+ any-of(lasso)
52
+
53
+ lex(singlestring):
54
+ r"'" is(literal.string.single) -> pop
55
+ r"[^'\\]+" is(literal.string.single)
56
+ any-of(escape)
57
+ r"\\+" is(literal.string.single)
58
+
59
+ lex(whitespacecomments):
60
+ r"\s+" is(text)
61
+ r"//.*?\n" is(comment.single)
62
+ r"/\*\*!.*?\*/" is(literal.string.doc)
63
+ r"/\*.*?\*/" is(comment.multiline)
64
+
65
+ lex(requiresection):
66
+ r"(([a-z_][\w.]*=?|[-+*/%<>]|==)(?=\s*\())" is(name) -> go-to(requiresignature)
67
+ r"(([a-z_][\w.]*=?|[-+*/%<>]|==)(?=(\s*::\s*[\w.]+)?\s*,))" is(name)
68
+ r"[a-z_][\w.]*=?|[-+*/%<>]|==" is(name) -> pop
69
+ r"(::\s*)([a-z_][\w.]*)" is(by-groups(punctuation, name.label))
70
+ r"," is(punctuation)
71
+ any-of(whitespacecomments)
72
+
73
+ lex(requiresignature):
74
+ r"(\)(?=(\s*::\s*[\w.]+)?\s*,))" is(punctuation) -> pop
75
+ r"\)" is(punctuation) -> pop(2)
76
+ r"-?[a-z_][\w.]*" is(name.attribute)
77
+ r"(::\s*)([a-z_][\w.]*)" is(by-groups(punctuation, name.label))
78
+ r"\.\.\." is(name.builtin.pseudo)
79
+ r"[(,]" is(punctuation)
80
+ any-of(whitespacecomments)
81
+
82
+ lex(parameter):
83
+ r"\)" is(punctuation) -> pop
84
+ r"-?[a-z_][\w.]*" is(name.attribute) -> pop
85
+ r"\.\.\." is(name.builtin.pseudo)
86
+ any-of(lasso)
87
+
88
+ lex(root):
89
+ r"^\#!.+lasso9\b" is(comment.preproc) -> go-to(lasso)
90
+ r"\[no_square_brackets\]" is(comment.preproc) -> go-to(nosquarebrackets)
91
+ r"\[noprocess\]" is(comment.preproc) -> do-all(go-to(delimiters), go-to(noprocess))
92
+ r"\[" is(comment.preproc) -> do-all(go-to(delimiters), go-to(squarebrackets))
93
+ r"<\?(LassoScript|lasso|=)" is(comment.preproc) -> do-all(go-to(delimiters), go-to(anglebrackets))
94
+ r"<" is(other) -> go-to(delimiters)
95
+ r"\s+" is(other)
96
+ r"" is(other) -> do-all(go-to(delimiters), go-to(lassofile))
97
+
98
+ lex(noprocess):
99
+ r"\[/noprocess\]" is(comment.preproc) -> pop
100
+ r"\[" is(other)
101
+ r"[^\[]" is(other)
102
+
103
+ lex(lasso):
104
+ any-of(whitespacecomments)
105
+ r"\d*\.\d+(e[+-]?\d+)?" is(literal.number.float)
106
+ r"0x[\da-f]+" is(literal.number.hex)
107
+ r"\d+" is(literal.number.integer)
108
+ r"([+-]?)(infinity|NaN)\b" is(by-groups(operator, literal.number))
109
+ r"'" is(literal.string.single) -> go-to(singlestring)
110
+ r"\"" is(literal.string.double) -> go-to(doublestring)
111
+ r"`[^`]*`" is(literal.string.backtick)
112
+ r"\$[a-z_][\w.]*" is(name.variable)
113
+ r"\#[a-z_][\w.]*|\#\d+" is(name.variable.instance)
114
+ r"(\.)('[a-z_][\w.]*')" is(by-groups(name.builtin.pseudo, name.variable.class))
115
+ r"(self)(->)('[a-z_][\w.]*')" is(by-groups(name.builtin.pseudo, operator, name.variable.class))
116
+ r"(\.\.?)([a-z_][\w.]*)" is(by-groups(name.builtin.pseudo, name.other))
117
+ r"(self|inherited|global|void)\b" is(name.builtin.pseudo)
118
+ r"-[a-z_][\w.]*" is(name.attribute)
119
+ r"(::\s*)([a-z_][\w.]*)" is(by-groups(punctuation, name.label))
120
+ r"(error_(code|msg)_\w+|Error_AddError|Error_ColumnRestriction|Error_DatabaseConnectionUnavailable|Error_DatabaseTimeout|Error_DeleteError|Error_FieldRestriction|Error_FileNotFound|Error_InvalidDatabase|Error_InvalidPassword|Error_InvalidUsername|Error_ModuleNotFound|Error_NoError|Error_NoPermission|Error_OutOfMemory|Error_ReqColumnMissing|Error_ReqFieldMissing|Error_RequiredColumnMissing|Error_RequiredFieldMissing|Error_UpdateError)\b" is(name.exception)
121
+ r"(define)(\s+)([a-z_][\w.]*)(\s*)(=>)(\s*)(type|trait|thread)\b" is(by-groups(keyword.declaration, text, name.class, text, operator, text, keyword))
122
+ r"(define)(\s+)([a-z_][\w.]*)(->)([a-z_][\w.]*=?|[-+*/%<>]|==)" is(by-groups(keyword.declaration, text, name.class, operator, name.function)) -> go-to(signature)
123
+ r"(define)(\s+)([a-z_][\w.]*)" is(by-groups(keyword.declaration, text, name.function)) -> go-to(signature)
124
+ r"(public|protected|private|provide)(\s+)(([a-z_][\w.]*=?|[-+*/%<>]|==)(?=\s*\())" is(by-groups(keyword, text, name.function)) -> go-to(signature)
125
+ r"(public|protected|private)(\s+)([a-z_][\w.]*)" is(by-groups(keyword, text, name.function))
126
+ r"(true|false|none|minimal|full|all)\b" is(keyword.constant)
127
+ r"(local|var|variable|data)\b" is(keyword.declaration)
128
+ r"(array|date|decimal|duration|integer|map|pair|string|tag|xml|null)\b" is(keyword.type)
129
+ r"([a-z_][\w.]*)(\s+)(in)\b" is(by-groups(name, text, keyword))
130
+ r"(let|into)(\s+)([a-z_][\w.]*)" is(by-groups(keyword, text, name))
131
+ r"require\b" is(keyword) -> go-to(requiresection)
132
+ r"(/?)(Namespace_Using)\b" is(by-groups(punctuation, keyword.namespace))
133
+ r"(/?)(Cache|Database_Names|Database_SchemaNames|Database_TableNames|Define_Tag|Define_Type|Email_Batch|Encode_Set|HTML_Comment|Handle|Handle_Error|Header|If|Inline|Iterate|LJAX_Target|Link|Link_CurrentAction|Link_CurrentGroup|Link_CurrentRecord|Link_Detail|Link_FirstGroup|Link_FirstRecord|Link_LastGroup|Link_LastRecord|Link_NextGroup|Link_NextRecord|Link_PrevGroup|Link_PrevRecord|Log|Loop|NoProcess|Output_None|Portal|Private|Protect|Records|Referer|Referrer|Repeating|ResultSet|Rows|Search_Args|Search_Arguments|Select|Sort_Args|Sort_Arguments|Thread_Atomic|Value_List|While|Abort|Case|Else|If_Empty|If_False|If_Null|If_True|Loop_Abort|Loop_Continue|Loop_Count|Params|Params_Up|Return|Return_Value|Run_Children|SOAP_DefineTag|SOAP_LastRequest|SOAP_LastResponse|Tag_Name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield)\b" is(by-groups(punctuation, keyword))
134
+ r"(([a-z_][\w.]*=?|[-+*/%<>]|==)(?=\s*\([^)]*\)\s*=>))" is(name.function) -> go-to(signature)
135
+ r"(and|or|not)\b" is(operator.word)
136
+ r"([a-z_][\w.]*)(\s*)(::\s*)([a-z_][\w.]*)(\s*)(=)" is(by-groups(name, text, punctuation, name.label, text, operator))
137
+ r"((?<!->)[a-z_][\w.]*)(\s*)(=(?!=))" is(by-groups(name, text, operator))
138
+ r"(/?)([\w.]+)" is(by-groups(punctuation, name.other))
139
+ r"(=)(bw|ew|cn|lte?|gte?|n?eq|ft|n?rx)\b" is(by-groups(operator, operator.word))
140
+ r":=|[-+*/%=<>&|!?\\]+" is(operator)
141
+ r"[{}():;,@^]" is(punctuation)
142
+
143
+ const-set(.Lexer, lexer)
@@ -0,0 +1,24 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "Lighttpd configuration file"
6
+ aliases: ["lighty", "lighttpd"]
7
+ extensions: []
8
+ mimetypes: ["text/x-lighttpd-conf"]
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(root):
13
+ r"\#.*\n" is(comment.single)
14
+ r"/\S*" is(name)
15
+ r"[a-zA-Z._-]+" is(keyword)
16
+ r"\d+\.\d+\.\d+\.\d+(?:/\d+)?" is(literal.number)
17
+ r"[0-9]+" is(literal.number)
18
+ r"=>|=\126|\+=|==|=|\+" is(operator)
19
+ r"\$[A-Z]+" is(name.builtin)
20
+ r"[(){}\[\],]" is(punctuation)
21
+ r"\"([^\"\\]*(?:\\.[^\"\\]*)*)\"" is(literal.string.double)
22
+ r"\s+" is(text)
23
+
24
+ const-set(.Lexer, lexer)
@@ -0,0 +1,82 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "LiveScript"
6
+ aliases: ["live-script", "livescript"]
7
+ extensions: [".ls"]
8
+ mimetypes: ["text/livescript"]
9
+ start: .root
10
+ flags: Regexp MULTILINE
11
+
12
+ lex(commentsandwhitespace):
13
+ r"\s+" is(text)
14
+ r"/\*.*?\*/" is(comment.multiline)
15
+ r"\#.*?\n" is(comment.single)
16
+
17
+ lex(tdqs):
18
+ r"\"\"\"" is(literal.string) -> pop
19
+ r"\\.|\'|\"" is(literal.string)
20
+ r"\#{" is(literal.string.interpol) -> go-to(interpoling-string)
21
+ r"\#" is(literal.string)
22
+ any-of(strings)
23
+
24
+ lex(interpoling-string):
25
+ r"}" is(literal.string.interpol) -> pop
26
+ any-of(root)
27
+
28
+ lex(dqs):
29
+ r"\"" is(literal.string) -> pop
30
+ r"\\.|\'" is(literal.string)
31
+ r"\#{" is(literal.string.interpol) -> go-to(interpoling-string)
32
+ r"\#" is(literal.string)
33
+ any-of(strings)
34
+
35
+ lex(sqs):
36
+ r"'" is(literal.string) -> pop
37
+ r"\#|\\.|\"" is(literal.string)
38
+ any-of(strings)
39
+
40
+ lex(root):
41
+ any-of(commentsandwhitespace)
42
+ r"(?:\([^()]+\))?[ ]*[\126-]{1,2}>|(?:\(?[^()\n]+\)?)?[ ]*<[\126-]{1,2}" is(name.function)
43
+ r"\+\+|&&|(?<![\.\$])\b(?:and|x?or|is|isnt|not)\b|\?|:|=|\|\||\\(?=\n)|(<<|>>>?|==?|!=?|\126(?!\\126?>)|-(?!\-?>)|<(?!\[)|(?<!\])>|[+*`%&\|\^/])=?" is(operator) -> go-to(slashstartsregex)
44
+ r"[{(\[;,]" is(punctuation) -> go-to(slashstartsregex)
45
+ r"[})\].]" is(punctuation)
46
+ r"(?<![\.\$])(for|own|in|of|while|until|loop|break|return|continue|switch|when|then|if|unless|else|throw|try|catch|finally|new|delete|typeof|instanceof|super|extends|this|class|by|const|var|to|til)\b" is(keyword) -> go-to(slashstartsregex)
47
+ r"(?<![\.\$])(true|false|yes|no|on|off|null|NaN|Infinity|undefined|void)\b" is(keyword.constant)
48
+ r"(Array|Boolean|Date|Error|Function|Math|netscape|Number|Object|Packages|RegExp|String|sun|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|document|window)\b" is(name.builtin)
49
+ r"[$a-zA-Z_][a-zA-Z0-9_\.\-:\$]*\s*[:=]\s" is(name.variable) -> go-to(slashstartsregex)
50
+ r"@[$a-zA-Z_][a-zA-Z0-9_\.\-:\$]*\s*[:=]\s" is(name.variable.instance) -> go-to(slashstartsregex)
51
+ r"@" is(name.other) -> go-to(slashstartsregex)
52
+ r"@?[$a-zA-Z_][a-zA-Z0-9_\-]*" is(name.other) -> go-to(slashstartsregex)
53
+ r"[0-9]+\.[0-9]+([eE][0-9]+)?[fd]?(?:[a-zA-Z_]+)?" is(literal.number.float)
54
+ r"[0-9]+(\126[0-9a-z]+)?(?:[a-zA-Z_]+)?" is(literal.number.integer)
55
+ r"\"\"\"" is(literal.string) -> go-to(tdqs)
56
+ r"'''" is(literal.string) -> go-to(tsqs)
57
+ r"\"" is(literal.string) -> go-to(dqs)
58
+ r"'" is(literal.string) -> go-to(sqs)
59
+ r"\\[\w$-]+" is(literal.string)
60
+ r"<\[.*\]>" is(literal.string)
61
+
62
+ lex(multilineregex):
63
+ any-of(commentsandwhitespace)
64
+ r"//([gim]+\b|\B)" is(literal.string.regex) -> pop
65
+ r"/" is(literal.string.regex)
66
+ r"[^/\#]+" is(literal.string.regex)
67
+
68
+ lex(slashstartsregex):
69
+ any-of(commentsandwhitespace)
70
+ r"//" is(literal.string.regex) -> do-all(pop, go-to(multilineregex))
71
+ r"/(?! )(\\.|[^\[/\\\n]|\[(\\.|[^\]\\\n])*])+/([gim]+\b|\B)" is(literal.string.regex) -> pop
72
+ r"" is(text) -> pop
73
+
74
+ lex(tsqs):
75
+ r"'''" is(literal.string) -> pop
76
+ r"\#|\\.|\'|\"" is(literal.string)
77
+ any-of(strings)
78
+
79
+ lex(strings):
80
+ r"[^\#\\\'\"]+" is(literal.string)
81
+
82
+ const-set(.Lexer, lexer)
@@ -0,0 +1,36 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "LLVM"
6
+ aliases: ["llvm"]
7
+ extensions: [".ll"]
8
+ mimetypes: ["text/x-llvm"]
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(root):
13
+ any-of(whitespace)
14
+ r"([-a-zA-Z$._][-a-zA-Z$._0-9]*|\"[^\"]*?\")\s*:" is(name.label)
15
+ any-of(keyword)
16
+ r"%([-a-zA-Z$._][-a-zA-Z$._0-9]*|\"[^\"]*?\")" is(name.variable)
17
+ r"@([-a-zA-Z$._][-a-zA-Z$._0-9]*|\"[^\"]*?\")" is(name.variable.global)
18
+ r"%\d+" is(name.variable.anonymous)
19
+ r"@\d+" is(name.variable.global)
20
+ r"!([-a-zA-Z$._][-a-zA-Z$._0-9]*|\"[^\"]*?\")" is(name.variable)
21
+ r"!\d+" is(name.variable.anonymous)
22
+ r"c?\"[^\"]*?\"" is(literal.string)
23
+ r"0[xX][a-fA-F0-9]+" is(literal.number)
24
+ r"-?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?" is(literal.number)
25
+ r"[=<>{}\[\]()*.,!]|x\b" is(punctuation)
26
+
27
+ lex(whitespace):
28
+ r"(\n|\s)+" is(text)
29
+ r";.*?\n" is(comment)
30
+
31
+ lex(keyword):
32
+ r"(begin|end|true|false|declare|define|global|constant|private|linker_private|internal|available_externally|linkonce|linkonce_odr|weak|weak_odr|appending|dllimport|dllexport|common|default|hidden|protected|extern_weak|external|thread_local|zeroinitializer|undef|null|to|tail|target|triple|datalayout|volatile|nuw|nsw|nnan|ninf|nsz|arcp|fast|exact|inbounds|align|addrspace|section|alias|module|asm|sideeffect|gc|dbg|ccc|fastcc|coldcc|x86_stdcallcc|x86_fastcallcc|arm_apcscc|arm_aapcscc|arm_aapcs_vfpcc|cc|c|signext|zeroext|inreg|sret|nounwind|noreturn|noalias|nocapture|byval|nest|readnone|readonly|inlinehint|noinline|alwaysinline|optsize|ssp|sspreq|noredzone|noimplicitfloat|naked|type|opaque|eq|ne|slt|sgt|sle|sge|ult|ugt|ule|uge|oeq|one|olt|ogt|ole|oge|ord|uno|ueq|une|x|add|fadd|sub|fsub|mul|fmul|udiv|sdiv|fdiv|urem|srem|frem|shl|lshr|ashr|and|or|xor|icmp|fcmp|phi|call|trunc|zext|sext|fptrunc|fpext|uitofp|sitofp|fptouifptosi|inttoptr|ptrtoint|bitcast|select|va_arg|ret|br|switch|invoke|unwind|unreachable|malloc|alloca|free|load|store|getelementptr|extractelement|insertelement|shufflevector|getresult|extractvalue|insertvalue)\b" is(keyword)
33
+ r"void|float|double|x86_fp80|fp128|ppc_fp128|label|metadata" is(keyword.type)
34
+ r"i[1-9]\d*" is(keyword)
35
+
36
+ const-set(.Lexer, lexer)
@@ -0,0 +1,133 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "Logtalk"
6
+ aliases: ["logtalk"]
7
+ extensions: [".lgt"]
8
+ mimetypes: ["text/x-logtalk"]
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(quoted-atom):
13
+ r"''" is(literal.string)
14
+ r"'" is(literal.string) -> pop
15
+ r"\\([\\abfnrtv\"\']|(x[a-fA-F0-9]+|[0-7]+)\\)" is(literal.string.escape)
16
+ r"[^\\'\n]+" is(literal.string)
17
+ r"\\" is(literal.string)
18
+
19
+ lex(root):
20
+ r"^\s*:-\s" is(punctuation) -> go-to(directive)
21
+ r"%.*?\n" is(comment)
22
+ r"/\*(.|\n)*?\*/" is(comment)
23
+ r"\n" is(text)
24
+ r"\s+" is(text)
25
+ r"0'." is(literal.number)
26
+ r"0b[01]+" is(literal.number)
27
+ r"0o[0-7]+" is(literal.number)
28
+ r"0x[0-9a-fA-F]+" is(literal.number)
29
+ r"\d+\.?\d*((e|E)(\+|-)?\d+)?" is(literal.number)
30
+ r"([A-Z_][a-zA-Z0-9_]*)" is(name.variable)
31
+ r"(after|before)(?=[(])" is(keyword)
32
+ r"(parameter|this|se(lf|nder))(?=[(])" is(keyword)
33
+ r"(current_predicate|predicate_property)(?=[(])" is(keyword)
34
+ r"(expand_(goal|term)|(goal|term)_expansion|phrase)(?=[(])" is(keyword)
35
+ r"(abolish|c(reate|urrent))_(object|protocol|category)(?=[(])" is(keyword)
36
+ r"(object|protocol|category)_property(?=[(])" is(keyword)
37
+ r"co(mplements_object|nforms_to_protocol)(?=[(])" is(keyword)
38
+ r"extends_(object|protocol|category)(?=[(])" is(keyword)
39
+ r"imp(lements_protocol|orts_category)(?=[(])" is(keyword)
40
+ r"(instantiat|specializ)es_class(?=[(])" is(keyword)
41
+ r"(current_event|(abolish|define)_events)(?=[(])" is(keyword)
42
+ r"(current|set)_logtalk_flag(?=[(])" is(keyword)
43
+ r"logtalk_(compile|l(ibrary_path|oad_context|oad))(?=[(])" is(keyword)
44
+ r"(clause|retract(all)?)(?=[(])" is(keyword)
45
+ r"a(bolish|ssert(a|z))(?=[(])" is(keyword)
46
+ r"(ca(ll|tch)|throw)(?=[(])" is(keyword)
47
+ r"(fail|true)\b" is(keyword)
48
+ r"((bag|set)of|f(ind|or)all)(?=[(])" is(keyword)
49
+ r"threaded(_(call|once|ignore|exit|peek|wait|notify))?(?=[(])" is(keyword)
50
+ r"unify_with_occurs_check(?=[(])" is(keyword)
51
+ r"(functor|arg|copy_term|numbervars)(?=[(])" is(keyword)
52
+ r"(rem|mod|abs|sign)(?=[(])" is(keyword)
53
+ r"float(_(integer|fractional)_part)?(?=[(])" is(keyword)
54
+ r"(floor|truncate|round|ceiling)(?=[(])" is(keyword)
55
+ r"(cos|atan|exp|log|s(in|qrt))(?=[(])" is(keyword)
56
+ r"(var|atom(ic)?|integer|float|c(allable|ompound)|n(onvar|umber)|ground)(?=[(])" is(keyword)
57
+ r"compare(?=[(])" is(keyword)
58
+ r"(curren|se)t_(in|out)put(?=[(])" is(keyword)
59
+ r"(open|close)(?=[(])" is(keyword)
60
+ r"flush_output(?=[(])" is(keyword)
61
+ r"(at_end_of_stream|flush_output)\b" is(keyword)
62
+ r"(stream_property|at_end_of_stream|set_stream_position)(?=[(])" is(keyword)
63
+ r"(nl|(get|peek|put)_(byte|c(har|ode)))(?=[(])" is(keyword)
64
+ r"\bnl\b" is(keyword)
65
+ r"read(_term)?(?=[(])" is(keyword)
66
+ r"write(q|_(canonical|term))?(?=[(])" is(keyword)
67
+ r"(current_)?op(?=[(])" is(keyword)
68
+ r"(current_)?char_conversion(?=[(])" is(keyword)
69
+ r"atom_(length|c(hars|o(ncat|des)))(?=[(])" is(keyword)
70
+ r"(char_code|sub_atom)(?=[(])" is(keyword)
71
+ r"number_c(har|ode)s(?=[(])" is(keyword)
72
+ r"(se|curren)t_prolog_flag(?=[(])" is(keyword)
73
+ r"\bhalt\b" is(keyword)
74
+ r"halt(?=[(])" is(keyword)
75
+ r"(::|:|\^\^)" is(operator)
76
+ r"[{}]" is(keyword)
77
+ r"\b(ignore|once)(?=[(])" is(keyword)
78
+ r"\brepeat\b" is(keyword)
79
+ r"(key)?sort(?=[(])" is(keyword)
80
+ r"(>>|<<|/\\|\\\\|\\)" is(operator)
81
+ r"\bis\b" is(keyword)
82
+ r"(=:=|=\\=|<|=<|>=|>)" is(operator)
83
+ r"=\.\." is(operator)
84
+ r"(=|\\=)" is(operator)
85
+ r"(==|\\==|@=<|@<|@>=|@>)" is(operator)
86
+ r"(//|[-+*/])" is(operator)
87
+ r"\b(e|pi|mod|rem)\b" is(operator)
88
+ r"\b\*\*\b" is(operator)
89
+ r"-->" is(operator)
90
+ r"([!;]|->)" is(operator)
91
+ r"\\+" is(operator)
92
+ r"[?@]" is(operator)
93
+ r"\^" is(operator)
94
+ r"\"(\\\\|\\\"|[^\"])*\"" is(literal.string)
95
+ r"[()\[\],.|]" is(text)
96
+ r"[a-z][a-zA-Z0-9_]*" is(text)
97
+ r"'" is(literal.string) -> go-to(quoted-atom)
98
+
99
+ lex(directive):
100
+ r"(el)?if(?=[(])" is(keyword) -> go-to(root)
101
+ r"(e(lse|ndif))[.]" is(keyword) -> go-to(root)
102
+ r"(category|object|protocol)(?=[(])" is(keyword) -> go-to(entityrelations)
103
+ r"(end_(category|object|protocol))[.]" is(keyword) -> go-to(root)
104
+ r"(public|protected|private)(?=[(])" is(keyword) -> go-to(root)
105
+ r"e(n(coding|sure_loaded)|xport)(?=[(])" is(keyword) -> go-to(root)
106
+ r"in(fo|itialization)(?=[(])" is(keyword) -> go-to(root)
107
+ r"(dynamic|synchronized|threaded)[.]" is(keyword) -> go-to(root)
108
+ r"(alias|d(ynamic|iscontiguous)|m(eta_predicate|ode|ultifile)|s(et_(logtalk|prolog)_flag|ynchronized))(?=[(])" is(keyword) -> go-to(root)
109
+ r"op(?=[(])" is(keyword) -> go-to(root)
110
+ r"(c(alls|oinductive)|reexport|use(s|_module))(?=[(])" is(keyword) -> go-to(root)
111
+ r"[a-z][a-zA-Z0-9_]*(?=[(])" is(text) -> go-to(root)
112
+ r"[a-z][a-zA-Z0-9_]*[.]" is(text) -> go-to(root)
113
+
114
+ lex(entityrelations):
115
+ r"(complements|extends|i(nstantiates|mp(lements|orts))|specializes)(?=[(])" is(keyword)
116
+ r"0'." is(literal.number)
117
+ r"0b[01]+" is(literal.number)
118
+ r"0o[0-7]+" is(literal.number)
119
+ r"0x[0-9a-fA-F]+" is(literal.number)
120
+ r"\d+\.?\d*((e|E)(\+|-)?\d+)?" is(literal.number)
121
+ r"([A-Z_][a-zA-Z0-9_]*)" is(name.variable)
122
+ r"[a-z][a-zA-Z0-9_]*" is(text)
123
+ r"'" is(literal.string) -> go-to(quoted-atom)
124
+ r"\"(\\\\|\\\"|[^\"])*\"" is(literal.string)
125
+ r"([)]\.)" is(text) -> go-to(root)
126
+ r"(::)" is(operator)
127
+ r"[()\[\],.|]" is(text)
128
+ r"%.*?\n" is(comment)
129
+ r"/\*(.|\n)*?\*/" is(comment)
130
+ r"\n" is(text)
131
+ r"\s+" is(text)
132
+
133
+ const-set(.Lexer, lexer)
@@ -0,0 +1,56 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "Lua"
6
+ aliases: ["lua"]
7
+ extensions: [".lua", ".wlua"]
8
+ mimetypes: ["text/x-lua", "application/x-lua"]
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(string):
13
+ r"." is(literal.string)
14
+
15
+ lex(dqs):
16
+ r"\"" is(literal.string) -> pop
17
+ any-of(string)
18
+
19
+ lex(sqs):
20
+ r"'" is(literal.string) -> pop
21
+ any-of(string)
22
+
23
+ lex(funcname):
24
+ r"\s+" is(text)
25
+ r"(?:([A-Za-z_][A-Za-z0-9_]*)(\.))?([A-Za-z_][A-Za-z0-9_]*)" is(by-groups(name.class, punctuation, name.function)) -> pop
26
+ r"\(" is(punctuation) -> pop
27
+
28
+ lex(stringescape):
29
+ r"\\([abfnrtv\\\"']|\d{1,3})" is(literal.string.escape)
30
+
31
+ lex(base):
32
+ r"(?m)--\[(=*)\[.*?\]\1\]" is(comment.multiline)
33
+ r"--.*$" is(comment.single)
34
+ r"(?i)(\d*\.\d+|\d+\.\d*)(e[+-]?\d+)?" is(literal.number.float)
35
+ r"(?i)\d+e[+-]?\d+" is(literal.number.float)
36
+ r"(?i)0x[0-9a-f]*" is(literal.number.hex)
37
+ r"\d+" is(literal.number.integer)
38
+ r"\n" is(text)
39
+ r"[^\S\n]" is(text)
40
+ r"(?m)\[(=*)\[.*?\]\1\]" is(literal.string)
41
+ r"(==|\126=|<=|>=|\.\.\.|\.\.|[=+\-*/%^<>\#])" is(operator)
42
+ r"[\[\]\{\}\(\)\.,:;]" is(punctuation)
43
+ r"(and|or|not)\b" is(operator.word)
44
+ r"(break|do|else|elseif|end|for|if|in|repeat|return|then|until|while)\b" is(keyword)
45
+ r"(local)\b" is(keyword.declaration)
46
+ r"(true|false|nil)\b" is(keyword.constant)
47
+ r"(function)\b" is(keyword) -> go-to(funcname)
48
+ r"[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)?" is(name)
49
+ r"'" is(literal.string.single) -> combined(stringescape, sqs)
50
+ r"\"" is(literal.string.double) -> combined(stringescape, dqs)
51
+
52
+ lex(root):
53
+ r"\#!(.*?)$" is(comment.preproc)
54
+ r"" is(text) -> go-to(base)
55
+
56
+ const-set(.Lexer, lexer)
@@ -0,0 +1,32 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "MAQL"
6
+ aliases: ["maql"]
7
+ extensions: [".maql"]
8
+ mimetypes: ["text/x-gooddata-maql", "application/x-gooddata-maql"]
9
+ start: .root
10
+ flags: Regexp IGNORECASE
11
+
12
+ lex(root):
13
+ r"IDENTIFIER\b" is(name.builtin)
14
+ r"\{[^}]+\}" is(name.variable)
15
+ r"[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]{1,3})?" is(literal.number)
16
+ r"\"" is(literal.string) -> go-to(string-literal)
17
+ r"\<\>|\!\=" is(operator)
18
+ r"\=|\>\=|\>|\<\=|\<" is(operator)
19
+ r"\:\=" is(operator)
20
+ r"\[[^]]+\]" is(name.variable.class)
21
+ r"(DIMENSIONS?|BOTTOM|METRIC|COUNT|OTHER|FACT|WITH|TOP|OR|ATTRIBUTE|CREATE|PARENT|FALSE|ROWS?|FROM|ALL|AS|PF|COLUMNS?|DEFINE|REPORT|LIMIT|TABLE|LIKE|AND|BY|BETWEEN|EXCEPT|SELECT|MATCH|WHERE|TRUE|FOR|IN|WITHOUT|FILTER|ALIAS|ORDER|FACT|WHEN|NOT|ON|KEYS|KEY|FULLSET|PRIMARY|LABELS|LABEL|VISUAL|TITLE|DESCRIPTION|FOLDER|ALTER|DROP|ADD|DATASET|DATATYPE|INT|BIGINT|DOUBLE|DATE|VARCHAR|DECIMAL|SYNCHRONIZE|TYPE|DEFAULT|ORDER|ASC|DESC|HYPERLINK|INCLUDE|TEMPLATE|MODIFY)\b" is(keyword)
22
+ r"[a-zA-Z]\w*\b" is(name.function)
23
+ r"\#.*" is(comment.single)
24
+ r"[,;\(\)]" is(punctuation)
25
+ r"\s+" is(text)
26
+
27
+ lex(string-literal):
28
+ r"\\[tnrfbae\"\\]" is(literal.string.escape)
29
+ r"\"" is(literal.string) -> pop
30
+ r"[^\\\"]+" is(literal.string)
31
+
32
+ const-set(.Lexer, lexer)
@@ -0,0 +1,43 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "Matlab"
6
+ aliases: ["matlab"]
7
+ extensions: [".m"]
8
+ mimetypes: ["text/matlab"]
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(deffunc):
13
+ r"(\s*)(?:(.+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)" is(by-groups(text.whitespace, text, text.whitespace, punctuation, text.whitespace, name.function, punctuation, text, punctuation, text.whitespace)) -> pop
14
+
15
+ lex(blockcomment):
16
+ r"^\s*%\}" is(comment.multiline) -> pop
17
+ r"^.*\n" is(comment.multiline)
18
+ r"." is(comment.multiline)
19
+
20
+ lex(root):
21
+ r"^!.*" is(literal.string.other)
22
+ r"%\{\s*\n" is(comment.multiline) -> go-to(blockcomment)
23
+ r"%.*$" is(comment)
24
+ r"^\s*function" is(keyword) -> go-to(deffunc)
25
+ r"(break|case|catch|classdef|continue|else|elseif|end|enumerated|events|for|function|global|if|methods|otherwise|parfor|persistent|properties|return|spmd|switch|try|while)\b" is(keyword)
26
+ r"(sin|sind|sinh|asin|asind|asinh|cos|cosd|cosh|acos|acosd|acosh|tan|tand|tanh|atan|atand|atan2|atanh|sec|secd|sech|asec|asecd|asech|csc|cscd|csch|acsc|acscd|acsch|cot|cotd|coth|acot|acotd|acoth|hypot|exp|expm1|log|log1p|log10|log2|pow2|realpow|reallog|realsqrt|sqrt|nthroot|nextpow2|abs|angle|complex|conj|imag|real|unwrap|isreal|cplxpair|fix|floor|ceil|round|mod|rem|sign|airy|besselj|bessely|besselh|besseli|besselk|beta|betainc|betaln|ellipj|ellipke|erf|erfc|erfcx|erfinv|expint|gamma|gammainc|gammaln|psi|legendre|cross|dot|factor|isprime|primes|gcd|lcm|rat|rats|perms|nchoosek|factorial|cart2sph|cart2pol|pol2cart|sph2cart|hsv2rgb|rgb2hsv|zeros|ones|eye|repmat|rand|randn|linspace|logspace|freqspace|meshgrid|accumarray|size|length|ndims|numel|disp|isempty|isequal|isequalwithequalnans|cat|reshape|diag|blkdiag|tril|triu|fliplr|flipud|flipdim|rot90|find|end|sub2ind|ind2sub|bsxfun|ndgrid|permute|ipermute|shiftdim|circshift|squeeze|isscalar|isvector|ans|eps|realmax|realmin|pi|i|inf|nan|isnan|isinf|isfinite|j|why|compan|gallery|hadamard|hankel|hilb|invhilb|magic|pascal|rosser|toeplitz|vander|wilkinson)\b" is(name.builtin)
27
+ r"\.\.\..*$" is(comment)
28
+ r"-|==|\126=|<|>|<=|>=|&&|&|\126|\|\|?" is(operator)
29
+ r"\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\" is(operator)
30
+ r"\[|\]|\(|\)|\{|\}|:|@|\.|," is(punctuation)
31
+ r"=|:|;" is(punctuation)
32
+ r"(?<=[\w\)\]])\'" is(operator)
33
+ r"(\d+\.\d*|\d*\.\d+)([eEf][+-]?[0-9]+)?" is(literal.number.float)
34
+ r"\d+[eEf][+-]?[0-9]+" is(literal.number.float)
35
+ r"\d+" is(literal.number.integer)
36
+ r"(?<![\w\)\]])\'" is(literal.string) -> go-to(string)
37
+ r"[a-zA-Z_][a-zA-Z0-9_]*" is(name)
38
+ r"." is(text)
39
+
40
+ lex(string):
41
+ r"[^\']*\'" is(literal.string) -> pop
42
+
43
+ const-set(.Lexer, lexer)
@@ -0,0 +1,37 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "MiniD"
6
+ aliases: ["minid"]
7
+ extensions: [".md"]
8
+ mimetypes: ["text/x-minidsrc"]
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(nestedcomment):
13
+ r"[^*/]+" is(comment.multiline)
14
+ r"/\*" is(comment.multiline) -> push
15
+ r"\*/" is(comment.multiline) -> pop
16
+ r"[*/]" is(comment.multiline)
17
+
18
+ lex(root):
19
+ r"\n" is(text)
20
+ r"\s+" is(text)
21
+ r"//(.*?)\n" is(comment.single)
22
+ r"/\*" is(comment.multiline) -> go-to(nestedcomment)
23
+ r"(as|assert|break|case|catch|class|continue|default|do|else|finally|for|foreach|function|global|namespace|if|import|in|is|local|module|return|scope|super|switch|this|throw|try|vararg|while|with|yield)\b" is(keyword)
24
+ r"(false|true|null)\b" is(keyword.constant)
25
+ r"([0-9][0-9_]*)(?=[.eE])(\.[0-9][0-9_]*)?([eE][+\-]?[0-9_]+)?" is(literal.number.float)
26
+ r"0[bB][01][01_]*" is(literal.number)
27
+ r"0[xX][0-9a-fA-F][0-9a-fA-F_]*" is(literal.number.hex)
28
+ r"([0-9][0-9_]*)(?![.eE])" is(literal.number.integer)
29
+ r"'(\\['\"\\nrt]|\\x[0-9a-fA-F]{2}|\\[0-9]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|.)'" is(literal.string.char)
30
+ r"@\"(\"\"|[^\"])*\"" is(literal.string)
31
+ r"@`(``|[^`])*`" is(literal.string)
32
+ r"@'(''|[^'])*'" is(literal.string)
33
+ r"\"(\\\\|\\\"|[^\"])*\"" is(literal.string)
34
+ r"(\126=|\^=|%=|\*=|==|!=|>>>=|>>>|>>=|>>|>=|<=>|\?=|-\>|<<=|<<|<=|\+\+|\+=|--|-=|\|\||\|=|&&|&=|\.\.|/=)|[-/.&$@|\+<>!()\[\]{}?,;:=*%^\126\#\\]" is(punctuation)
35
+ r"[a-zA-Z_]\w*" is(name)
36
+
37
+ const-set(.Lexer, lexer)
@@ -0,0 +1,63 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "Modula-2"
6
+ aliases: ["modula2", "m2"]
7
+ extensions: [".def", ".mod"]
8
+ mimetypes: ["text/x-modula2"]
9
+ start: .root
10
+ flags: Regexp MULTILINE
11
+
12
+ lex(punctuation):
13
+ r"[\(\)\[\]{},.:;|]" is(punctuation)
14
+
15
+ lex(pragmas):
16
+ r"\(\*\$(.*?)\*\)" is(comment.preproc)
17
+ r"<\*(.*?)\*>" is(comment.preproc)
18
+
19
+ lex(whitespace):
20
+ r"\n+" is(text)
21
+ r"\s+" is(text)
22
+
23
+ lex(numliterals):
24
+ r"[01]+B" is(literal.number.binary)
25
+ r"[0-7]+B" is(literal.number.oct)
26
+ r"[0-7]+C" is(literal.number.oct)
27
+ r"[0-9A-F]+C" is(literal.number.hex)
28
+ r"[0-9A-F]+H" is(literal.number.hex)
29
+ r"[0-9]+\.[0-9]+E[+-][0-9]+" is(literal.number.float)
30
+ r"[0-9]+\.[0-9]+" is(literal.number.float)
31
+ r"[0-9]+" is(literal.number.integer)
32
+
33
+ lex(operators):
34
+ r"[*/+=\#\126&<>\^-]" is(operator)
35
+ r":=" is(operator)
36
+ r"@" is(operator)
37
+ r"\.\." is(operator)
38
+ r"`" is(operator)
39
+ r"::" is(operator)
40
+
41
+ lex(identifiers):
42
+ r"([a-zA-Z_\$][a-zA-Z0-9_\$]*)" is(name)
43
+
44
+ lex(root):
45
+ any-of(whitespace)
46
+ any-of(comments)
47
+ any-of(pragmas)
48
+ any-of(identifiers)
49
+ any-of(numliterals)
50
+ any-of(strings)
51
+ any-of(operators)
52
+ any-of(punctuation)
53
+
54
+ lex(strings):
55
+ r"'(\\\\|\\'|[^'])*'" is(literal.string)
56
+ r"\"(\\\\|\\\"|[^\"])*\"" is(literal.string)
57
+
58
+ lex(comments):
59
+ r"//.*?\n" is(comment.single)
60
+ r"/\*(.*?)\*/" is(comment.multiline)
61
+ r"\(\*([^\$].*?)\*\)" is(comment.multiline)
62
+
63
+ const-set(.Lexer, lexer)