diff options
author | Aleksey Kladov <[email protected]> | 2018-01-08 18:40:00 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-01-08 18:40:00 +0000 |
commit | ea186fe2c073dfd56f834068ee928a9c875b0279 (patch) | |
tree | 8c3d8c12b04f95691f2140190a970199ad7c0a39 /src | |
parent | f25142c5edc579c7f7030c03c2673db238255bb2 (diff) |
G: inner attributes
Diffstat (limited to 'src')
-rw-r--r-- | src/parser/event_parser/grammar/expressions.rs | 13 | ||||
-rw-r--r-- | src/syntax_kinds.rs | 4 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/parser/event_parser/grammar/expressions.rs b/src/parser/event_parser/grammar/expressions.rs index 9b43bdf2a..a6a1b302b 100644 --- a/src/parser/event_parser/grammar/expressions.rs +++ b/src/parser/event_parser/grammar/expressions.rs | |||
@@ -1,5 +1,16 @@ | |||
1 | use super::*; | 1 | use super::*; |
2 | 2 | ||
3 | pub(super) fn literal(p: &mut Parser) -> bool { | 3 | pub(super) fn literal(p: &mut Parser) -> bool { |
4 | p.eat(INT_NUMBER) || p.eat(FLOAT_NUMBER) | 4 | match p.current() { |
5 | TRUE_KW | FALSE_KW | ||
6 | | INT_NUMBER | FLOAT_NUMBER | ||
7 | | BYTE | CHAR | ||
8 | |STRING | RAW_STRING | BYTE_STRING | RAW_BYTE_STRING => { | ||
9 | node(p, LITERAL, |p| { | ||
10 | p.bump(); | ||
11 | }); | ||
12 | true | ||
13 | } | ||
14 | _ => false | ||
15 | } | ||
5 | } \ No newline at end of file | 16 | } \ No newline at end of file |
diff --git a/src/syntax_kinds.rs b/src/syntax_kinds.rs index 53ea0775a..b82a4f7f2 100644 --- a/src/syntax_kinds.rs +++ b/src/syntax_kinds.rs | |||
@@ -66,8 +66,9 @@ pub const STRUCT_FIELD: SyntaxKind = SyntaxKind(61); | |||
66 | pub const FN_ITEM: SyntaxKind = SyntaxKind(62); | 66 | pub const FN_ITEM: SyntaxKind = SyntaxKind(62); |
67 | pub const ATTR: SyntaxKind = SyntaxKind(63); | 67 | pub const ATTR: SyntaxKind = SyntaxKind(63); |
68 | pub const META_ITEM: SyntaxKind = SyntaxKind(64); | 68 | pub const META_ITEM: SyntaxKind = SyntaxKind(64); |
69 | pub const LITERAL: SyntaxKind = SyntaxKind(65); | ||
69 | 70 | ||
70 | static INFOS: [SyntaxInfo; 65] = [ | 71 | static INFOS: [SyntaxInfo; 66] = [ |
71 | SyntaxInfo { name: "USE_KW" }, | 72 | SyntaxInfo { name: "USE_KW" }, |
72 | SyntaxInfo { name: "FN_KW" }, | 73 | SyntaxInfo { name: "FN_KW" }, |
73 | SyntaxInfo { name: "STRUCT_KW" }, | 74 | SyntaxInfo { name: "STRUCT_KW" }, |
@@ -133,6 +134,7 @@ static INFOS: [SyntaxInfo; 65] = [ | |||
133 | SyntaxInfo { name: "FN_ITEM" }, | 134 | SyntaxInfo { name: "FN_ITEM" }, |
134 | SyntaxInfo { name: "ATTR" }, | 135 | SyntaxInfo { name: "ATTR" }, |
135 | SyntaxInfo { name: "META_ITEM" }, | 136 | SyntaxInfo { name: "META_ITEM" }, |
137 | SyntaxInfo { name: "LITERAL" }, | ||
136 | ]; | 138 | ]; |
137 | 139 | ||
138 | pub(crate) fn syntax_info(kind: SyntaxKind) -> &'static SyntaxInfo { | 140 | pub(crate) fn syntax_info(kind: SyntaxKind) -> &'static SyntaxInfo { |