aboutsummaryrefslogtreecommitdiff
path: root/tests/data/parser
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-02-11 08:37:08 +0000
committerAleksey Kladov <[email protected]>2018-02-11 08:37:08 +0000
commit555c4ae37560493fd901aad41951ad1664043459 (patch)
tree89a260412886182f2a4f571694cfbff734f1dc3d /tests/data/parser
parentceb94ece2aa6a1b54063c582663fff4c1937d989 (diff)
G: slice & array types
Diffstat (limited to 'tests/data/parser')
-rw-r--r--tests/data/parser/inline/0023_array_type_missing_semi.rs1
-rw-r--r--tests/data/parser/inline/0023_array_type_missing_semi.txt28
-rw-r--r--tests/data/parser/inline/0024_array_type.rs1
-rw-r--r--tests/data/parser/inline/0024_array_type.txt21
-rw-r--r--tests/data/parser/inline/0025_slice_type.rs1
-rw-r--r--tests/data/parser/inline/0025_slice_type.txt17
6 files changed, 69 insertions, 0 deletions
diff --git a/tests/data/parser/inline/0023_array_type_missing_semi.rs b/tests/data/parser/inline/0023_array_type_missing_semi.rs
new file mode 100644
index 000000000..a94851443
--- /dev/null
+++ b/tests/data/parser/inline/0023_array_type_missing_semi.rs
@@ -0,0 +1 @@
type T = [() 92];
diff --git a/tests/data/parser/inline/0023_array_type_missing_semi.txt b/tests/data/parser/inline/0023_array_type_missing_semi.txt
new file mode 100644
index 000000000..bb30a2a2a
--- /dev/null
+++ b/tests/data/parser/inline/0023_array_type_missing_semi.txt
@@ -0,0 +1,28 @@
1FILE@[0; 18)
2 TYPE_ITEM@[0; 13)
3 TYPE_KW@[0; 4)
4 NAME@[4; 7)
5 WHITESPACE@[4; 5)
6 IDENT@[5; 6) "T"
7 WHITESPACE@[6; 7)
8 EQ@[7; 8)
9 SLICE_TYPE@[8; 13)
10 WHITESPACE@[8; 9)
11 L_BRACK@[9; 10)
12 TUPLE_TYPE@[10; 13)
13 L_PAREN@[10; 11)
14 R_PAREN@[11; 12)
15 WHITESPACE@[12; 13)
16 err: `expected `;` or `]``
17 err: `expected SEMI`
18 ERROR@[13; 15)
19 err: `expected item`
20 INT_NUMBER@[13; 15)
21 ERROR@[15; 16)
22 err: `expected item`
23 R_BRACK@[15; 16)
24 ERROR@[16; 18)
25 err: `expected item, found `;`
26consider removing this semicolon`
27 SEMI@[16; 17)
28 WHITESPACE@[17; 18)
diff --git a/tests/data/parser/inline/0024_array_type.rs b/tests/data/parser/inline/0024_array_type.rs
new file mode 100644
index 000000000..27eb22f22
--- /dev/null
+++ b/tests/data/parser/inline/0024_array_type.rs
@@ -0,0 +1 @@
type T = [(); 92];
diff --git a/tests/data/parser/inline/0024_array_type.txt b/tests/data/parser/inline/0024_array_type.txt
new file mode 100644
index 000000000..970734a19
--- /dev/null
+++ b/tests/data/parser/inline/0024_array_type.txt
@@ -0,0 +1,21 @@
1FILE@[0; 19)
2 TYPE_ITEM@[0; 19)
3 TYPE_KW@[0; 4)
4 NAME@[4; 7)
5 WHITESPACE@[4; 5)
6 IDENT@[5; 6) "T"
7 WHITESPACE@[6; 7)
8 EQ@[7; 8)
9 ARRAY_TYPE@[8; 17)
10 WHITESPACE@[8; 9)
11 L_BRACK@[9; 10)
12 TUPLE_TYPE@[10; 12)
13 L_PAREN@[10; 11)
14 R_PAREN@[11; 12)
15 SEMI@[12; 13)
16 LITERAL@[13; 16)
17 WHITESPACE@[13; 14)
18 INT_NUMBER@[14; 16)
19 R_BRACK@[16; 17)
20 SEMI@[17; 18)
21 WHITESPACE@[18; 19)
diff --git a/tests/data/parser/inline/0025_slice_type.rs b/tests/data/parser/inline/0025_slice_type.rs
new file mode 100644
index 000000000..4da1af827
--- /dev/null
+++ b/tests/data/parser/inline/0025_slice_type.rs
@@ -0,0 +1 @@
type T = [()];
diff --git a/tests/data/parser/inline/0025_slice_type.txt b/tests/data/parser/inline/0025_slice_type.txt
new file mode 100644
index 000000000..22938e5e1
--- /dev/null
+++ b/tests/data/parser/inline/0025_slice_type.txt
@@ -0,0 +1,17 @@
1FILE@[0; 15)
2 TYPE_ITEM@[0; 15)
3 TYPE_KW@[0; 4)
4 NAME@[4; 7)
5 WHITESPACE@[4; 5)
6 IDENT@[5; 6) "T"
7 WHITESPACE@[6; 7)
8 EQ@[7; 8)
9 SLICE_TYPE@[8; 13)
10 WHITESPACE@[8; 9)
11 L_BRACK@[9; 10)
12 TUPLE_TYPE@[10; 12)
13 L_PAREN@[10; 11)
14 R_PAREN@[11; 12)
15 R_BRACK@[12; 13)
16 SEMI@[13; 14)
17 WHITESPACE@[14; 15)