mirror of
https://github.com/PaddiM8/kalker.git
synced 2024-11-07 16:34:21 +01:00
Added 'mod' keyword
This commit is contained in:
parent
48e7b719f6
commit
6ab25d573c
@ -106,7 +106,7 @@ impl Highlighter for LineHighlighter {
|
||||
|
||||
let reg = Regex::new(
|
||||
r"(?x)
|
||||
(?P<op>([+\-/*%^!×÷⋅∧∨]|if|otherwise|\sand|\sor|load|exit|clear|help)) |
|
||||
(?P<op>([+\-/*%^!×÷⋅∧∨]|if|otherwise|\sand|\sor|\smod|load|exit|clear|help)) |
|
||||
(?P<radix>0[box][a-zA-Z0-9]+) |
|
||||
(?P<identifier>[^!-@\s_|^⌊⌋⌈⌉\[\]\{\}⟦⟧≠≥≤⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎]+(_\d+)?)",
|
||||
)
|
||||
|
@ -324,6 +324,7 @@ impl<'a> Lexer<'a> {
|
||||
let kind = match value.as_ref() {
|
||||
"and" => TokenKind::And,
|
||||
"or" => TokenKind::Or,
|
||||
"mod" => TokenKind::Percent,
|
||||
"unit" => TokenKind::UnitKeyword,
|
||||
"to" => TokenKind::ToKeyword,
|
||||
"if" => TokenKind::IfKeyword,
|
||||
|
@ -306,7 +306,7 @@
|
||||
let result = input;
|
||||
let offset = 0;
|
||||
result = result.replace(
|
||||
/(?<brackets>\[\[)|(?<radix>0[box][a-zA-Z0-9]+)|(?<comparison>(!=|[<>]=?))|(?<html>[<>&]|(\n\s*\}?|\s+))|(?<op>([+\-/*%^!≈×÷⋅∧∨]|if|otherwise|and|or)|(?<identifier>[^!-@\s_|^⌊⌋⌈⌉≈\[\]\{\}⟦⟧≠≥≤⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎]+(_\d+)?)\(?)/g,
|
||||
/(?<brackets>\[\[)|(?<radix>0[box][a-zA-Z0-9]+)|(?<comparison>(!=|[<>]=?))|(?<html>[<>&]|(\n\s*\}?|\s+))|(?<op>([+\-/*%^!≈×÷⋅∧∨]|if|otherwise|and|or|mod)|(?<identifier>[^!-@\s_|^⌊⌋⌈⌉≈\[\]\{\}⟦⟧≠≥≤⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎]+(_\d+)?)\(?)/g,
|
||||
(
|
||||
substring,
|
||||
brackets,
|
||||
|
Loading…
Reference in New Issue
Block a user