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,64 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "AutoIt"
6
+ aliases: ["autoit", "Autoit"]
7
+ extensions: [".au3"]
8
+ mimetypes: ["text/x-autoit"]
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(builtInMarcros):
13
+ r"(?i)(@appdatacommondir|@appdatadir|@autoitexe|@autoitpid|@autoitversion|@autoitx64|@com_eventobj|@commonfilesdir|@compiled|@computername|@comspec|@cpuarch|@cr|@crlf|@desktopcommondir|@desktopdepth|@desktopdir|@desktopheight|@desktoprefresh|@desktopwidth|@documentscommondir|@error|@exitcode|@exitmethod|@extended|@favoritescommondir|@favoritesdir|@gui_ctrlhandle|@gui_ctrlid|@gui_dragfile|@gui_dragid|@gui_dropid|@gui_winhandle|@homedrive|@homepath|@homeshare|@hotkeypressed|@hour|@ipaddress1|@ipaddress2|@ipaddress3|@ipaddress4|@kblayout|@lf|@logondnsdomain|@logondomain|@logonserver|@mday|@min|@mon|@msec|@muilang|@mydocumentsdir|@numparams|@osarch|@osbuild|@oslang|@osservicepack|@ostype|@osversion|@programfilesdir|@programscommondir|@programsdir|@scriptdir|@scriptfullpath|@scriptlinenumber|@scriptname|@sec|@startmenucommondir|@startmenudir|@startupcommondir|@startupdir|@sw_disable|@sw_enable|@sw_hide|@sw_lock|@sw_maximize|@sw_minimize|@sw_restore|@sw_show|@sw_showdefault|@sw_showmaximized|@sw_showminimized|@sw_showminnoactive|@sw_showna|@sw_shownoactivate|@sw_shownormal|@sw_unlock|@systemdir|@tab|@tempdir|@tray_id|@trayiconflashing|@trayiconvisible|@username|@userprofiledir|@wday|@windowsdir|@workingdir|@yday|@year)\b" is(name.variable.global)
14
+
15
+ lex(commands):
16
+ r"(?i)(\s*)(\#include-once|\#include|\#endregion|\#forcedef|\#forceref|\#region|and|byref|case|continueloop|dim|do|else|elseif|endfunc|endif|endselect|exit|exitloop|for|func|global|if|local|next|not|or|return|select|step|then|to|until|wend|while|exit)\b" is(by-groups(text, name.builtin))
17
+
18
+ lex(numbers):
19
+ r"(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?" is(literal.number.float)
20
+ r"\d+[eE][+-]?[0-9]+" is(literal.number.float)
21
+ r"0\d+" is(literal.number.oct)
22
+ r"0[xX][a-fA-F0-9]+" is(literal.number.hex)
23
+ r"\d+L" is(literal.number.integer.long)
24
+ r"\d+" is(literal.number.integer)
25
+
26
+ lex(garbage):
27
+ r"[^\S\n]" is(text)
28
+
29
+ lex(dqs):
30
+ r"\"" is(literal.string) -> pop
31
+ any-of(strings)
32
+
33
+ lex(builtInFunctions):
34
+ r"(?i)(abs|acos|adlibregister|adlibunregister|asc|ascw|asin|assign|atan|autoitsetoption|autoitwingettitle|autoitwinsettitle|beep|binary|binarylen|binarymid|binarytostring|bitand|bitnot|bitor|bitrotate|bitshift|bitxor|blockinput|break|call|cdtray|ceiling|chr|chrw|clipget|clipput|consoleread|consolewrite|consolewriteerror|controlclick|controlcommand|controldisable|controlenable|controlfocus|controlgetfocus|controlgethandle|controlgetpos|controlgettext|controlhide|controllistview|controlmove|controlsend|controlsettext|controlshow|controltreeview|cos|dec|dircopy|dircreate|dirgetsize|dirmove|dirremove|dllcall|dllcalladdress|dllcallbackfree|dllcallbackgetptr|dllcallbackregister|dllclose|dllopen|dllstructcreate|dllstructgetdata|dllstructgetptr|dllstructgetsize|dllstructsetdata|drivegetdrive|drivegetfilesystem|drivegetlabel|drivegetserial|drivegettype|drivemapadd|drivemapdel|drivemapget|drivesetlabel|drivespacefree|drivespacetotal|drivestatus|envget|envset|envupdate|eval|execute|exp|filechangedir|fileclose|filecopy|filecreatentfslink|filecreateshortcut|filedelete|fileexists|filefindfirstfile|filefindnextfile|fileflush|filegetattrib|filegetencoding|filegetlongname|filegetpos|filegetshortcut|filegetshortname|filegetsize|filegettime|filegetversion|fileinstall|filemove|fileopen|fileopendialog|fileread|filereadline|filerecycle|filerecycleempty|filesavedialog|fileselectfolder|filesetattrib|filesetpos|filesettime|filewrite|filewriteline|floor|ftpsetproxy|guicreate|guictrlcreateavi|guictrlcreatebutton|guictrlcreatecheckbox|guictrlcreatecombo|guictrlcreatecontextmenu|guictrlcreatedate|guictrlcreatedummy|guictrlcreateedit|guictrlcreategraphic|guictrlcreategroup|guictrlcreateicon|guictrlcreateinput|guictrlcreatelabel|guictrlcreatelist|guictrlcreatelistview|guictrlcreatelistviewitem|guictrlcreatemenu|guictrlcreatemenuitem|guictrlcreatemonthcal|guictrlcreateobj|guictrlcreatepic|guictrlcreateprogress|guictrlcreateradio|guictrlcreateslider|guictrlcreatetab|guictrlcreatetabitem|guictrlcreatetreeview|guictrlcreatetreeviewitem|guictrlcreateupdown|guictrldelete|guictrlgethandle|guictrlgetstate|guictrlread|guictrlrecvmsg|guictrlregisterlistviewsort|guictrlsendmsg|guictrlsendtodummy|guictrlsetbkcolor|guictrlsetcolor|guictrlsetcursor|guictrlsetdata|guictrlsetdefbkcolor|guictrlsetdefcolor|guictrlsetfont|guictrlsetgraphic|guictrlsetimage|guictrlsetlimit|guictrlsetonevent|guictrlsetpos|guictrlsetresizing|guictrlsetstate|guictrlsetstyle|guictrlsettip|guidelete|guigetcursorinfo|guigetmsg|guigetstyle|guiregistermsg|guisetaccelerators|guisetbkcolor|guisetcoord|guisetcursor|guisetfont|guisethelp|guiseticon|guisetonevent|guisetstate|guisetstyle|guistartgroup|guiswitch|hex|hotkeyset|httpsetproxy|httpsetuseragent|hwnd|inetclose|inetget|inetgetinfo|inetgetsize|inetread|inidelete|iniread|inireadsection|inireadsectionnames|inirenamesection|iniwrite|iniwritesection|inputbox|int|isadmin|isarray|isbinary|isbool|isdeclared|isdllstruct|isfloat|ishwnd|isint|iskeyword|isnumber|isobj|isptr|isstring|log|memgetstats|mod|mouseclick|mouseclickdrag|mousedown|mousegetcursor|mousegetpos|mousemove|mouseup|mousewheel|msgbox|number|objcreate|objcreateinterface|objevent|objevent|objget|objname|onautoitexitregister|onautoitexitunregister|opt|ping|pixelchecksum|pixelgetcolor|pixelsearch|pluginclose|pluginopen|processclose|processexists|processgetstats|processlist|processsetpriority|processwait|processwaitclose|progressoff|progresson|progressset|ptr|random|regdelete|regenumkey|regenumval|regread|regwrite|round|run|runas|runaswait|runwait|send|sendkeepactive|seterror|setextended|shellexecute|shellexecutewait|shutdown|sin|sleep|soundplay|soundsetwavevolume|splashimageon|splashoff|splashtexton|sqrt|srandom|statusbargettext|stderrread|stdinwrite|stdioclose|stdoutread|string|stringaddcr|stringcompare|stringformat|stringfromasciiarray|stringinstr|stringisalnum|stringisalpha|stringisascii|stringisdigit|stringisfloat|stringisint|stringislower|stringisspace|stringisupper|stringisxdigit|stringleft|stringlen|stringlower|stringmid|stringregexp|stringregexpreplace|stringreplace|stringright|stringsplit|stringstripcr|stringstripws|stringtoasciiarray|stringtobinary|stringtrimleft|stringtrimright|stringupper|tan|tcpaccept|tcpclosesocket|tcpconnect|tcplisten|tcpnametoip|tcprecv|tcpsend|tcpshutdown|tcpstartup|timerdiff|timerinit|tooltip|traycreateitem|traycreatemenu|traygetmsg|trayitemdelete|trayitemgethandle|trayitemgetstate|trayitemgettext|trayitemsetonevent|trayitemsetstate|trayitemsettext|traysetclick|trayseticon|traysetonevent|traysetpauseicon|traysetstate|traysettooltip|traytip|ubound|udpbind|udpclosesocket|udpopen|udprecv|udpsend|udpshutdown|udpstartup|vargettype|winactivate|winactive|winclose|winexists|winflash|wingetcaretpos|wingetclasslist|wingetclientsize|wingethandle|wingetpos|wingetprocess|wingetstate|wingettext|wingettitle|winkill|winlist|winmenuselectitem|winminimizeall|winminimizeallundo|winmove|winsetontop|winsetstate|winsettitle|winsettrans|winwait|winwaitactive|winwaitclose|winwaitnotactive)\b" is(name.function)
35
+
36
+ lex(labels):
37
+ r"(^\s*)({\S+?})" is(by-groups(text, name.label))
38
+
39
+ lex(root):
40
+ r";.*\n" is(comment.single)
41
+ r"(\#comments-start|\#cs).*?(\#comments-end|\#ce)" is(comment.multiline)
42
+ r"[\[\]{}(),;]" is(punctuation)
43
+ r"(and|or|not)\b" is(operator.word)
44
+ r"[\$|@][a-zA-Z_][a-zA-Z0-9_]*" is(name.variable)
45
+ r"!=|==|:=|\.=|<<|>>|[-\126+/*%=<>&^|?:!.]" is(operator)
46
+ any-of(commands)
47
+ any-of(labels)
48
+ any-of(builtInFunctions)
49
+ any-of(builtInMarcros)
50
+ r"\"" is(literal.string) -> combined(stringescape, dqs)
51
+ any-of(numbers)
52
+ r"[a-zA-Z_\#@$][a-zA-Z0-9_\#@$]*" is(name)
53
+ r"\\|\'" is(text)
54
+ r"\`([\,\%\`abfnrtv\-\+;])" is(literal.string.escape)
55
+ r"_\n" is(text)
56
+ any-of(garbage)
57
+
58
+ lex(stringescape):
59
+ r"\\"\\"|\`([\,\%\`abfnrtv])" is(literal.string.escape)
60
+
61
+ lex(strings):
62
+ r"[^\"\n]+" is(literal.string)
63
+
64
+ const-set(.Lexer, lexer)
@@ -0,0 +1,42 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "Awk"
6
+ aliases: ["awk", "gawk", "mawk", "nawk"]
7
+ extensions: [".awk"]
8
+ mimetypes: ["application/x-awk"]
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(commentsandwhitespace):
13
+ r"\s+" is(text)
14
+ r"\#.*$" is(comment.single)
15
+
16
+ lex(root):
17
+ r"^(?=\s|/)" is(text) -> go-to(slashstartsregex)
18
+ any-of(commentsandwhitespace)
19
+ r"\+\+|--|\|\||&&|in|\$|!?\126|(\*\*|[-<>+*%\^/!=])=?" is(operator) -> go-to(slashstartsregex)
20
+ r"[{(\[;,]" is(punctuation) -> go-to(slashstartsregex)
21
+ r"[})\].]" is(punctuation)
22
+ r"(break|continue|do|while|exit|for|if|return)\b" is(keyword) -> go-to(slashstartsregex)
23
+ r"function\b" is(keyword.declaration) -> go-to(slashstartsregex)
24
+ r"(atan2|cos|exp|int|log|rand|sin|sqrt|srand|gensub|gsub|index|length|match|split|sprintf|sub|substr|tolower|toupper|close|fflush|getline|next|nextfile|print|printf|strftime|systime|delete|system)\b" is(keyword.reserved)
25
+ r"(ARGC|ARGIND|ARGV|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS|FILENAME|FNR|FS|IGNORECASE|NF|NR|OFMT|OFS|ORFS|RLENGTH|RS|RSTART|RT|SUBSEP)\b" is(name.builtin)
26
+ r"[$a-zA-Z_][a-zA-Z0-9_]*" is(name.other)
27
+ r"[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?" is(literal.number.float)
28
+ r"0x[0-9a-fA-F]+" is(literal.number.hex)
29
+ r"[0-9]+" is(literal.number.integer)
30
+ r"\"(\\\\|\\\"|[^\"])*\"" is(literal.string.double)
31
+ r"'(\\\\|\\'|[^'])*'" is(literal.string.single)
32
+
33
+ lex(slashstartsregex):
34
+ any-of(commentsandwhitespace)
35
+ r"/(\\.|[^\[/\\\n]|\[(\\.|[^\]\\\n])*])+/\B" is(literal.string.regex) -> pop
36
+ r"(?=/)" is(text) -> do-all(pop, go-to(badregex))
37
+ r"" is(text) -> pop
38
+
39
+ lex(badregex):
40
+ r"\n" is(text) -> pop
41
+
42
+ const-set(.Lexer, lexer)
@@ -0,0 +1,63 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "Bash"
6
+ aliases: ["bash", "sh", "ksh"]
7
+ extensions: [".sh", ".ksh", ".bash", ".ebuild", ".eclass", ".bashrc", "bashrc", ".bash_", "bash_"]
8
+ mimetypes: ["application/x-sh", "application/x-shellscript"]
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(curly):
13
+ r"}" is(keyword) -> pop
14
+ r":-" is(keyword)
15
+ r"[a-zA-Z0-9_]+" is(name.variable)
16
+ r"[^}:\"\'`$]+" is(punctuation)
17
+ r":" is(punctuation)
18
+ any-of(root)
19
+
20
+ lex(backticks):
21
+ r"`" is(literal.string.backtick) -> pop
22
+ any-of(root)
23
+
24
+ lex(root):
25
+ any-of(basic)
26
+ r"\$\(\(" is(keyword) -> go-to(math)
27
+ r"\$\(" is(keyword) -> go-to(paren)
28
+ r"\${\#?" is(keyword) -> go-to(curly)
29
+ r"`" is(literal.string.backtick) -> go-to(backticks)
30
+ any-of(data)
31
+
32
+ lex(basic):
33
+ r"\b(if|fi|else|while|do|done|for|then|return|function|case|select|continue|until|esac|elif)\s*\b" is(keyword)
34
+ r"\b(alias|bg|bind|break|builtin|caller|cd|command|compgen|complete|declare|dirs|disown|echo|enable|eval|exec|exit|export|false|fc|fg|getopts|hash|help|history|jobs|kill|let|local|logout|popd|printf|pushd|pwd|read|readonly|set|shift|shopt|source|suspend|test|time|times|trap|true|type|typeset|ulimit|umask|unalias|unset|wait)\s*\b(?!\.)" is(name.builtin)
35
+ r"\#.*\n" is(comment)
36
+ r"\\[\w\W]" is(literal.string.escape)
37
+ r"(\b\w+)(\s*)(=)" is(by-groups(name.variable, text, operator))
38
+ r"[\[\]{}()=]" is(operator)
39
+ r"<<<" is(operator)
40
+ r"<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2" is(literal.string)
41
+ r"&&|\|\|" is(operator)
42
+
43
+ lex(paren):
44
+ r"\)" is(keyword) -> pop
45
+ any-of(root)
46
+
47
+ lex(data):
48
+ r"(?m)\$?\"(\\\\|\\[0-7]+|\\.|[^\"\\])*\"" is(literal.string.double)
49
+ r"(?m)\$?'(\\\\|\\[0-7]+|\\.|[^'\\])*'" is(literal.string.single)
50
+ r";" is(text)
51
+ r"\s+" is(text)
52
+ r"[^=\s\[\]{}()$\"\'`\\<]+" is(text)
53
+ r"\d+(?= |\Z)" is(literal.number)
54
+ r"\$\#?(\w+|.)" is(name.variable)
55
+ r"<" is(text)
56
+
57
+ lex(math):
58
+ r"\)\)" is(keyword) -> pop
59
+ r"[-+*/%^|&]|\*\*|\|\|" is(operator)
60
+ r"\d+" is(literal.number)
61
+ any-of(root)
62
+
63
+ const-set(.Lexer, lexer)
@@ -0,0 +1,45 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "Batchfile"
6
+ aliases: ["bat"]
7
+ extensions: [".bat", ".cmd"]
8
+ mimetypes: ["application/x-dos-batch"]
9
+ start: .root
10
+ flags: Regexp IGNORECASE
11
+
12
+ lex(basic):
13
+ r"\".*?\"" is(literal.string.double)
14
+ r"'.*?'" is(literal.string.single)
15
+ r"`.*?`" is(literal.string.backtick)
16
+ r"-?\d+" is(literal.number)
17
+ r"," is(punctuation)
18
+ r"=" is(operator)
19
+ r"/\S+" is(name)
20
+ r":\w+" is(name.label)
21
+ r"\w:\w+" is(text)
22
+ r"([<>|])(\s*)(\w+)" is(by-groups(punctuation, text, name))
23
+
24
+ lex(root):
25
+ r"^\s*@" is(punctuation)
26
+ r"^(\s*)(rem\s.*)$" is(by-groups(text, comment))
27
+ r"\".*?\"" is(literal.string.double)
28
+ r"'.*?'" is(literal.string.single)
29
+ r"%%?[\126$:\w]+%?" is(name.variable)
30
+ r"::.*" is(comment)
31
+ r"(set)(\s+)(\w+)" is(by-groups(keyword, text, name.variable))
32
+ r"(call)(\s+)(:\w+)" is(by-groups(keyword, text, name.label))
33
+ r"(goto)(\s+)(\w+)" is(by-groups(keyword, text, name.label))
34
+ r"\b(set|call|echo|on|off|endlocal|for|do|goto|if|pause|setlocal|shift|errorlevel|exist|defined|cmdextversion|errorlevel|else|cd|md|del|deltree|cls|choice)\b" is(keyword)
35
+ r"\b(equ|neq|lss|leq|gtr|geq)\b" is(operator)
36
+ any-of(basic)
37
+ r"." is(text)
38
+
39
+ lex(echo):
40
+ r"\^\^|\^<|\^>|\^\|" is(literal.string.escape)
41
+ r"\n" is(text) -> pop
42
+ any-of(basic)
43
+ r"[^\'\"^]+" is(text)
44
+
45
+ const-set(.Lexer, lexer)
@@ -0,0 +1,23 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "BBCode"
6
+ aliases: ["bbcode"]
7
+ extensions: []
8
+ mimetypes: ["text/x-bbcode"]
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(tag):
13
+ r"\s+" is(text)
14
+ r"(\w+)(=)(\"?[^\s\"\]]+\"?)" is(by-groups(name.attribute, operator, literal.string))
15
+ r"(=)(\"?[^\s\"\]]+\"?)" is(by-groups(operator, literal.string))
16
+ r"\]" is(keyword) -> pop
17
+
18
+ lex(root):
19
+ r"[^\[]+" is(text)
20
+ r"\[/?\w+" is(keyword) -> go-to(tag)
21
+ r"\[" is(text)
22
+
23
+ const-set(.Lexer, lexer)
@@ -0,0 +1,26 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "Befunge"
6
+ aliases: ["befunge"]
7
+ extensions: [".befunge"]
8
+ mimetypes: ["application/x-befunge"]
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(root):
13
+ r"[0-9a-f]" is(literal.number)
14
+ r"[\+\*/%!`-]" is(operator)
15
+ r"[<>^v?\[\]rxjk]" is(name.variable)
16
+ r"[:\\$.,n]" is(name.builtin)
17
+ r"[|_mw]" is(keyword)
18
+ r"[{}]" is(name.tag)
19
+ r"\".*?\"" is(literal.string.double)
20
+ r"\'." is(literal.string.single)
21
+ r"[\#;]" is(comment)
22
+ r"[pg&\126=@iotsy]" is(keyword)
23
+ r"[()A-Z]" is(comment)
24
+ r"\s+" is(text)
25
+
26
+ const-set(.Lexer, lexer)
@@ -0,0 +1,44 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "BlitzMax"
6
+ aliases: ["blitzmax", "bmax"]
7
+ extensions: [".bmx"]
8
+ mimetypes: ["text/x-bmx"]
9
+ start: .root
10
+ flags: Regexp IGNORECASE
11
+
12
+ lex(root):
13
+ r"[ \t]+" is(text)
14
+ r"\.\.\n" is(text)
15
+ r"'.*?\n" is(comment.single)
16
+ r"([ \t]*)\bRem\n(\n|.)*?\s*\bEnd([ \t]*)Rem" is(comment.multiline)
17
+ r"\"" is(literal.string.double) -> go-to(string)
18
+ r"[0-9]+\.[0-9]*(?!\.)" is(literal.number.float)
19
+ r"\.[0-9]*(?!\.)" is(literal.number.float)
20
+ r"[0-9]+" is(literal.number.integer)
21
+ r"\$[0-9a-f]+" is(literal.number.hex)
22
+ r"\%[10]+" is(literal.number)
23
+ r"(?:(?:(:)?([ \t]*)(:?\b(Shl|Shr|Sar|Mod)\b|([+\-*/&|\126]))|Or|And|Not|[=<>^]))" is(operator)
24
+ r"[(),.:\[\]]" is(punctuation)
25
+ r"(?:\#[\w \t]*)" is(name.label)
26
+ r"(?:\?[\w \t]*)" is(comment.preproc)
27
+ r"\b(New)\b([ \t]?)([(]?)([a-z_][a-z0-9_]*)" is(by-groups(keyword.reserved, text, punctuation, name.class))
28
+ r"\b(Import|Framework|Module)([ \t]+)([a-z_][a-z0-9_]*\.[a-z_][a-z0-9_]*)" is(by-groups(keyword.reserved, text, keyword.namespace))
29
+ r"([a-z_][a-z0-9_]*)(?:(?:([ \t]*)(@{1,2}|[!\#$%])|([ \t]*:[ \t]*\b(?:Shl|Shr|Sar|Mod)\b)|([ \t]*)([:])([ \t]*)(?:\b(Int|Byte|Short|Float|Double|Long)\b|([a-z_][a-z0-9_]*)))(?:([ \t]*)(Ptr))?)?((?:[ \t]|\.\.\n)*)([(])" is(by-groups(name.function, text, keyword.type, operator, text, punctuation, text, keyword.type, name.class, text, keyword.type, text, punctuation))
30
+ r"([a-z_][a-z0-9_]*)(?:(?:([ \t]*)(@{1,2}|[!\#$%])|([ \t]*:[ \t]*\b(?:Shl|Shr|Sar|Mod)\b)|([ \t]*)([:])([ \t]*)(?:\b(Int|Byte|Short|Float|Double|Long)\b|([a-z_][a-z0-9_]*)))(?:([ \t]*)(Ptr))?)" is(by-groups(name.variable, text, keyword.type, operator, text, punctuation, text, keyword.type, name.class, text, keyword.type))
31
+ r"\b(Type|Extends)([ \t]+)([a-z_][a-z0-9_]*)" is(by-groups(keyword.reserved, text, name.class))
32
+ r"\b(Ptr)\b" is(keyword.type)
33
+ r"\b(Pi|True|False|Null|Self|Super)\b" is(keyword.constant)
34
+ r"\b(Local|Global|Const|Field)\b" is(keyword.declaration)
35
+ r"\b(TNullMethodException|TNullFunctionException|TNullObjectException|TArrayBoundsException|TRuntimeException)\b" is(name.exception)
36
+ r"\b(Strict|SuperStrict|Module|ModuleInfo|End|Return|Continue|Exit|Public|Private|Var|VarPtr|Chr|Len|Asc|SizeOf|Sgn|Abs|Min|Max|New|Release|Delete|Incbin|IncbinPtr|IncbinLen|Framework|Include|Import|Extern|EndExtern|Function|EndFunction|Type|EndType|Extends|Method|EndMethod|Abstract|Final|If|Then|Else|ElseIf|EndIf|For|To|Next|Step|EachIn|While|Wend|EndWhile|Repeat|Until|Forever|Select|Case|Default|EndSelect|Try|Catch|EndTry|Throw|Assert|Goto|DefData|ReadData|RestoreData)\b" is(keyword.reserved)
37
+ r"([a-z_][a-z0-9_]*)" is(name.variable)
38
+
39
+ lex(string):
40
+ r"\"\"" is(literal.string.double)
41
+ r"\"C?" is(literal.string.double) -> pop
42
+ r"[^\"]+" is(literal.string.double)
43
+
44
+ const-set(.Lexer, lexer)
@@ -0,0 +1,55 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "Boo"
6
+ aliases: ["boo"]
7
+ extensions: [".boo"]
8
+ mimetypes: ["text/x-boo"]
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(comment):
13
+ r"/[*]" is(comment.multiline) -> push
14
+ r"[*]/" is(comment.multiline) -> pop
15
+ r"[^/*]" is(comment.multiline)
16
+ r"[*/]" is(comment.multiline)
17
+
18
+ lex(classname):
19
+ r"[a-zA-Z_][a-zA-Z0-9_]*" is(name.class) -> pop
20
+
21
+ lex(namespace):
22
+ r"[a-zA-Z_][a-zA-Z0-9_.]*" is(name.namespace) -> pop
23
+
24
+ lex(root):
25
+ r"\s+" is(text)
26
+ r"(\#|//).*$" is(comment.single)
27
+ r"/[*]" is(comment.multiline) -> go-to(comment)
28
+ r"[\]{}:(),.;\[]" is(punctuation)
29
+ r"\\\n" is(text)
30
+ r"\\" is(text)
31
+ r"(in|is|and|or|not)\b" is(operator.word)
32
+ r"/(\\\\|\\/|[^/\s])/" is(literal.string.regex)
33
+ r"@/(\\\\|\\/|[^/])*/" is(literal.string.regex)
34
+ r"=\126|!=|==|<<|>>|[-+/*%=<>&^|]" is(operator)
35
+ r"(as|abstract|callable|constructor|destructor|do|import|enum|event|final|get|interface|internal|of|override|partial|private|protected|public|return|set|static|struct|transient|virtual|yield|super|and|break|cast|continue|elif|else|ensure|except|for|given|goto|if|in|is|isa|not|or|otherwise|pass|raise|ref|try|unless|when|while|from|as)\b" is(keyword)
36
+ r"def(?=\s+\(.*?\))" is(keyword)
37
+ r"(def)(\s+)" is(by-groups(keyword, text)) -> go-to(funcname)
38
+ r"(class)(\s+)" is(by-groups(keyword, text)) -> go-to(classname)
39
+ r"(namespace)(\s+)" is(by-groups(keyword, text)) -> go-to(namespace)
40
+ r"(?<!\.)(true|false|null|self|__eval__|__switch__|array|assert|checked|enumerate|filter|getter|len|lock|map|matrix|max|min|normalArrayIndexing|print|property|range|rawArrayIndexing|required|typeof|unchecked|using|yieldAll|zip)\b" is(name.builtin)
41
+ r"\"\"\"(\\\\|\\\"|.*?)\"\"\"" is(literal.string.double)
42
+ r"\"(\\\\|\\\"|[^\"]*?)\"" is(literal.string.double)
43
+ r"'(\\\\|\\'|[^']*?)'" is(literal.string.single)
44
+ r"[a-zA-Z_][a-zA-Z0-9_]*" is(name)
45
+ r"(\d+\.\d*|\d*\.\d+)([fF][+-]?[0-9]+)?" is(literal.number.float)
46
+ r"[0-9][0-9\.]*(ms?|d|h|s)" is(literal.number)
47
+ r"0\d+" is(literal.number.oct)
48
+ r"0x[a-fA-F0-9]+" is(literal.number.hex)
49
+ r"\d+L" is(literal.number.integer.long)
50
+ r"\d+" is(literal.number.integer)
51
+
52
+ lex(funcname):
53
+ r"[a-zA-Z_][a-zA-Z0-9_]*" is(name.function) -> pop
54
+
55
+ const-set(.Lexer, lexer)
@@ -0,0 +1,28 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "Brainfuck"
6
+ aliases: ["brainfuck", "bf"]
7
+ extensions: [".bf", ".b"]
8
+ mimetypes: ["application/x-brainfuck"]
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(root):
13
+ r"\[" is(keyword) -> go-to(loop)
14
+ r"\]" is(error)
15
+ any-of(common)
16
+
17
+ lex(common):
18
+ r"[.,]+" is(name.tag)
19
+ r"[+-]+" is(name.builtin)
20
+ r"[<>]+" is(name.variable)
21
+ r"[^.,+\-<>\[\]]+" is(comment)
22
+
23
+ lex(loop):
24
+ r"\[" is(keyword) -> push
25
+ r"\]" is(keyword) -> pop
26
+ any-of(common)
27
+
28
+ const-set(.Lexer, lexer)
@@ -0,0 +1,57 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "Bro"
6
+ aliases: ["bro"]
7
+ extensions: [".bro"]
8
+ mimetypes: []
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(regex):
13
+ r"/" is(literal.string.regex) -> pop
14
+ r"\\[\\nt/]" is(literal.string.regex)
15
+ r"[^\\/\n]+" is(literal.string.regex)
16
+ r"\\\n" is(literal.string.regex)
17
+ r"\\" is(literal.string.regex)
18
+
19
+ lex(root):
20
+ r"^@.*?\n" is(comment.preproc)
21
+ r"\#.*?\n" is(comment.single)
22
+ r"\n" is(text)
23
+ r"\s+" is(text)
24
+ r"\\\n" is(text)
25
+ r"(add|alarm|break|case|const|continue|delete|do|else|enum|event|export|for|function|if|global|local|module|next|of|print|redef|return|schedule|type|when|while)\b" is(keyword)
26
+ r"(addr|any|bool|count|counter|double|file|int|interval|net|pattern|port|record|set|string|subnet|table|time|timer|vector)\b" is(keyword.type)
27
+ r"(T|F)\b" is(keyword.constant)
28
+ r"(&)((?:add|delete|expire)_func|attr|(?:create|read|write)_expire|default|disable_print_hook|raw_output|encrypt|group|log|mergeable|optional|persistent|priority|redef|rotate_(?:interval|size)|synchronized)\b" is(by-groups(punctuation, keyword))
29
+ r"\s+module\b" is(keyword.namespace)
30
+ r"\d+/(tcp|udp|icmp|unknown)\b" is(literal.number)
31
+ r"(\d+\.){3}\d+" is(literal.number)
32
+ r"([0-9a-fA-F_]+){7}[0-9a-fA-F_]+" is(literal.number)
33
+ r"0x[0-9a-fA-F_]+([0-9a-fA-F_]+|:)*::([0-9a-fA-F_]+|:)*" is(literal.number)
34
+ r"((\d+|:)([0-9a-fA-F_]+|:)*)?::([0-9a-fA-F_]+|:)*" is(literal.number)
35
+ r"(\d+\.\d+\.|(\d+\.){2}\d+)" is(literal.number)
36
+ r"[A-Za-z0-9][-A-Za-z0-9]*(\.[A-Za-z0-9][-A-Za-z0-9]*)+" is(literal.string)
37
+ r"((\d*\.?\d+)|(\d+\.?\d*))([eE][-+]?\d+)?\s+(day|hr|min|sec|msec|usec)s?\b" is(literal.date)
38
+ r"0[xX][0-9a-fA-F_]+" is(literal.number.hex)
39
+ r"((\d*\.?\d+)|(\d+\.?\d*))([eE][-+]?\d+)?" is(literal.number.float)
40
+ r"\d+" is(literal.number.integer)
41
+ r"/" is(literal.string.regex) -> go-to(regex)
42
+ r"\"" is(literal.string) -> go-to(string)
43
+ r"[!%*/+:<=>?\126|-]" is(operator)
44
+ r"([-+=&|]{2}|[+=!><-]=)" is(operator)
45
+ r"(in|match)\b" is(operator.word)
46
+ r"[{}()\[\]$.,;]" is(punctuation)
47
+ r"([_a-zA-Z]\w*)(::)" is(by-groups(name, name.namespace))
48
+ r"[a-zA-Z_][a-zA-Z_0-9]*" is(name)
49
+
50
+ lex(string):
51
+ r"\"" is(literal.string) -> pop
52
+ r"\\([\\abfnrtv\"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})" is(literal.string.escape)
53
+ r"[^\\\"\n]+" is(literal.string)
54
+ r"\\\n" is(literal.string)
55
+ r"\\" is(literal.string)
56
+
57
+ const-set(.Lexer, lexer)
@@ -0,0 +1,31 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "BUGS"
6
+ aliases: ["bugs", "winbugs", "openbugs"]
7
+ extensions: [".bug"]
8
+ mimetypes: []
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(root):
13
+ any-of(comments)
14
+ any-of(whitespace)
15
+ r"(model)(\s+)({)" is(by-groups(keyword.namespace, text, punctuation))
16
+ r"(for|in)(?![0-9a-zA-Z\._])" is(keyword.reserved)
17
+ r"(abs|arccos|arccosh|arcsin|arcsinh|arctan|arctanh|cloglog|cos|cosh|cumulative|cut|density|deviance|equals|expr|gammap|ilogit|icloglog|integral|log|logfact|loggam|logit|max|min|phi|post.p.value|pow|prior.p.value|probit|replicate.post|replicate.prior|round|sin|sinh|solution|sqrt|step|tan|tanh|trunc|inprod|interp.lin|inverse|logdet|mean|eigen.vals|ode|prod|p.valueM|rank|ranked|replicate.postM|sd|sort|sum|D|I|F|T|C|dbern|dbin|dcat|dnegbin|dpois|dhyper|dbeta|dchisqr|ddexp|dexp|dflat|dgamma|dgev|df|dggamma|dgpar|dloglik|dlnorm|dlogis|dnorm|dpar|dt|dunif|dweib|dmulti|ddirch|dmnorm|dmt|dwish)(?=\s*\()" is(name.builtin)
18
+ r"[A-Za-z][A-Za-z0-9_.]*" is(name)
19
+ r"[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?" is(literal.number)
20
+ r"\[|\]|\(|\)|:|,|;" is(punctuation)
21
+ r"<-|\126" is(operator)
22
+ r"\+|-|\*|/" is(operator)
23
+ r"[{}]" is(punctuation)
24
+
25
+ lex(whitespace):
26
+ r"\s+" is(text)
27
+
28
+ lex(comments):
29
+ r"\#.*$" is(comment.single)
30
+
31
+ const-set(.Lexer, lexer)
@@ -0,0 +1,84 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "C"
6
+ aliases: ["c"]
7
+ extensions: [".c", ".h", ".idc"]
8
+ mimetypes: ["text/x-chdr", "text/x-csrc"]
9
+ start: .root
10
+ flags: 0
11
+
12
+ lex(function):
13
+ any-of(whitespace)
14
+ any-of(statements)
15
+ r";" is(punctuation)
16
+ r"{" is(punctuation) -> push
17
+ r"}" is(punctuation) -> pop
18
+
19
+ lex(statements):
20
+ r"L?\"" is(literal.string) -> go-to(string)
21
+ r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'" is(literal.string.char)
22
+ r"(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*" is(literal.number.float)
23
+ r"(\d+\.\d*|\.\d+|\d+[fF])[fF]?" is(literal.number.float)
24
+ r"0x[0-9a-fA-F]+[LlUu]*" is(literal.number.hex)
25
+ r"0[0-7]+[LlUu]*" is(literal.number.oct)
26
+ r"\d+[LlUu]*" is(literal.number.integer)
27
+ r"\*/" is(error)
28
+ r"[\126!%^&*+=|?:<>/-]" is(operator)
29
+ r"[()\[\],.]" is(punctuation)
30
+ r"\b(case)(.+?)(:)" is(by-groups(keyword, using(self class), text))
31
+ r"(auto|break|case|const|continue|default|do|else|enum|extern|for|goto|if|register|restricted|return|sizeof|static|struct|switch|typedef|union|volatile|while)\b" is(keyword)
32
+ r"(bool|int|long|float|short|double|char|unsigned|signed|void|[a-z_][a-z0-9_]*_t)\b" is(keyword.type)
33
+ r"(_{0,2}inline|naked|restrict|thread|typename)\b" is(keyword.reserved)
34
+ r"(__(m128i|m128d|m128|m64))\b" is(keyword.reserved)
35
+ r"__(asm|int8|based|except|int16|stdcall|cdecl|fastcall|int32|declspec|finally|int64|try|leave|wchar_t|w64|unaligned|raise|noop|identifier|forceinline|assume)\b" is(keyword.reserved)
36
+ r"(true|false|NULL)\b" is(name.builtin)
37
+ r"[a-zA-Z_][a-zA-Z0-9_]*" is(name)
38
+
39
+ lex(whitespace):
40
+ r"^\#if\s+0" is(comment.preproc) -> go-to(if0)
41
+ r"^\#" is(comment.preproc) -> go-to(macro)
42
+ r"^(:\s*/[*].*?[*]/\s*)(\#if\s+0)" is(by-groups(using(self class), comment.preproc)) -> go-to(if0)
43
+ r"^(:\s*/[*].*?[*]/\s*)(\#)" is(by-groups(using(self class), comment.preproc)) -> go-to(macro)
44
+ r"^(\s*)([a-zA-Z_][a-zA-Z0-9_]*:(?!:))" is(by-groups(text, name.label))
45
+ r"\n" is(text)
46
+ r"\s+" is(text)
47
+ r"\\\n" is(text)
48
+ r"//(\n|(.|\n)*?[^\\]\n)" is(comment.single)
49
+ r"/(\\\n)?[*](.|\n)*?[*](\\\n)?/" is(comment.multiline)
50
+
51
+ lex(statement):
52
+ any-of(whitespace)
53
+ any-of(statements)
54
+ r"[{}]" is(punctuation)
55
+ r";" is(punctuation) -> pop
56
+
57
+ lex(if0):
58
+ r"^\s*\#if.*?(?<!\\)\n" is(comment.preproc) -> push
59
+ r"^\s*\#el(?:se|if).*\n" is(comment.preproc) -> pop
60
+ r"^\s*\#endif.*?(?<!\\)\n" is(comment.preproc) -> pop
61
+ r".*?\n" is(comment)
62
+
63
+ lex(macro):
64
+ r"[^/\n]+" is(comment.preproc)
65
+ r"/[*](.|\n)*?[*]/" is(comment.multiline)
66
+ r"//.*?\n" is(comment.single) -> pop
67
+ r"/" is(comment.preproc)
68
+ r"(?<=\\)\n" is(comment.preproc)
69
+ r"\n" is(comment.preproc) -> pop
70
+
71
+ lex(root):
72
+ any-of(whitespace)
73
+ r"((?:[a-zA-Z0-9_*\s])+?(?:\s|[*]))([a-zA-Z_][a-zA-Z0-9_]*)(\s*\([^;]*?\))((?:\s|//.*?\n|/[*].*?[*]/)+)?({)" is(by-groups(using(self class), name.function, using(self class), using(self class), punctuation)) -> go-to(function)
74
+ r"((?:[a-zA-Z0-9_*\s])+?(?:\s|[*]))([a-zA-Z_][a-zA-Z0-9_]*)(\s*\([^;]*?\))((?:\s|//.*?\n|/[*].*?[*]/)+)?(;)" is(by-groups(using(self class), name.function, using(self class), using(self class), punctuation))
75
+ r"" is(text) -> go-to(statement)
76
+
77
+ lex(string):
78
+ r"\"" is(literal.string) -> pop
79
+ r"\\([\\abfnrtv\"\']|x[a-fA-F0-9]{2,4}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})" is(literal.string.escape)
80
+ r"[^\\\"\n]+" is(literal.string)
81
+ r"\\\n" is(literal.string)
82
+ r"\\" is(literal.string)
83
+
84
+ const-set(.Lexer, lexer)
@@ -0,0 +1,26 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "ca65"
6
+ aliases: ["ca65"]
7
+ extensions: [".s"]
8
+ mimetypes: []
9
+ start: .root
10
+ flags: Regexp IGNORECASE
11
+
12
+ lex(root):
13
+ r";.*" is(comment.single)
14
+ r"\s+" is(text)
15
+ r"[a-z_.@$][\w.@$]*:" is(name.label)
16
+ r"((ld|st)[axy]|(in|de)[cxy]|asl|lsr|ro[lr]|adc|sbc|cmp|cp[xy]|cl[cvdi]|se[cdi]|jmp|jsr|bne|beq|bpl|bmi|bvc|bvs|bcc|bcs|p[lh][ap]|rt[is]|brk|nop|ta[xy]|t[xy]a|txs|tsx|and|ora|eor|bit)\b" is(keyword)
17
+ r"\.[a-z0-9_]+" is(keyword.pseudo)
18
+ r"[-+\126*/^&|!<>=]" is(operator)
19
+ r"\"[^\"\n]*." is(literal.string)
20
+ r"'[^'\n]*." is(literal.string.char)
21
+ r"\$[0-9a-f]+|[0-9a-f]+h\b" is(literal.number.hex)
22
+ r"\d+|%[01]+" is(literal.number.integer)
23
+ r"[\#,.:()=]" is(punctuation)
24
+ r"[a-z_.@$][\w.@$]*" is(name)
25
+
26
+ const-set(.Lexer, lexer)
@@ -0,0 +1,25 @@
1
+ use(require("atomy"))
2
+ use(require("hl/define"))
3
+
4
+ lexer = lexer:
5
+ name: "CBM BASIC V2"
6
+ aliases: ["cbmbas"]
7
+ extensions: [".bas"]
8
+ mimetypes: []
9
+ start: .root
10
+ flags: Regexp IGNORECASE
11
+
12
+ lex(root):
13
+ r"rem.*\n" is(comment.single)
14
+ r"\s+" is(text)
15
+ r"new|run|end|for|to|next|step|go(to|sub)?|on|return|stop|cont|if|then|input\#?|read|wait|load|save|verify|poke|sys|print\#?|list|clr|cmd|open|close|get\#?" is(keyword.reserved)
16
+ r"data|restore|dim|let|def|fn" is(keyword.declaration)
17
+ r"tab|spc|sgn|int|abs|usr|fre|pos|sqr|rnd|log|exp|cos|sin|tan|atn|peek|len|val|asc|(str|chr|left|right|mid)\$" is(name.builtin)
18
+ r"[-+*/^<>=]" is(operator)
19
+ r"not|and|or" is(operator.word)
20
+ r"\"[^\"\n]*." is(literal.string)
21
+ r"\d+|[-+]?\d*\.\d*(e[-+]?\d+)?" is(literal.number.float)
22
+ r"[\(\),:;]" is(punctuation)
23
+ r"\w+[$%]?" is(name)
24
+
25
+ const-set(.Lexer, lexer)