From 7f8ca07d864b5ec8e668c48c4c029dd0584eae4a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 9 Jan 2018 00:06:42 +0300 Subject: G: extern crate --- tests/data/lexer/0011_keywords.rs | 2 +- tests/data/lexer/0011_keywords.txt | 6 ++++++ tests/data/parser/ok/0007_extern_crate.rs | 2 ++ tests/data/parser/ok/0007_extern_crate.txt | 22 ++++++++++++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 tests/data/parser/ok/0007_extern_crate.rs create mode 100644 tests/data/parser/ok/0007_extern_crate.txt (limited to 'tests') diff --git a/tests/data/lexer/0011_keywords.rs b/tests/data/lexer/0011_keywords.rs index 1f4a4a74c..4adb1587e 100644 --- a/tests/data/lexer/0011_keywords.rs +++ b/tests/data/lexer/0011_keywords.rs @@ -1 +1 @@ -fn use struct trait enum impl true false +fn use struct trait enum impl true false as extern crate diff --git a/tests/data/lexer/0011_keywords.txt b/tests/data/lexer/0011_keywords.txt index eded37084..bf8ceffd4 100644 --- a/tests/data/lexer/0011_keywords.txt +++ b/tests/data/lexer/0011_keywords.txt @@ -13,4 +13,10 @@ WHITESPACE 1 " " TRUE_KW 4 "true" WHITESPACE 1 " " FALSE_KW 5 "false" +WHITESPACE 1 " " +AS_KW 2 "as" +WHITESPACE 1 " " +EXTERN_KW 6 "extern" +WHITESPACE 1 " " +CRATE_KW 5 "crate" WHITESPACE 1 "\n" diff --git a/tests/data/parser/ok/0007_extern_crate.rs b/tests/data/parser/ok/0007_extern_crate.rs new file mode 100644 index 000000000..3ce336676 --- /dev/null +++ b/tests/data/parser/ok/0007_extern_crate.rs @@ -0,0 +1,2 @@ +extern crate foo; +extern crate foo as bar; diff --git a/tests/data/parser/ok/0007_extern_crate.txt b/tests/data/parser/ok/0007_extern_crate.txt new file mode 100644 index 000000000..902c80f7d --- /dev/null +++ b/tests/data/parser/ok/0007_extern_crate.txt @@ -0,0 +1,22 @@ +FILE@[0; 43) + EXTERN_CRATE_ITEM@[0; 18) + EXTERN_KW@[0; 6) + WHITESPACE@[6; 7) + CRATE_KW@[7; 12) + WHITESPACE@[12; 13) + IDENT@[13; 16) + SEMI@[16; 17) + WHITESPACE@[17; 18) + EXTERN_CRATE_ITEM@[18; 43) + EXTERN_KW@[18; 24) + WHITESPACE@[24; 25) + CRATE_KW@[25; 30) + WHITESPACE@[30; 31) + IDENT@[31; 34) + ALIAS@[34; 41) + WHITESPACE@[34; 35) + AS_KW@[35; 37) + WHITESPACE@[37; 38) + IDENT@[38; 41) + SEMI@[41; 42) + WHITESPACE@[42; 43) -- cgit v1.2.3