|
14 | 14 | { regex: /\b0x[0-9a-f]+\b/i, token: "number" },
|
15 | 15 | { regex: /\b-?\d+(?:\.\d+)?(?:e[-+]?\d+)?\b/i, token: "number" },
|
16 | 16 | { regex: /(?:\/-[\s\S]*?-\/)|(?:--.*$)/m, token: "comment" },
|
17 |
| - { regex: /\b(?:theorem|show|have|from|suffices|nomatch|def|class|structure|instance|set_option|initialize|builtin_initialize|example|inductive|coinductive|axiom|constant|universe|universes|variable|variables|import|open|export|theory|prelude|renaming|hiding|exposing|do|by|let|extends|mutual|mut|where|rec|syntax|macro_rules|macro|deriving|fun|section|namespace|end|infix|infixl|infixr|postfix|prefix|notation|abbrev|if|then|else|calc|match|with|for|in|unless|try|catch|finally|return|continue|break|global|local|scoped|partial|unsafe|private|protected|noncomputable)\b/, token: "keyword" }, |
18 |
| - { regex: /#(print|check|eval|reduce|check_failure)/, token: "operator" }, |
| 17 | + { regex: /\b(?:show|have|from|suffices|nomatch|set_option|initialize|builtin_initialize|example|universe|universes|variable|variables|import|open|export|theory|prelude|renaming|hiding|exposing|do|by|let|extends|mutual|mut|where|rec|syntax|macro_rules|macro|deriving|fun|section|namespace|end|infix|infixl|infixr|postfix|prefix|notation|if|then|else|calc|match|with|for|in|unless|try|catch|finally|return|continue|break|global|local|scoped|partial|unsafe|private|protected|noncomputable|true|false)\b/, token: "keyword" }, |
| 18 | + { regex: /#(print|check|eval|reduce|check_failure)\b/, token: "operator" }, |
19 | 19 | { regex: /\+|\*|-|\/|:=|>>>|<<<|\^\^\^|&&&|\|\|\||\+\+|\^|%|~~~|<|<=|>|>=|==|=/, token: "operator" },
|
20 | 20 | { regex: /[()\[\]{},:]/, token: "meta" },
|
21 |
| - { regex: /\b(?:true|false)\b/, token: "attribute" }, |
22 |
| - { regex: /\b(?:sorry|admit)\b/, token: "operator" }, |
23 |
| - // { regex: /(\b(?:inductive|coinductive|structure|theorem|axiom|abbrev|lemma|def|instance|class|constant))(\s+)(\w+)/, token: ["keyword", null, "function"] } |
| 21 | + { regex: /\b(?:sorry|admit)\b/, token: "error" }, |
| 22 | + { regex: /(\b(inductive|coinductive|structure|theorem|axiom|abbrev|lemma|def|instance|class|constant))(\s+)/, token: "keyword", push: "definition" }, |
| 23 | + { regex: /"[^"]*"|'[^']'/, token: "string" }, |
| 24 | + { regex: /@\[[^\]\n]*\]/, token: "keyword" }, |
| 25 | + { regex: /\`[^(\s]*/, token: "operator" } |
| 26 | + ], |
| 27 | + definition: [ |
| 28 | + { regex: /(\w+)/, token: "attribute", pop: true } |
24 | 29 | ]
|
25 | 30 | })
|
26 | 31 | });
|
0 commit comments