aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--grammar.ron2
-rw-r--r--src/lexer/mod.rs2
-rw-r--r--src/syntax_kinds.rs30
-rw-r--r--tests/data/lexer/0005_symbols.rs2
-rw-r--r--tests/data/lexer/0005_symbols.txt4
5 files changed, 26 insertions, 14 deletions
diff --git a/grammar.ron b/grammar.ron
index 4c9291dfb..b707248f3 100644
--- a/grammar.ron
+++ b/grammar.ron
@@ -18,6 +18,8 @@ Grammar(
18 "R_CURLY", 18 "R_CURLY",
19 "L_BRACK", 19 "L_BRACK",
20 "R_BRACK", 20 "R_BRACK",
21 "L_ANGLE",
22 "R_ANGLE",
21 "AT", 23 "AT",
22 "POUND", 24 "POUND",
23 "TILDE", 25 "TILDE",
diff --git a/src/lexer/mod.rs b/src/lexer/mod.rs
index 5255c3d56..24c14add0 100644
--- a/src/lexer/mod.rs
+++ b/src/lexer/mod.rs
@@ -47,6 +47,8 @@ fn next_token_inner(c: char, ptr: &mut Ptr) -> SyntaxKind {
47 '}' => return R_CURLY, 47 '}' => return R_CURLY,
48 '[' => return L_BRACK, 48 '[' => return L_BRACK,
49 ']' => return R_BRACK, 49 ']' => return R_BRACK,
50 '<' => return L_ANGLE,
51 '>' => return R_ANGLE,
50 '@' => return AT, 52 '@' => return AT,
51 '#' => return POUND, 53 '#' => return POUND,
52 '~' => return TILDE, 54 '~' => return TILDE,
diff --git a/src/syntax_kinds.rs b/src/syntax_kinds.rs
index a922056ce..040ac1257 100644
--- a/src/syntax_kinds.rs
+++ b/src/syntax_kinds.rs
@@ -19,20 +19,22 @@ pub const L_CURLY: SyntaxKind = SyntaxKind(14);
19pub const R_CURLY: SyntaxKind = SyntaxKind(15); 19pub const R_CURLY: SyntaxKind = SyntaxKind(15);
20pub const L_BRACK: SyntaxKind = SyntaxKind(16); 20pub const L_BRACK: SyntaxKind = SyntaxKind(16);
21pub const R_BRACK: SyntaxKind = SyntaxKind(17); 21pub const R_BRACK: SyntaxKind = SyntaxKind(17);
22pub const AT: SyntaxKind = SyntaxKind(18); 22pub const L_ANGLE: SyntaxKind = SyntaxKind(18);
23pub const POUND: SyntaxKind = SyntaxKind(19); 23pub const R_ANGLE: SyntaxKind = SyntaxKind(19);
24pub const TILDE: SyntaxKind = SyntaxKind(20); 24pub const AT: SyntaxKind = SyntaxKind(20);
25pub const QUESTION: SyntaxKind = SyntaxKind(21); 25pub const POUND: SyntaxKind = SyntaxKind(21);
26pub const COLON: SyntaxKind = SyntaxKind(22); 26pub const TILDE: SyntaxKind = SyntaxKind(22);
27pub const COLONCOLON: SyntaxKind = SyntaxKind(23); 27pub const QUESTION: SyntaxKind = SyntaxKind(23);
28pub const DOLLAR: SyntaxKind = SyntaxKind(24); 28pub const COLON: SyntaxKind = SyntaxKind(24);
29pub const EQ: SyntaxKind = SyntaxKind(25); 29pub const COLONCOLON: SyntaxKind = SyntaxKind(25);
30pub const EQEQ: SyntaxKind = SyntaxKind(26); 30pub const DOLLAR: SyntaxKind = SyntaxKind(26);
31pub const FAT_ARROW: SyntaxKind = SyntaxKind(27); 31pub const EQ: SyntaxKind = SyntaxKind(27);
32pub const NEQ: SyntaxKind = SyntaxKind(28); 32pub const EQEQ: SyntaxKind = SyntaxKind(28);
33pub const NOT: SyntaxKind = SyntaxKind(29); 33pub const FAT_ARROW: SyntaxKind = SyntaxKind(29);
34pub const NEQ: SyntaxKind = SyntaxKind(30);
35pub const NOT: SyntaxKind = SyntaxKind(31);
34 36
35static INFOS: [SyntaxInfo; 30] = [ 37static INFOS: [SyntaxInfo; 32] = [
36 SyntaxInfo { name: "ERROR" }, 38 SyntaxInfo { name: "ERROR" },
37 SyntaxInfo { name: "IDENT" }, 39 SyntaxInfo { name: "IDENT" },
38 SyntaxInfo { name: "UNDERSCORE" }, 40 SyntaxInfo { name: "UNDERSCORE" },
@@ -51,6 +53,8 @@ static INFOS: [SyntaxInfo; 30] = [
51 SyntaxInfo { name: "R_CURLY" }, 53 SyntaxInfo { name: "R_CURLY" },
52 SyntaxInfo { name: "L_BRACK" }, 54 SyntaxInfo { name: "L_BRACK" },
53 SyntaxInfo { name: "R_BRACK" }, 55 SyntaxInfo { name: "R_BRACK" },
56 SyntaxInfo { name: "L_ANGLE" },
57 SyntaxInfo { name: "R_ANGLE" },
54 SyntaxInfo { name: "AT" }, 58 SyntaxInfo { name: "AT" },
55 SyntaxInfo { name: "POUND" }, 59 SyntaxInfo { name: "POUND" },
56 SyntaxInfo { name: "TILDE" }, 60 SyntaxInfo { name: "TILDE" },
diff --git a/tests/data/lexer/0005_symbols.rs b/tests/data/lexer/0005_symbols.rs
index 00ed44b65..c41e985a1 100644
--- a/tests/data/lexer/0005_symbols.rs
+++ b/tests/data/lexer/0005_symbols.rs
@@ -1,4 +1,4 @@
1; , ( ) { } [ ] @ # ~ ? $ 1; , ( ) { } [ ] < > @ # ~ ? $
2. .. ... ..= 2. .. ... ..=
3: :: 3: ::
4= => 4= =>
diff --git a/tests/data/lexer/0005_symbols.txt b/tests/data/lexer/0005_symbols.txt
index 291872026..a1b777a92 100644
--- a/tests/data/lexer/0005_symbols.txt
+++ b/tests/data/lexer/0005_symbols.txt
@@ -14,6 +14,10 @@ L_BRACK 1 "["
14WHITESPACE 1 " " 14WHITESPACE 1 " "
15R_BRACK 1 "]" 15R_BRACK 1 "]"
16WHITESPACE 1 " " 16WHITESPACE 1 " "
17L_ANGLE 1 "<"
18WHITESPACE 1 " "
19R_ANGLE 1 ">"
20WHITESPACE 1 " "
17AT 1 "@" 21AT 1 "@"
18WHITESPACE 1 " " 22WHITESPACE 1 " "
19POUND 1 "#" 23POUND 1 "#"