From 049c9b60fb0c59625a37b0349aa27acaa3cf884a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 2 Feb 2018 23:30:17 +0300 Subject: L: const & static keywords --- tests/data/lexer/0011_keywords.rs | 3 ++- tests/data/lexer/0011_keywords.txt | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/data/lexer/0011_keywords.rs b/tests/data/lexer/0011_keywords.rs index 02ca19089..7a1000bb7 100644 --- a/tests/data/lexer/0011_keywords.rs +++ b/tests/data/lexer/0011_keywords.rs @@ -1 +1,2 @@ -fn use struct trait enum impl true false as extern crate mod pub self super in where for loop while if match +fn use struct trait enum impl true false as extern crate +mod pub self super in where for loop while if match const static diff --git a/tests/data/lexer/0011_keywords.txt b/tests/data/lexer/0011_keywords.txt index 964e3475a..b38b4bd64 100644 --- a/tests/data/lexer/0011_keywords.txt +++ b/tests/data/lexer/0011_keywords.txt @@ -19,7 +19,7 @@ WHITESPACE 1 " " EXTERN_KW 6 "extern" WHITESPACE 1 " " CRATE_KW 5 "crate" -WHITESPACE 1 " " +WHITESPACE 1 "\n" MOD_KW 3 "mod" WHITESPACE 1 " " PUB_KW 3 "pub" @@ -41,4 +41,8 @@ WHITESPACE 1 " " IF_KW 2 "if" WHITESPACE 1 " " MATCH_KW 5 "match" +WHITESPACE 1 " " +CONST_KW 5 "const" +WHITESPACE 1 " " +STATIC_KW 6 "static" WHITESPACE 1 "\n" -- cgit v1.2.3 From 0000f4f4f2f32c6ff67db6cbc27e3a49c85f4b99 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 2 Feb 2018 23:45:15 +0300 Subject: G: static items --- tests/data/lexer/0011_keywords.rs | 3 ++- tests/data/lexer/0011_keywords.txt | 4 +++- tests/data/parser/ok/0023_static_items.rs | 2 ++ tests/data/parser/ok/0023_static_items.txt | 31 ++++++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 tests/data/parser/ok/0023_static_items.rs create mode 100644 tests/data/parser/ok/0023_static_items.txt (limited to 'tests') diff --git a/tests/data/lexer/0011_keywords.rs b/tests/data/lexer/0011_keywords.rs index 7a1000bb7..b74fc606e 100644 --- a/tests/data/lexer/0011_keywords.rs +++ b/tests/data/lexer/0011_keywords.rs @@ -1,2 +1,3 @@ fn use struct trait enum impl true false as extern crate -mod pub self super in where for loop while if match const static +mod pub self super in where for loop while if match const +static mut diff --git a/tests/data/lexer/0011_keywords.txt b/tests/data/lexer/0011_keywords.txt index b38b4bd64..05b1f0995 100644 --- a/tests/data/lexer/0011_keywords.txt +++ b/tests/data/lexer/0011_keywords.txt @@ -43,6 +43,8 @@ WHITESPACE 1 " " MATCH_KW 5 "match" WHITESPACE 1 " " CONST_KW 5 "const" -WHITESPACE 1 " " +WHITESPACE 1 "\n" STATIC_KW 6 "static" +WHITESPACE 1 " " +MUT_KW 3 "mut" 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 @@ +static FOO: u32 = 1; +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 @@ +FILE@[0; 47) + STATIC_ITEM@[0; 21) + STATIC_KW@[0; 6) + WHITESPACE@[6; 7) + IDENT@[7; 10) "FOO" + COLON@[10; 11) + WHITESPACE@[11; 12) + IDENT@[12; 15) "u32" + WHITESPACE@[15; 16) + EQ@[16; 17) + LITERAL@[17; 19) + WHITESPACE@[17; 18) + INT_NUMBER@[18; 19) + SEMI@[19; 20) + WHITESPACE@[20; 21) + STATIC_ITEM@[21; 47) + STATIC_KW@[21; 27) + WHITESPACE@[27; 28) + MUT_KW@[28; 31) + WHITESPACE@[31; 32) + IDENT@[32; 35) "BAR" + COLON@[35; 36) + WHITESPACE@[36; 37) + IDENT@[37; 40) "i32" + WHITESPACE@[40; 41) + EQ@[41; 42) + LITERAL@[42; 45) + WHITESPACE@[42; 43) + INT_NUMBER@[43; 45) + SEMI@[45; 46) + WHITESPACE@[46; 47) -- cgit v1.2.3