diff options
-rw-r--r-- | grammar.ron | 2 | ||||
-rw-r--r-- | src/lexer/mod.rs | 2 | ||||
-rw-r--r-- | src/syntax_kinds.rs | 30 | ||||
-rw-r--r-- | tests/data/lexer/0005_symbols.rs | 2 | ||||
-rw-r--r-- | tests/data/lexer/0005_symbols.txt | 4 |
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); | |||
19 | pub const R_CURLY: SyntaxKind = SyntaxKind(15); | 19 | pub const R_CURLY: SyntaxKind = SyntaxKind(15); |
20 | pub const L_BRACK: SyntaxKind = SyntaxKind(16); | 20 | pub const L_BRACK: SyntaxKind = SyntaxKind(16); |
21 | pub const R_BRACK: SyntaxKind = SyntaxKind(17); | 21 | pub const R_BRACK: SyntaxKind = SyntaxKind(17); |
22 | pub const AT: SyntaxKind = SyntaxKind(18); | 22 | pub const L_ANGLE: SyntaxKind = SyntaxKind(18); |
23 | pub const POUND: SyntaxKind = SyntaxKind(19); | 23 | pub const R_ANGLE: SyntaxKind = SyntaxKind(19); |
24 | pub const TILDE: SyntaxKind = SyntaxKind(20); | 24 | pub const AT: SyntaxKind = SyntaxKind(20); |
25 | pub const QUESTION: SyntaxKind = SyntaxKind(21); | 25 | pub const POUND: SyntaxKind = SyntaxKind(21); |
26 | pub const COLON: SyntaxKind = SyntaxKind(22); | 26 | pub const TILDE: SyntaxKind = SyntaxKind(22); |
27 | pub const COLONCOLON: SyntaxKind = SyntaxKind(23); | 27 | pub const QUESTION: SyntaxKind = SyntaxKind(23); |
28 | pub const DOLLAR: SyntaxKind = SyntaxKind(24); | 28 | pub const COLON: SyntaxKind = SyntaxKind(24); |
29 | pub const EQ: SyntaxKind = SyntaxKind(25); | 29 | pub const COLONCOLON: SyntaxKind = SyntaxKind(25); |
30 | pub const EQEQ: SyntaxKind = SyntaxKind(26); | 30 | pub const DOLLAR: SyntaxKind = SyntaxKind(26); |
31 | pub const FAT_ARROW: SyntaxKind = SyntaxKind(27); | 31 | pub const EQ: SyntaxKind = SyntaxKind(27); |
32 | pub const NEQ: SyntaxKind = SyntaxKind(28); | 32 | pub const EQEQ: SyntaxKind = SyntaxKind(28); |
33 | pub const NOT: SyntaxKind = SyntaxKind(29); | 33 | pub const FAT_ARROW: SyntaxKind = SyntaxKind(29); |
34 | pub const NEQ: SyntaxKind = SyntaxKind(30); | ||
35 | pub const NOT: SyntaxKind = SyntaxKind(31); | ||
34 | 36 | ||
35 | static INFOS: [SyntaxInfo; 30] = [ | 37 | static 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 "[" | |||
14 | WHITESPACE 1 " " | 14 | WHITESPACE 1 " " |
15 | R_BRACK 1 "]" | 15 | R_BRACK 1 "]" |
16 | WHITESPACE 1 " " | 16 | WHITESPACE 1 " " |
17 | L_ANGLE 1 "<" | ||
18 | WHITESPACE 1 " " | ||
19 | R_ANGLE 1 ">" | ||
20 | WHITESPACE 1 " " | ||
17 | AT 1 "@" | 21 | AT 1 "@" |
18 | WHITESPACE 1 " " | 22 | WHITESPACE 1 " " |
19 | POUND 1 "#" | 23 | POUND 1 "#" |