main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
758 bytes
|
Line | |
---|
1 | Prism.languages.lua = {
|
---|
2 | 'comment': /^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,
|
---|
3 | // \z may be used to skip the following space
|
---|
4 | 'string': {
|
---|
5 | pattern: /(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,
|
---|
6 | greedy: true
|
---|
7 | },
|
---|
8 | 'number': /\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,
|
---|
9 | 'keyword': /\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,
|
---|
10 | 'function': /(?!\d)\w+(?=\s*(?:[({]))/,
|
---|
11 | 'operator': [
|
---|
12 | /[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,
|
---|
13 | {
|
---|
14 | // Match ".." but don't break "..."
|
---|
15 | pattern: /(^|[^.])\.\.(?!\.)/,
|
---|
16 | lookbehind: true
|
---|
17 | }
|
---|
18 | ],
|
---|
19 | 'punctuation': /[\[\](){},;]|\.+|:+/
|
---|
20 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.