diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/tools/rust-analyzer/crates/parser/test_data/lexer/ok | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
42 files changed, 674 insertions, 0 deletions
diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/block_comment.rast b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/block_comment.rast new file mode 100644 index 000000000..18bb5cad8 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/block_comment.rast @@ -0,0 +1,6 @@ +COMMENT "/* */" +WHITESPACE "\n" +COMMENT "/**/" +WHITESPACE "\n" +COMMENT "/* /* */ */" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/block_comment.rs b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/block_comment.rs new file mode 100644 index 000000000..b880a59d9 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/block_comment.rs @@ -0,0 +1,3 @@ +/* */ +/**/ +/* /* */ */ diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/block_comment.txt b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/block_comment.txt new file mode 100644 index 000000000..18bb5cad8 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/block_comment.txt @@ -0,0 +1,6 @@ +COMMENT "/* */" +WHITESPACE "\n" +COMMENT "/**/" +WHITESPACE "\n" +COMMENT "/* /* */ */" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/byte_strings.rast b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/byte_strings.rast new file mode 100644 index 000000000..c848ac368 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/byte_strings.rast @@ -0,0 +1,22 @@ +BYTE "b''" +WHITESPACE " " +BYTE "b'x'" +WHITESPACE " " +BYTE_STRING "b\"foo\"" +WHITESPACE " " +BYTE_STRING "br\"\"" +WHITESPACE "\n" +BYTE "b''suf" +WHITESPACE " " +BYTE_STRING "b\"\"ix" +WHITESPACE " " +BYTE_STRING "br\"\"br" +WHITESPACE "\n" +BYTE "b'\\n'" +WHITESPACE " " +BYTE "b'\\\\'" +WHITESPACE " " +BYTE "b'\\''" +WHITESPACE " " +BYTE "b'hello'" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/byte_strings.rs b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/byte_strings.rs new file mode 100644 index 000000000..b54930f5e --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/byte_strings.rs @@ -0,0 +1,3 @@ +b'' b'x' b"foo" br"" +b''suf b""ix br""br +b'\n' b'\\' b'\'' b'hello' diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/byte_strings.txt b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/byte_strings.txt new file mode 100644 index 000000000..c848ac368 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/byte_strings.txt @@ -0,0 +1,22 @@ +BYTE "b''" +WHITESPACE " " +BYTE "b'x'" +WHITESPACE " " +BYTE_STRING "b\"foo\"" +WHITESPACE " " +BYTE_STRING "br\"\"" +WHITESPACE "\n" +BYTE "b''suf" +WHITESPACE " " +BYTE_STRING "b\"\"ix" +WHITESPACE " " +BYTE_STRING "br\"\"br" +WHITESPACE "\n" +BYTE "b'\\n'" +WHITESPACE " " +BYTE "b'\\\\'" +WHITESPACE " " +BYTE "b'\\''" +WHITESPACE " " +BYTE "b'hello'" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/chars.rast b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/chars.rast new file mode 100644 index 000000000..66e58cc29 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/chars.rast @@ -0,0 +1,16 @@ +CHAR "'x'" +WHITESPACE " " +CHAR "' '" +WHITESPACE " " +CHAR "'0'" +WHITESPACE " " +CHAR "'hello'" +WHITESPACE " " +CHAR "'\\x7f'" +WHITESPACE " " +CHAR "'\\n'" +WHITESPACE " " +CHAR "'\\\\'" +WHITESPACE " " +CHAR "'\\''" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/chars.rs b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/chars.rs new file mode 100644 index 000000000..454ee0a5f --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/chars.rs @@ -0,0 +1 @@ +'x' ' ' '0' 'hello' '\x7f' '\n' '\\' '\'' diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/chars.txt b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/chars.txt new file mode 100644 index 000000000..66e58cc29 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/chars.txt @@ -0,0 +1,16 @@ +CHAR "'x'" +WHITESPACE " " +CHAR "' '" +WHITESPACE " " +CHAR "'0'" +WHITESPACE " " +CHAR "'hello'" +WHITESPACE " " +CHAR "'\\x7f'" +WHITESPACE " " +CHAR "'\\n'" +WHITESPACE " " +CHAR "'\\\\'" +WHITESPACE " " +CHAR "'\\''" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/hello.rast b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/hello.rast new file mode 100644 index 000000000..7f5ce9de1 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/hello.rast @@ -0,0 +1,3 @@ +IDENT "hello" +WHITESPACE " " +IDENT "world" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/hello.rs b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/hello.rs new file mode 100644 index 000000000..95d09f2b1 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/hello.rs @@ -0,0 +1 @@ +hello world
\ No newline at end of file diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/hello.txt b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/hello.txt new file mode 100644 index 000000000..7f5ce9de1 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/hello.txt @@ -0,0 +1,3 @@ +IDENT "hello" +WHITESPACE " " +IDENT "world" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/ident.rast b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/ident.rast new file mode 100644 index 000000000..5689644c0 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/ident.rast @@ -0,0 +1,14 @@ +IDENT "foo" +WHITESPACE " " +IDENT "foo_" +WHITESPACE " " +IDENT "_foo" +WHITESPACE " " +UNDERSCORE "_" +WHITESPACE " " +IDENT "__" +WHITESPACE " " +IDENT "x" +WHITESPACE " " +IDENT "привет" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/ident.rs b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/ident.rs new file mode 100644 index 000000000..c05c9c009 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/ident.rs @@ -0,0 +1 @@ +foo foo_ _foo _ __ x привет diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/ident.txt b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/ident.txt new file mode 100644 index 000000000..5689644c0 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/ident.txt @@ -0,0 +1,14 @@ +IDENT "foo" +WHITESPACE " " +IDENT "foo_" +WHITESPACE " " +IDENT "_foo" +WHITESPACE " " +UNDERSCORE "_" +WHITESPACE " " +IDENT "__" +WHITESPACE " " +IDENT "x" +WHITESPACE " " +IDENT "привет" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/keywords.rast b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/keywords.rast new file mode 100644 index 000000000..e19b1399a --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/keywords.rast @@ -0,0 +1,64 @@ +ASYNC_KW "async" +WHITESPACE " " +FN_KW "fn" +WHITESPACE " " +USE_KW "use" +WHITESPACE " " +STRUCT_KW "struct" +WHITESPACE " " +TRAIT_KW "trait" +WHITESPACE " " +ENUM_KW "enum" +WHITESPACE " " +IMPL_KW "impl" +WHITESPACE " " +TRUE_KW "true" +WHITESPACE " " +FALSE_KW "false" +WHITESPACE " " +AS_KW "as" +WHITESPACE " " +EXTERN_KW "extern" +WHITESPACE " " +CRATE_KW "crate" +WHITESPACE "\n" +MOD_KW "mod" +WHITESPACE " " +PUB_KW "pub" +WHITESPACE " " +SELF_KW "self" +WHITESPACE " " +SUPER_KW "super" +WHITESPACE " " +IN_KW "in" +WHITESPACE " " +WHERE_KW "where" +WHITESPACE " " +FOR_KW "for" +WHITESPACE " " +LOOP_KW "loop" +WHITESPACE " " +WHILE_KW "while" +WHITESPACE " " +IF_KW "if" +WHITESPACE " " +MATCH_KW "match" +WHITESPACE " " +CONST_KW "const" +WHITESPACE "\n" +STATIC_KW "static" +WHITESPACE " " +MUT_KW "mut" +WHITESPACE " " +TYPE_KW "type" +WHITESPACE " " +REF_KW "ref" +WHITESPACE " " +LET_KW "let" +WHITESPACE " " +ELSE_KW "else" +WHITESPACE " " +MOVE_KW "move" +WHITESPACE " " +RETURN_KW "return" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/keywords.rs b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/keywords.rs new file mode 100644 index 000000000..1e91bff4e --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/keywords.rs @@ -0,0 +1,3 @@ +async fn use struct trait enum impl true false as extern crate +mod pub self super in where for loop while if match const +static mut type ref let else move return diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/keywords.txt b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/keywords.txt new file mode 100644 index 000000000..e19b1399a --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/keywords.txt @@ -0,0 +1,64 @@ +ASYNC_KW "async" +WHITESPACE " " +FN_KW "fn" +WHITESPACE " " +USE_KW "use" +WHITESPACE " " +STRUCT_KW "struct" +WHITESPACE " " +TRAIT_KW "trait" +WHITESPACE " " +ENUM_KW "enum" +WHITESPACE " " +IMPL_KW "impl" +WHITESPACE " " +TRUE_KW "true" +WHITESPACE " " +FALSE_KW "false" +WHITESPACE " " +AS_KW "as" +WHITESPACE " " +EXTERN_KW "extern" +WHITESPACE " " +CRATE_KW "crate" +WHITESPACE "\n" +MOD_KW "mod" +WHITESPACE " " +PUB_KW "pub" +WHITESPACE " " +SELF_KW "self" +WHITESPACE " " +SUPER_KW "super" +WHITESPACE " " +IN_KW "in" +WHITESPACE " " +WHERE_KW "where" +WHITESPACE " " +FOR_KW "for" +WHITESPACE " " +LOOP_KW "loop" +WHITESPACE " " +WHILE_KW "while" +WHITESPACE " " +IF_KW "if" +WHITESPACE " " +MATCH_KW "match" +WHITESPACE " " +CONST_KW "const" +WHITESPACE "\n" +STATIC_KW "static" +WHITESPACE " " +MUT_KW "mut" +WHITESPACE " " +TYPE_KW "type" +WHITESPACE " " +REF_KW "ref" +WHITESPACE " " +LET_KW "let" +WHITESPACE " " +ELSE_KW "else" +WHITESPACE " " +MOVE_KW "move" +WHITESPACE " " +RETURN_KW "return" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/lifetimes.rast b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/lifetimes.rast new file mode 100644 index 000000000..eeb1e9541 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/lifetimes.rast @@ -0,0 +1,8 @@ +LIFETIME_IDENT "'a" +WHITESPACE " " +LIFETIME_IDENT "'foo" +WHITESPACE " " +LIFETIME_IDENT "'foo_bar_baz" +WHITESPACE " " +LIFETIME_IDENT "'_" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/lifetimes.rs b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/lifetimes.rs new file mode 100644 index 000000000..b764f1dce --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/lifetimes.rs @@ -0,0 +1 @@ +'a 'foo 'foo_bar_baz '_ diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/lifetimes.txt b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/lifetimes.txt new file mode 100644 index 000000000..eeb1e9541 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/lifetimes.txt @@ -0,0 +1,8 @@ +LIFETIME_IDENT "'a" +WHITESPACE " " +LIFETIME_IDENT "'foo" +WHITESPACE " " +LIFETIME_IDENT "'foo_bar_baz" +WHITESPACE " " +LIFETIME_IDENT "'_" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/numbers.rast b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/numbers.rast new file mode 100644 index 000000000..8d13c3f61 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/numbers.rast @@ -0,0 +1,57 @@ +INT_NUMBER "0" +WHITESPACE " " +INT_NUMBER "00" +WHITESPACE " " +INT_NUMBER "0_" +WHITESPACE " " +FLOAT_NUMBER "0." +WHITESPACE " " +INT_NUMBER "0z" +WHITESPACE "\n" +INT_NUMBER "01790" +WHITESPACE " " +INT_NUMBER "0b1790" +WHITESPACE " " +INT_NUMBER "0o1790" +WHITESPACE " " +INT_NUMBER "0x1790aAbBcCdDeEfF" +WHITESPACE " " +INT_NUMBER "001279" +WHITESPACE " " +INT_NUMBER "0_1279" +WHITESPACE " " +FLOAT_NUMBER "0.1279" +WHITESPACE " " +FLOAT_NUMBER "0e1279" +WHITESPACE " " +FLOAT_NUMBER "0E1279" +WHITESPACE "\n" +INT_NUMBER "0" +DOT "." +DOT "." +INT_NUMBER "2" +WHITESPACE "\n" +INT_NUMBER "0" +DOT "." +IDENT "foo" +L_PAREN "(" +R_PAREN ")" +WHITESPACE "\n" +FLOAT_NUMBER "0e+1" +WHITESPACE "\n" +INT_NUMBER "0" +DOT "." +IDENT "e" +PLUS "+" +INT_NUMBER "1" +WHITESPACE "\n" +FLOAT_NUMBER "0.0E-2" +WHITESPACE "\n" +FLOAT_NUMBER "0___0.10000____0000e+111__" +WHITESPACE "\n" +INT_NUMBER "1i64" +WHITESPACE " " +FLOAT_NUMBER "92.0f32" +WHITESPACE " " +INT_NUMBER "11__s" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/numbers.rs b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/numbers.rs new file mode 100644 index 000000000..bc761c235 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/numbers.rs @@ -0,0 +1,9 @@ +0 00 0_ 0. 0z +01790 0b1790 0o1790 0x1790aAbBcCdDeEfF 001279 0_1279 0.1279 0e1279 0E1279 +0..2 +0.foo() +0e+1 +0.e+1 +0.0E-2 +0___0.10000____0000e+111__ +1i64 92.0f32 11__s diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/numbers.txt b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/numbers.txt new file mode 100644 index 000000000..8d13c3f61 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/numbers.txt @@ -0,0 +1,57 @@ +INT_NUMBER "0" +WHITESPACE " " +INT_NUMBER "00" +WHITESPACE " " +INT_NUMBER "0_" +WHITESPACE " " +FLOAT_NUMBER "0." +WHITESPACE " " +INT_NUMBER "0z" +WHITESPACE "\n" +INT_NUMBER "01790" +WHITESPACE " " +INT_NUMBER "0b1790" +WHITESPACE " " +INT_NUMBER "0o1790" +WHITESPACE " " +INT_NUMBER "0x1790aAbBcCdDeEfF" +WHITESPACE " " +INT_NUMBER "001279" +WHITESPACE " " +INT_NUMBER "0_1279" +WHITESPACE " " +FLOAT_NUMBER "0.1279" +WHITESPACE " " +FLOAT_NUMBER "0e1279" +WHITESPACE " " +FLOAT_NUMBER "0E1279" +WHITESPACE "\n" +INT_NUMBER "0" +DOT "." +DOT "." +INT_NUMBER "2" +WHITESPACE "\n" +INT_NUMBER "0" +DOT "." +IDENT "foo" +L_PAREN "(" +R_PAREN ")" +WHITESPACE "\n" +FLOAT_NUMBER "0e+1" +WHITESPACE "\n" +INT_NUMBER "0" +DOT "." +IDENT "e" +PLUS "+" +INT_NUMBER "1" +WHITESPACE "\n" +FLOAT_NUMBER "0.0E-2" +WHITESPACE "\n" +FLOAT_NUMBER "0___0.10000____0000e+111__" +WHITESPACE "\n" +INT_NUMBER "1i64" +WHITESPACE " " +FLOAT_NUMBER "92.0f32" +WHITESPACE " " +INT_NUMBER "11__s" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_ident.rast b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_ident.rast new file mode 100644 index 000000000..fddad9982 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_ident.rast @@ -0,0 +1,2 @@ +IDENT "r#raw_ident" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_ident.rs b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_ident.rs new file mode 100644 index 000000000..b40a1b6a2 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_ident.rs @@ -0,0 +1 @@ +r#raw_ident diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_ident.txt b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_ident.txt new file mode 100644 index 000000000..fddad9982 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_ident.txt @@ -0,0 +1,2 @@ +IDENT "r#raw_ident" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_strings.rast b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_strings.rast new file mode 100644 index 000000000..13cf733b7 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_strings.rast @@ -0,0 +1,2 @@ +STRING "r###\"this is a r##\"raw\"## string\"###" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_strings.rs b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_strings.rs new file mode 100644 index 000000000..e5ed0b693 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_strings.rs @@ -0,0 +1 @@ +r###"this is a r##"raw"## string"### diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_strings.txt b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_strings.txt new file mode 100644 index 000000000..13cf733b7 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/raw_strings.txt @@ -0,0 +1,2 @@ +STRING "r###\"this is a r##\"raw\"## string\"###" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/single_line_comments.rast b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/single_line_comments.rast new file mode 100644 index 000000000..a7681e9f5 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/single_line_comments.rast @@ -0,0 +1,22 @@ +SHEBANG "#!/usr/bin/env bash" +WHITESPACE "\n" +COMMENT "// hello" +WHITESPACE "\n" +COMMENT "//! World" +WHITESPACE "\n" +COMMENT "//!! Inner line doc" +WHITESPACE "\n" +COMMENT "/// Outer line doc" +WHITESPACE "\n" +COMMENT "//// Just a comment" +WHITESPACE "\n\n" +COMMENT "//" +WHITESPACE "\n" +COMMENT "//!" +WHITESPACE "\n" +COMMENT "//!!" +WHITESPACE "\n" +COMMENT "///" +WHITESPACE "\n" +COMMENT "////" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/single_line_comments.rs b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/single_line_comments.rs new file mode 100644 index 000000000..4b6653f9c --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/single_line_comments.rs @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +// hello +//! World +//!! Inner line doc +/// Outer line doc +//// Just a comment + +// +//! +//!! +/// +//// diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/single_line_comments.txt b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/single_line_comments.txt new file mode 100644 index 000000000..a7681e9f5 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/single_line_comments.txt @@ -0,0 +1,22 @@ +SHEBANG "#!/usr/bin/env bash" +WHITESPACE "\n" +COMMENT "// hello" +WHITESPACE "\n" +COMMENT "//! World" +WHITESPACE "\n" +COMMENT "//!! Inner line doc" +WHITESPACE "\n" +COMMENT "/// Outer line doc" +WHITESPACE "\n" +COMMENT "//// Just a comment" +WHITESPACE "\n\n" +COMMENT "//" +WHITESPACE "\n" +COMMENT "//!" +WHITESPACE "\n" +COMMENT "//!!" +WHITESPACE "\n" +COMMENT "///" +WHITESPACE "\n" +COMMENT "////" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/strings.rast b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/strings.rast new file mode 100644 index 000000000..ec222591b --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/strings.rast @@ -0,0 +1,8 @@ +STRING "\"hello\"" +WHITESPACE " " +STRING "r\"world\"" +WHITESPACE " " +STRING "\"\\n\\\"\\\\no escape\"" +WHITESPACE " " +STRING "\"multi\nline\"" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/strings.rs b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/strings.rs new file mode 100644 index 000000000..4ddb5bffc --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/strings.rs @@ -0,0 +1,2 @@ +"hello" r"world" "\n\"\\no escape" "multi +line" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/strings.txt b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/strings.txt new file mode 100644 index 000000000..ec222591b --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/strings.txt @@ -0,0 +1,8 @@ +STRING "\"hello\"" +WHITESPACE " " +STRING "r\"world\"" +WHITESPACE " " +STRING "\"\\n\\\"\\\\no escape\"" +WHITESPACE " " +STRING "\"multi\nline\"" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/symbols.rast b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/symbols.rast new file mode 100644 index 000000000..533ccff9a --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/symbols.rast @@ -0,0 +1,77 @@ +SEMICOLON ";" +WHITESPACE " " +COMMA "," +WHITESPACE " " +L_PAREN "(" +WHITESPACE " " +R_PAREN ")" +WHITESPACE " " +L_CURLY "{" +WHITESPACE " " +R_CURLY "}" +WHITESPACE " " +L_BRACK "[" +WHITESPACE " " +R_BRACK "]" +WHITESPACE " " +L_ANGLE "<" +WHITESPACE " " +R_ANGLE ">" +WHITESPACE " " +AT "@" +WHITESPACE " " +POUND "#" +WHITESPACE " " +TILDE "~" +WHITESPACE " " +QUESTION "?" +WHITESPACE " " +DOLLAR "$" +WHITESPACE " " +AMP "&" +WHITESPACE " " +PIPE "|" +WHITESPACE " " +PLUS "+" +WHITESPACE " " +STAR "*" +WHITESPACE " " +SLASH "/" +WHITESPACE " " +CARET "^" +WHITESPACE " " +PERCENT "%" +WHITESPACE "\n" +DOT "." +WHITESPACE " " +DOT "." +DOT "." +WHITESPACE " " +DOT "." +DOT "." +DOT "." +WHITESPACE " " +DOT "." +DOT "." +EQ "=" +WHITESPACE "\n" +COLON ":" +WHITESPACE " " +COLON ":" +COLON ":" +WHITESPACE "\n" +EQ "=" +WHITESPACE " " +EQ "=" +R_ANGLE ">" +WHITESPACE "\n" +BANG "!" +WHITESPACE " " +BANG "!" +EQ "=" +WHITESPACE "\n" +MINUS "-" +WHITESPACE " " +MINUS "-" +R_ANGLE ">" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/symbols.rs b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/symbols.rs new file mode 100644 index 000000000..487569b5a --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/symbols.rs @@ -0,0 +1,6 @@ +; , ( ) { } [ ] < > @ # ~ ? $ & | + * / ^ % +. .. ... ..= +: :: += => +! != +- -> diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/symbols.txt b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/symbols.txt new file mode 100644 index 000000000..533ccff9a --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/symbols.txt @@ -0,0 +1,77 @@ +SEMICOLON ";" +WHITESPACE " " +COMMA "," +WHITESPACE " " +L_PAREN "(" +WHITESPACE " " +R_PAREN ")" +WHITESPACE " " +L_CURLY "{" +WHITESPACE " " +R_CURLY "}" +WHITESPACE " " +L_BRACK "[" +WHITESPACE " " +R_BRACK "]" +WHITESPACE " " +L_ANGLE "<" +WHITESPACE " " +R_ANGLE ">" +WHITESPACE " " +AT "@" +WHITESPACE " " +POUND "#" +WHITESPACE " " +TILDE "~" +WHITESPACE " " +QUESTION "?" +WHITESPACE " " +DOLLAR "$" +WHITESPACE " " +AMP "&" +WHITESPACE " " +PIPE "|" +WHITESPACE " " +PLUS "+" +WHITESPACE " " +STAR "*" +WHITESPACE " " +SLASH "/" +WHITESPACE " " +CARET "^" +WHITESPACE " " +PERCENT "%" +WHITESPACE "\n" +DOT "." +WHITESPACE " " +DOT "." +DOT "." +WHITESPACE " " +DOT "." +DOT "." +DOT "." +WHITESPACE " " +DOT "." +DOT "." +EQ "=" +WHITESPACE "\n" +COLON ":" +WHITESPACE " " +COLON ":" +COLON ":" +WHITESPACE "\n" +EQ "=" +WHITESPACE " " +EQ "=" +R_ANGLE ">" +WHITESPACE "\n" +BANG "!" +WHITESPACE " " +BANG "!" +EQ "=" +WHITESPACE "\n" +MINUS "-" +WHITESPACE " " +MINUS "-" +R_ANGLE ">" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/whitespace.rast b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/whitespace.rast new file mode 100644 index 000000000..8ccb79e4e --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/whitespace.rast @@ -0,0 +1,12 @@ +IDENT "a" +WHITESPACE " " +IDENT "b" +WHITESPACE " " +IDENT "c" +WHITESPACE "\n" +IDENT "d" +WHITESPACE "\n\n" +IDENT "e" +WHITESPACE "\t" +IDENT "f" +WHITESPACE "\n" diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/whitespace.rs b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/whitespace.rs new file mode 100644 index 000000000..08fce1418 --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/whitespace.rs @@ -0,0 +1,4 @@ +a b c +d + +e f diff --git a/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/whitespace.txt b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/whitespace.txt new file mode 100644 index 000000000..8ccb79e4e --- /dev/null +++ b/src/tools/rust-analyzer/crates/parser/test_data/lexer/ok/whitespace.txt @@ -0,0 +1,12 @@ +IDENT "a" +WHITESPACE " " +IDENT "b" +WHITESPACE " " +IDENT "c" +WHITESPACE "\n" +IDENT "d" +WHITESPACE "\n\n" +IDENT "e" +WHITESPACE "\t" +IDENT "f" +WHITESPACE "\n" |