source: node_modules/refractor/lang/warpscript.js

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: 1.1 KB
Line 
1'use strict'
2
3module.exports = warpscript
4warpscript.displayName = 'warpscript'
5warpscript.aliases = []
6function warpscript(Prism) {
7 Prism.languages.warpscript = {
8 comment: /#.*|\/\/.*|\/\*[\s\S]*?\*\//,
9 string: {
10 pattern:
11 /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'|<'(?:[^\\']|'(?!>)|\\.)*'>/,
12 greedy: true
13 },
14 variable: /\$\S+/,
15 macro: {
16 pattern: /@\S+/,
17 alias: 'property'
18 },
19 // WarpScript doesn't have any keywords, these are all functions under the control category
20 // https://www.warp10.io/tags/control
21 keyword:
22 /\b(?:BREAK|CHECKMACRO|CONTINUE|CUDF|DEFINED|DEFINEDMACRO|EVAL|FAIL|FOR|FOREACH|FORSTEP|IFT|IFTE|MSGFAIL|NRETURN|RETHROW|RETURN|SWITCH|TRY|UDF|UNTIL|WHILE)\b/,
23 number:
24 /[+-]?\b(?:NaN|Infinity|\d+(?:\.\d*)?(?:[Ee][+-]?\d+)?|0x[\da-fA-F]+|0b[01]+)\b/,
25 boolean: /\b(?:F|T|false|true)\b/,
26 punctuation: /<%|%>|[{}[\]()]/,
27 // Some operators from the "operators" category
28 // https://www.warp10.io/tags/operators
29 operator:
30 /==|&&?|\|\|?|\*\*?|>>>?|<<|[<>!~]=?|[-/%^]|\+!?|\b(?:AND|NOT|OR)\b/
31 }
32}
Note: See TracBrowser for help on using the repository browser.