aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-01-08 18:40:00 +0000
committerAleksey Kladov <[email protected]>2018-01-08 18:40:00 +0000
commitea186fe2c073dfd56f834068ee928a9c875b0279 (patch)
tree8c3d8c12b04f95691f2140190a970199ad7c0a39 /src
parentf25142c5edc579c7f7030c03c2673db238255bb2 (diff)
G: inner attributes
Diffstat (limited to 'src')
-rw-r--r--src/parser/event_parser/grammar/expressions.rs13
-rw-r--r--src/syntax_kinds.rs4
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 @@
1use super::*; 1use super::*;
2 2
3pub(super) fn literal(p: &mut Parser) -> bool { 3pub(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);
66pub const FN_ITEM: SyntaxKind = SyntaxKind(62); 66pub const FN_ITEM: SyntaxKind = SyntaxKind(62);
67pub const ATTR: SyntaxKind = SyntaxKind(63); 67pub const ATTR: SyntaxKind = SyntaxKind(63);
68pub const META_ITEM: SyntaxKind = SyntaxKind(64); 68pub const META_ITEM: SyntaxKind = SyntaxKind(64);
69pub const LITERAL: SyntaxKind = SyntaxKind(65);
69 70
70static INFOS: [SyntaxInfo; 65] = [ 71static 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
138pub(crate) fn syntax_info(kind: SyntaxKind) -> &'static SyntaxInfo { 140pub(crate) fn syntax_info(kind: SyntaxKind) -> &'static SyntaxInfo {