Skip to content

Commit aa83389

Browse files
committed
---
yaml --- r: 160239 b: refs/heads/snap-stage3 c: 7586abf h: refs/heads/master i: 160237: da35386 160235: fc42177 160231: 8128add 160223: c4530f2 v: v3
1 parent 8215645 commit aa83389

File tree

2 files changed

+16
-30
lines changed

2 files changed

+16
-30
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: bfaa7bcab3459907014c31d3bf980f65ccd14b08
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 606a309d4aeb09ba88a0962c633a5b3fd4b300f6
4+
refs/heads/snap-stage3: 7586abf01b5c6fcbb60926c7cab7d3e5d133fa9a
55
refs/heads/try: 225de0d60f8ca8dcc62ab2fd8818ebbda4b58cfe
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/grammar/RustLexer.g4

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -92,49 +92,35 @@ fragment CHAR_ESCAPE
9292
| 'U' HEXIT HEXIT HEXIT HEXIT HEXIT HEXIT HEXIT HEXIT
9393
;
9494
95-
LIT_CHAR
96-
: '\'' ( '\\' CHAR_ESCAPE | ~[\\'\n\t\r] ) '\''
95+
fragment SUFFIX
96+
: IDENT
9797
;
9898
99-
LIT_BYTE
100-
: 'b\'' ( '\\' ( [xX] HEXIT HEXIT | [nrt\\'"0] ) | ~[\\'\n\t\r] ) '\''
99+
LIT_CHAR
100+
: '\'' ( '\\' CHAR_ESCAPE | ~[\\'\n\t\r] ) '\'' SUFFIX?
101101
;
102102

103-
fragment INT_SUFFIX
104-
: 'i'
105-
| 'i8'
106-
| 'i16'
107-
| 'i32'
108-
| 'i64'
109-
| 'u'
110-
| 'u8'
111-
| 'u16'
112-
| 'u32'
113-
| 'u64'
103+
LIT_BYTE
104+
: 'b\'' ( '\\' ( [xX] HEXIT HEXIT | [nrt\\'"0] ) | ~[\\'\n\t\r] ) '\'' SUFFIX?
114105
;
115106

116107
LIT_INTEGER
117-
: [0-9][0-9_]* INT_SUFFIX?
118-
| '0b' [01][01_]* INT_SUFFIX?
119-
| '0o' [0-7][0-7_]* INT_SUFFIX?
120-
| '0x' [0-9a-fA-F][0-9a-fA-F_]* INT_SUFFIX?
121-
;
122-
123-
fragment FLOAT_SUFFIX
124-
: 'f32'
125-
| 'f64'
108+
: [0-9][0-9_]* SUFFIX?
109+
| '0b' [01][01_]* SUFFIX?
110+
| '0o' [0-7][0-7_]* SUFFIX?
111+
| '0x' [0-9a-fA-F][0-9a-fA-F_]* SUFFIX?
126112
;
127113

128114
LIT_FLOAT
129-
: [0-9][0-9_]* ('.' | ('.' [0-9][0-9_]*)? ([eE] [-+]? [0-9][0-9_]*)? FLOAT_SUFFIX?)
115+
: [0-9][0-9_]* ('.' | ('.' [0-9][0-9_]*)? ([eE] [-+]? [0-9][0-9_]*)? SUFFIX?)
130116
;
131117

132118
LIT_STR
133-
: '"' ('\\\n' | '\\\r\n' | '\\' CHAR_ESCAPE | .)*? '"'
119+
: '"' ('\\\n' | '\\\r\n' | '\\' CHAR_ESCAPE | .)*? '"' SUFFIX?
134120
;
135121

136-
LIT_BINARY : 'b' LIT_STR ;
137-
LIT_BINARY_RAW : 'rb' LIT_STR_RAW ;
122+
LIT_BINARY : 'b' LIT_STR SUFFIX?;
123+
LIT_BINARY_RAW : 'rb' LIT_STR_RAW SUFFIX?;
138124

139125
/* this is a bit messy */
140126

@@ -148,7 +134,7 @@ fragment LIT_STR_RAW_INNER2
148134
;
149135

150136
LIT_STR_RAW
151-
: 'r' LIT_STR_RAW_INNER
137+
: 'r' LIT_STR_RAW_INNER SUFFIX?
152138
;
153139

154140
IDENT : XID_start XID_continue* ;

0 commit comments

Comments
 (0)