From 555c4ae37560493fd901aad41951ad1664043459 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 11 Feb 2018 11:37:08 +0300 Subject: G: slice & array types --- .../parser/inline/0023_array_type_missing_semi.rs | 1 + .../parser/inline/0023_array_type_missing_semi.txt | 28 ++++++++++++++++++++++ tests/data/parser/inline/0024_array_type.rs | 1 + tests/data/parser/inline/0024_array_type.txt | 21 ++++++++++++++++ tests/data/parser/inline/0025_slice_type.rs | 1 + tests/data/parser/inline/0025_slice_type.txt | 17 +++++++++++++ 6 files changed, 69 insertions(+) create mode 100644 tests/data/parser/inline/0023_array_type_missing_semi.rs create mode 100644 tests/data/parser/inline/0023_array_type_missing_semi.txt create mode 100644 tests/data/parser/inline/0024_array_type.rs create mode 100644 tests/data/parser/inline/0024_array_type.txt create mode 100644 tests/data/parser/inline/0025_slice_type.rs create mode 100644 tests/data/parser/inline/0025_slice_type.txt (limited to 'tests/data/parser') 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 @@ +FILE@[0; 18) + TYPE_ITEM@[0; 13) + TYPE_KW@[0; 4) + NAME@[4; 7) + WHITESPACE@[4; 5) + IDENT@[5; 6) "T" + WHITESPACE@[6; 7) + EQ@[7; 8) + SLICE_TYPE@[8; 13) + WHITESPACE@[8; 9) + L_BRACK@[9; 10) + TUPLE_TYPE@[10; 13) + L_PAREN@[10; 11) + R_PAREN@[11; 12) + WHITESPACE@[12; 13) + err: `expected `;` or `]`` + err: `expected SEMI` + ERROR@[13; 15) + err: `expected item` + INT_NUMBER@[13; 15) + ERROR@[15; 16) + err: `expected item` + R_BRACK@[15; 16) + ERROR@[16; 18) + err: `expected item, found `;` +consider removing this semicolon` + SEMI@[16; 17) + 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 @@ +FILE@[0; 19) + TYPE_ITEM@[0; 19) + TYPE_KW@[0; 4) + NAME@[4; 7) + WHITESPACE@[4; 5) + IDENT@[5; 6) "T" + WHITESPACE@[6; 7) + EQ@[7; 8) + ARRAY_TYPE@[8; 17) + WHITESPACE@[8; 9) + L_BRACK@[9; 10) + TUPLE_TYPE@[10; 12) + L_PAREN@[10; 11) + R_PAREN@[11; 12) + SEMI@[12; 13) + LITERAL@[13; 16) + WHITESPACE@[13; 14) + INT_NUMBER@[14; 16) + R_BRACK@[16; 17) + SEMI@[17; 18) + 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 @@ +FILE@[0; 15) + TYPE_ITEM@[0; 15) + TYPE_KW@[0; 4) + NAME@[4; 7) + WHITESPACE@[4; 5) + IDENT@[5; 6) "T" + WHITESPACE@[6; 7) + EQ@[7; 8) + SLICE_TYPE@[8; 13) + WHITESPACE@[8; 9) + L_BRACK@[9; 10) + TUPLE_TYPE@[10; 12) + L_PAREN@[10; 11) + R_PAREN@[11; 12) + R_BRACK@[12; 13) + SEMI@[13; 14) + WHITESPACE@[14; 15) -- cgit v1.2.3