@@ -25,15 +25,15 @@ color brightwhite ".+"
25
25
color brightyellow " :| \*\* | \* | /| %| \+ | -| \^ | >| >=| <| <=| ~=| =| \.\. | \< (not| and| or)\> "
26
26
27
27
# Statements
28
- color brightblue " \< (do| end| while| repeat| until| if| elseif| then| else| for| in| function| local| return)\> "
28
+ color brightblue " \< (do| end| while| repeat| until| if| elseif| then| else| for| in| function| local| return| goto )\> "
29
29
30
30
# Keywords
31
31
color brightyellow " \< (debug| string| math| table| io| coroutine| os| utf8| bit32)\>\. "
32
32
color brightyellow " \< (_ENV| _G| _VERSION| assert| collectgarbage| dofile| error| getfenv| getmetatable| ipairs| load| loadfile| module| next| pairs| pcall| print| rawequal| rawget| rawlen| rawset| require| select| setfenv| setmetatable| tonumber| tostring| type| unpack| xpcall)\s * \( "
33
33
34
34
# Standard library
35
35
color brightyellow " io\.\< (close| flush| input| lines| open| output| popen| read| tmpfile| type| write)\> "
36
- color brightyellow " math\.\< (abs| acos| asin| atan2| atan| ceil| cosh| cos| deg| exp| floor| fmod| frexp| huge| ldexp| log10| log| max| maxinteger| min| mininteger| modf| pi| pow| rad| random| randomseed| sinh | sqrt| tan| tointeger| type| ult)\> "
36
+ color brightyellow " math\.\< (abs| acos| asin| atan2| atan| ceil| cosh| cos| deg| exp| floor| fmod| frexp| huge| ldexp| log10| log| max| maxinteger| min| mininteger| modf| pi| pow| rad| random| randomseed| sin | sqrt| tan| tointeger| type| ult)\> "
37
37
color brightyellow " os\.\< (clock| date| difftime| execute| exit| getenv| remove| rename| setlocale| time| tmpname)\> "
38
38
color brightyellow " package\.\< (config| cpath| loaded| loadlib| path| preload| seeall| searchers| searchpath)\> "
39
39
color brightyellow " string\.\< (byte| char| dump| find| format| gmatch| gsub| len| lower| match| pack| packsize| rep| reverse| sub| unpack| upper)\> "
@@ -52,8 +52,10 @@ color brightmagenta "\<(false|nil|true)\>"
52
52
# External files
53
53
color brightgreen " (\< (dofile| require| include)| %q| %!| %Q| %r| %x)\> "
54
54
55
- # Numbers
56
- color red " \< ([0 -9 ]+ )\> "
55
+ # Numbers (hex and decimal with scientific notation)
56
+ # color magenta "\<(0[xX](([0-9A-Fa-f]+\.[0-9A-Fa-f]*)|(\.?[0-9A-Fa-f]+))([pP][-+]?[0-9]+)?)\>"
57
+ # color magenta "\<((([0-9]+\.[0-9]*)|(\.?[0-9]+))([eE][-+]?[0-9]+)?)\>"
58
+ color magenta " \< ((0[xX ](([0 -9A -Fa -f ]+ \. [0 -9A -Fa -f ]* )| (\. ? [0 -9A -Fa -f ]+ ))([pP ][- + ]? [0 -9 ]+ )? )| ((([0 -9 ]+ \. [0 -9 ]* )| (\. ? [0 -9 ]+ ))([eE ][- + ]? [0 -9 ]+ )? ))\> "
57
59
58
60
# Symbols
59
61
color brightmagenta " (\( | \) | \[ | \] | \{ | \} )"
@@ -65,7 +67,7 @@ color red "\"(\\.|[^\\\"])*\"|'(\\.|[^\\'])*'"
65
67
color red start =" \s * \[\[ " end =" \]\] "
66
68
67
69
# Escapes
68
- color red " \\ [ 0 - 7 ] [0 -7 ][ 0 - 7 ] | \\ x[0 -9a -fA -F ][0 -9a -fA -F ]| \\ [ abefnrs ] | ( \\ c | \\ C- | \\ M- | \\ M- \\ C-) . "
70
+ color magenta " \\ ([ abfnrtvz' \" ] | [0 -9 ] { 1 , 3 } | x[0 -9a -fA -F ][0 -9a -fA -F ]| u \{ [ 0 - 9a - fA - F ] + \} ) "
69
71
70
72
# Shebang
71
73
color brightcyan " ^ #!. * "
0 commit comments