diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-02-02 20:46:04 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-02-02 20:46:04 +0000 |
commit | 5e7504b978c9b1365e0381691ef453e97603defa (patch) | |
tree | 44333026e9a488deef5ebc73eb6c8a277d1975dc /tests | |
parent | f9ecc680f0317bc56e661d7b41e7edcf52b2f995 (diff) | |
parent | 0000f4f4f2f32c6ff67db6cbc27e3a49c85f4b99 (diff) |
Merge #36
36: Static items r=matklad a=matklad
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/lexer/0011_keywords.rs | 4 | ||||
-rw-r--r-- | tests/data/lexer/0011_keywords.txt | 8 | ||||
-rw-r--r-- | tests/data/parser/ok/0023_static_items.rs | 2 | ||||
-rw-r--r-- | tests/data/parser/ok/0023_static_items.txt | 31 |
4 files changed, 43 insertions, 2 deletions
diff --git a/tests/data/lexer/0011_keywords.rs b/tests/data/lexer/0011_keywords.rs index 02ca19089..b74fc606e 100644 --- a/tests/data/lexer/0011_keywords.rs +++ b/tests/data/lexer/0011_keywords.rs | |||
@@ -1 +1,3 @@ | |||
1 | fn use struct trait enum impl true false as extern crate mod pub self super in where for loop while if match | 1 | fn use struct trait enum impl true false as extern crate |
2 | mod pub self super in where for loop while if match const | ||
3 | static mut | ||
diff --git a/tests/data/lexer/0011_keywords.txt b/tests/data/lexer/0011_keywords.txt index 964e3475a..05b1f0995 100644 --- a/tests/data/lexer/0011_keywords.txt +++ b/tests/data/lexer/0011_keywords.txt | |||
@@ -19,7 +19,7 @@ WHITESPACE 1 " " | |||
19 | EXTERN_KW 6 "extern" | 19 | EXTERN_KW 6 "extern" |
20 | WHITESPACE 1 " " | 20 | WHITESPACE 1 " " |
21 | CRATE_KW 5 "crate" | 21 | CRATE_KW 5 "crate" |
22 | WHITESPACE 1 " " | 22 | WHITESPACE 1 "\n" |
23 | MOD_KW 3 "mod" | 23 | MOD_KW 3 "mod" |
24 | WHITESPACE 1 " " | 24 | WHITESPACE 1 " " |
25 | PUB_KW 3 "pub" | 25 | PUB_KW 3 "pub" |
@@ -41,4 +41,10 @@ WHITESPACE 1 " " | |||
41 | IF_KW 2 "if" | 41 | IF_KW 2 "if" |
42 | WHITESPACE 1 " " | 42 | WHITESPACE 1 " " |
43 | MATCH_KW 5 "match" | 43 | MATCH_KW 5 "match" |
44 | WHITESPACE 1 " " | ||
45 | CONST_KW 5 "const" | ||
46 | WHITESPACE 1 "\n" | ||
47 | STATIC_KW 6 "static" | ||
48 | WHITESPACE 1 " " | ||
49 | MUT_KW 3 "mut" | ||
44 | WHITESPACE 1 "\n" | 50 | WHITESPACE 1 "\n" |
diff --git a/tests/data/parser/ok/0023_static_items.rs b/tests/data/parser/ok/0023_static_items.rs new file mode 100644 index 000000000..5fb92ce33 --- /dev/null +++ b/tests/data/parser/ok/0023_static_items.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | static FOO: u32 = 1; | ||
2 | static mut BAR: i32 = 92; | ||
diff --git a/tests/data/parser/ok/0023_static_items.txt b/tests/data/parser/ok/0023_static_items.txt new file mode 100644 index 000000000..7cd2228fa --- /dev/null +++ b/tests/data/parser/ok/0023_static_items.txt | |||
@@ -0,0 +1,31 @@ | |||
1 | FILE@[0; 47) | ||
2 | STATIC_ITEM@[0; 21) | ||
3 | STATIC_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | IDENT@[7; 10) "FOO" | ||
6 | COLON@[10; 11) | ||
7 | WHITESPACE@[11; 12) | ||
8 | IDENT@[12; 15) "u32" | ||
9 | WHITESPACE@[15; 16) | ||
10 | EQ@[16; 17) | ||
11 | LITERAL@[17; 19) | ||
12 | WHITESPACE@[17; 18) | ||
13 | INT_NUMBER@[18; 19) | ||
14 | SEMI@[19; 20) | ||
15 | WHITESPACE@[20; 21) | ||
16 | STATIC_ITEM@[21; 47) | ||
17 | STATIC_KW@[21; 27) | ||
18 | WHITESPACE@[27; 28) | ||
19 | MUT_KW@[28; 31) | ||
20 | WHITESPACE@[31; 32) | ||
21 | IDENT@[32; 35) "BAR" | ||
22 | COLON@[35; 36) | ||
23 | WHITESPACE@[36; 37) | ||
24 | IDENT@[37; 40) "i32" | ||
25 | WHITESPACE@[40; 41) | ||
26 | EQ@[41; 42) | ||
27 | LITERAL@[42; 45) | ||
28 | WHITESPACE@[42; 43) | ||
29 | INT_NUMBER@[43; 45) | ||
30 | SEMI@[45; 46) | ||
31 | WHITESPACE@[46; 47) | ||