diff --git a/Cargo.lock b/Cargo.lock index 67d1bc8d2b..1dcbc14f01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1082,6 +1082,7 @@ dependencies = [ "expect-test", "limit", "rustc-ap-rustc_lexer", + "sourcegen", ] [[package]] diff --git a/crates/parser/Cargo.toml b/crates/parser/Cargo.toml index f8477e751d..0a5f923305 100644 --- a/crates/parser/Cargo.toml +++ b/crates/parser/Cargo.toml @@ -16,3 +16,5 @@ limit = { path = "../limit", version = "0.0.0" } [dev-dependencies] expect-test = "1.2" +sourcegen = { path = "../sourcegen" } + diff --git a/crates/parser/src/grammar/expressions.rs b/crates/parser/src/grammar/expressions.rs index 4b9c579a05..64057a4a67 100644 --- a/crates/parser/src/grammar/expressions.rs +++ b/crates/parser/src/grammar/expressions.rs @@ -463,13 +463,6 @@ fn method_call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { // x.0.bar; // x.0(); // } - -// test_err bad_tuple_index_expr -// fn foo() { -// x.0.; -// x.1i32; -// x.0x01; -// } fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { assert!(p.at(T![.])); let m = lhs.precede(p); diff --git a/crates/parser/src/tests.rs b/crates/parser/src/tests.rs index ebba992561..7a6230eaf8 100644 --- a/crates/parser/src/tests.rs +++ b/crates/parser/src/tests.rs @@ -1,3 +1,5 @@ +mod sourcegen_inline_tests; + use std::{ fmt::Write, fs, @@ -9,7 +11,7 @@ use expect_test::expect_file; use crate::LexedStr; #[test] -fn valid_lexes_input() { +fn lex_ok() { for case in TestCase::list("lexer/ok") { let actual = lex(&case.text); expect_file![case.txt].assert_eq(&actual) @@ -17,7 +19,7 @@ fn valid_lexes_input() { } #[test] -fn invalid_lexes_input() { +fn lex_err() { for case in TestCase::list("lexer/err") { let actual = lex(&case.text); expect_file![case.txt].assert_eq(&actual) @@ -39,6 +41,79 @@ fn lex(text: &str) -> String { res } +#[test] +fn parse_ok() { + for case in TestCase::list("parser/ok") { + let (actual, errors) = parse(&case.text); + assert!(!errors, "errors in an OK file {}:\n{}", case.rs.display(), actual); + expect_file![case.txt].assert_eq(&actual); + } +} + +#[test] +fn parse_inline_ok() { + for case in TestCase::list("parser/inline/ok") { + let (actual, errors) = parse(&case.text); + assert!(!errors, "errors in an OK file {}:\n{}", case.rs.display(), actual); + expect_file![case.txt].assert_eq(&actual); + } +} + +#[test] +fn parse_err() { + for case in TestCase::list("parser/err") { + let (actual, errors) = parse(&case.text); + assert!(errors, "no errors in an ERR file {}:\n{}", case.rs.display(), actual); + expect_file![case.txt].assert_eq(&actual) + } +} + +#[test] +fn parse_inline_err() { + for case in TestCase::list("parser/inline/err") { + let (actual, errors) = parse(&case.text); + assert!(errors, "no errors in an ERR file {}:\n{}", case.rs.display(), actual); + expect_file![case.txt].assert_eq(&actual) + } +} + +fn parse(text: &str) -> (String, bool) { + let lexed = LexedStr::new(text); + let input = lexed.to_input(); + let output = crate::parse_source_file(&input); + + let mut buf = String::new(); + let mut errors = Vec::new(); + let mut indent = String::new(); + lexed.intersperse_trivia(&output, false, &mut |step| match step { + crate::StrStep::Token { kind, text } => { + write!(buf, "{}", indent).unwrap(); + write!(buf, "{:?} {:?}\n", kind, text).unwrap(); + } + crate::StrStep::Enter { kind } => { + write!(buf, "{}", indent).unwrap(); + write!(buf, "{:?}\n", kind).unwrap(); + indent.push_str(" "); + } + crate::StrStep::Exit => { + indent.pop(); + indent.pop(); + } + crate::StrStep::Error { msg, pos } => errors.push(format!("error {}: {}\n", pos, msg)), + }); + + for (token, msg) in lexed.errors() { + let pos = lexed.text_start(token); + errors.push(format!("error {}: {}\n", pos, msg)); + } + + let has_errors = !errors.is_empty(); + for e in errors { + buf.push_str(&e); + } + (buf, has_errors) +} + #[derive(PartialEq, Eq, PartialOrd, Ord)] struct TestCase { rs: PathBuf, diff --git a/crates/parser/src/tests/sourcegen_inline_tests.rs b/crates/parser/src/tests/sourcegen_inline_tests.rs new file mode 100644 index 0000000000..7b2b703deb --- /dev/null +++ b/crates/parser/src/tests/sourcegen_inline_tests.rs @@ -0,0 +1,123 @@ +//! This module greps parser's code for specially formatted comments and turns +//! them into tests. + +use std::{ + collections::HashMap, + fs, iter, + path::{Path, PathBuf}, +}; + +#[test] +fn sourcegen_parser_tests() { + let grammar_dir = sourcegen::project_root().join(Path::new("crates/parser/src/grammar")); + let tests = tests_from_dir(&grammar_dir); + + install_tests(&tests.ok, "crates/parser/test_data/parser/inline/ok"); + install_tests(&tests.err, "crates/parser/test_data/parser/inline/err"); + + fn install_tests(tests: &HashMap, into: &str) { + let tests_dir = sourcegen::project_root().join(into); + if !tests_dir.is_dir() { + fs::create_dir_all(&tests_dir).unwrap(); + } + // ok is never actually read, but it needs to be specified to create a Test in existing_tests + let existing = existing_tests(&tests_dir, true); + for t in existing.keys().filter(|&t| !tests.contains_key(t)) { + panic!("Test is deleted: {}", t); + } + + let mut new_idx = existing.len() + 1; + for (name, test) in tests { + let path = match existing.get(name) { + Some((path, _test)) => path.clone(), + None => { + let file_name = format!("{:04}_{}.rs", new_idx, name); + new_idx += 1; + tests_dir.join(file_name) + } + }; + sourcegen::ensure_file_contents(&path, &test.text); + } + } +} + +#[derive(Debug)] +struct Test { + name: String, + text: String, + ok: bool, +} + +#[derive(Default, Debug)] +struct Tests { + ok: HashMap, + err: HashMap, +} + +fn collect_tests(s: &str) -> Vec { + let mut res = Vec::new(); + for comment_block in sourcegen::CommentBlock::extract_untagged(s) { + let first_line = &comment_block.contents[0]; + let (name, ok) = if let Some(name) = first_line.strip_prefix("test ") { + (name.to_string(), true) + } else if let Some(name) = first_line.strip_prefix("test_err ") { + (name.to_string(), false) + } else { + continue; + }; + let text: String = comment_block.contents[1..] + .iter() + .cloned() + .chain(iter::once(String::new())) + .collect::>() + .join("\n"); + assert!(!text.trim().is_empty() && text.ends_with('\n')); + res.push(Test { name, text, ok }) + } + res +} + +fn tests_from_dir(dir: &Path) -> Tests { + let mut res = Tests::default(); + for entry in sourcegen::list_rust_files(dir) { + process_file(&mut res, entry.as_path()); + } + let grammar_rs = dir.parent().unwrap().join("grammar.rs"); + process_file(&mut res, &grammar_rs); + return res; + + fn process_file(res: &mut Tests, path: &Path) { + let text = fs::read_to_string(path).unwrap(); + + for test in collect_tests(&text) { + if test.ok { + if let Some(old_test) = res.ok.insert(test.name.clone(), test) { + panic!("Duplicate test: {}", old_test.name); + } + } else if let Some(old_test) = res.err.insert(test.name.clone(), test) { + panic!("Duplicate test: {}", old_test.name); + } + } + } +} + +fn existing_tests(dir: &Path, ok: bool) -> HashMap { + let mut res = HashMap::default(); + for file in fs::read_dir(dir).unwrap() { + let file = file.unwrap(); + let path = file.path(); + if path.extension().unwrap_or_default() != "rs" { + continue; + } + let name = { + let file_name = path.file_name().unwrap().to_str().unwrap(); + file_name[5..file_name.len() - 3].to_string() + }; + let text = fs::read_to_string(&path).unwrap(); + let test = Test { name: name.clone(), text, ok }; + if let Some(old) = res.insert(name, (path, test)) { + println!("Duplicate test: {:?}", old); + } + } + res +} diff --git a/crates/syntax/test_data/parser/err/0000_struct_field_missing_comma.rast b/crates/parser/test_data/parser/err/0000_struct_field_missing_comma.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0000_struct_field_missing_comma.rast rename to crates/parser/test_data/parser/err/0000_struct_field_missing_comma.rast diff --git a/crates/syntax/test_data/parser/err/0000_struct_field_missing_comma.rs b/crates/parser/test_data/parser/err/0000_struct_field_missing_comma.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0000_struct_field_missing_comma.rs rename to crates/parser/test_data/parser/err/0000_struct_field_missing_comma.rs diff --git a/crates/parser/test_data/parser/err/0000_struct_field_missing_comma.txt b/crates/parser/test_data/parser/err/0000_struct_field_missing_comma.txt new file mode 100644 index 0000000000..b30328c827 --- /dev/null +++ b/crates/parser/test_data/parser/err/0000_struct_field_missing_comma.txt @@ -0,0 +1,34 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE "\n " + RECORD_FIELD + NAME + IDENT "a" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + WHITESPACE "\n " + RECORD_FIELD + NAME + IDENT "b" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + WHITESPACE "\n" + R_CURLY "}" +error 21: expected COMMA diff --git a/crates/syntax/test_data/parser/err/0001_item_recovery_in_file.rast b/crates/parser/test_data/parser/err/0001_item_recovery_in_file.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0001_item_recovery_in_file.rast rename to crates/parser/test_data/parser/err/0001_item_recovery_in_file.rast diff --git a/crates/syntax/test_data/parser/err/0001_item_recovery_in_file.rs b/crates/parser/test_data/parser/err/0001_item_recovery_in_file.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0001_item_recovery_in_file.rs rename to crates/parser/test_data/parser/err/0001_item_recovery_in_file.rs diff --git a/crates/parser/test_data/parser/err/0001_item_recovery_in_file.txt b/crates/parser/test_data/parser/err/0001_item_recovery_in_file.txt new file mode 100644 index 0000000000..959b87ebbc --- /dev/null +++ b/crates/parser/test_data/parser/err/0001_item_recovery_in_file.txt @@ -0,0 +1,18 @@ +SOURCE_FILE + ERROR + IF_KW "if" + WHITESPACE " " + ERROR + MATCH_KW "match" + WHITESPACE "\n\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + R_CURLY "}" +error 0: expected an item +error 3: expected an item diff --git a/crates/syntax/test_data/parser/err/0002_duplicate_shebang.rast b/crates/parser/test_data/parser/err/0002_duplicate_shebang.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0002_duplicate_shebang.rast rename to crates/parser/test_data/parser/err/0002_duplicate_shebang.rast diff --git a/crates/syntax/test_data/parser/err/0002_duplicate_shebang.rs b/crates/parser/test_data/parser/err/0002_duplicate_shebang.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0002_duplicate_shebang.rs rename to crates/parser/test_data/parser/err/0002_duplicate_shebang.rs diff --git a/crates/parser/test_data/parser/err/0002_duplicate_shebang.txt b/crates/parser/test_data/parser/err/0002_duplicate_shebang.txt new file mode 100644 index 0000000000..ec6c315100 --- /dev/null +++ b/crates/parser/test_data/parser/err/0002_duplicate_shebang.txt @@ -0,0 +1,45 @@ +SOURCE_FILE + SHEBANG "#!/use/bin/env rusti" + WHITESPACE "\n" + ATTR + POUND "#" + BANG "!" + ERROR + SLASH "/" + USE + USE_KW "use" + ERROR + SLASH "/" + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "bin" + ERROR + SLASH "/" + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "env" + WHITESPACE " " + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "rusti" + WHITESPACE "\n" +error 23: expected `[` +error 23: expected an item +error 27: expected one of `*`, `::`, `{`, `self`, `super` or an identifier +error 28: expected SEMICOLON +error 31: expected BANG +error 31: expected `{`, `[`, `(` +error 31: expected SEMICOLON +error 31: expected an item +error 35: expected BANG +error 35: expected `{`, `[`, `(` +error 35: expected SEMICOLON +error 41: expected BANG +error 41: expected `{`, `[`, `(` +error 41: expected SEMICOLON diff --git a/crates/syntax/test_data/parser/err/0003_C++_semicolon.rast b/crates/parser/test_data/parser/err/0003_C++_semicolon.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0003_C++_semicolon.rast rename to crates/parser/test_data/parser/err/0003_C++_semicolon.rast diff --git a/crates/syntax/test_data/parser/err/0003_C++_semicolon.rs b/crates/parser/test_data/parser/err/0003_C++_semicolon.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0003_C++_semicolon.rs rename to crates/parser/test_data/parser/err/0003_C++_semicolon.rs diff --git a/crates/parser/test_data/parser/err/0003_C++_semicolon.txt b/crates/parser/test_data/parser/err/0003_C++_semicolon.txt new file mode 100644 index 0000000000..00131bea51 --- /dev/null +++ b/crates/parser/test_data/parser/err/0003_C++_semicolon.txt @@ -0,0 +1,39 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE "\n " + RECORD_FIELD + NAME + IDENT "a" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + COMMA "," + WHITESPACE "\n " + RECORD_FIELD + NAME + IDENT "b" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "String" + COMMA "," + WHITESPACE "\n" + R_CURLY "}" + ERROR + SEMICOLON ";" +error 39: expected item, found `;` +consider removing this semicolon diff --git a/crates/syntax/test_data/parser/err/0004_use_path_bad_segment.rast b/crates/parser/test_data/parser/err/0004_use_path_bad_segment.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0004_use_path_bad_segment.rast rename to crates/parser/test_data/parser/err/0004_use_path_bad_segment.rast diff --git a/crates/syntax/test_data/parser/err/0004_use_path_bad_segment.rs b/crates/parser/test_data/parser/err/0004_use_path_bad_segment.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0004_use_path_bad_segment.rs rename to crates/parser/test_data/parser/err/0004_use_path_bad_segment.rs diff --git a/crates/parser/test_data/parser/err/0004_use_path_bad_segment.txt b/crates/parser/test_data/parser/err/0004_use_path_bad_segment.txt new file mode 100644 index 0000000000..44e192a5fc --- /dev/null +++ b/crates/parser/test_data/parser/err/0004_use_path_bad_segment.txt @@ -0,0 +1,15 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + COLON2 "::" + ERROR + INT_NUMBER "92" + SEMICOLON ";" +error 9: expected identifier diff --git a/crates/syntax/test_data/parser/err/0005_attribute_recover.rast b/crates/parser/test_data/parser/err/0005_attribute_recover.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0005_attribute_recover.rast rename to crates/parser/test_data/parser/err/0005_attribute_recover.rast diff --git a/crates/syntax/test_data/parser/err/0005_attribute_recover.rs b/crates/parser/test_data/parser/err/0005_attribute_recover.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0005_attribute_recover.rs rename to crates/parser/test_data/parser/err/0005_attribute_recover.rs diff --git a/crates/parser/test_data/parser/err/0005_attribute_recover.txt b/crates/parser/test_data/parser/err/0005_attribute_recover.txt new file mode 100644 index 0000000000..6ff072e207 --- /dev/null +++ b/crates/parser/test_data/parser/err/0005_attribute_recover.txt @@ -0,0 +1,62 @@ +SOURCE_FILE + FN + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + TOKEN_TREE + L_PAREN "(" + IDENT "foo" + COMMA "," + WHITESPACE " " + PLUS "+" + COMMA "," + WHITESPACE " " + INT_NUMBER "92" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n" + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n\n" + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + TOKEN_TREE + L_PAREN "(" + WHITESPACE "\n" + FN_KW "fn" + WHITESPACE " " + IDENT "foo" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 53: expected R_PAREN +error 53: expected `]` +error 53: expected an item diff --git a/crates/syntax/test_data/parser/err/0006_named_field_recovery.rast b/crates/parser/test_data/parser/err/0006_named_field_recovery.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0006_named_field_recovery.rast rename to crates/parser/test_data/parser/err/0006_named_field_recovery.rast diff --git a/crates/syntax/test_data/parser/err/0006_named_field_recovery.rs b/crates/parser/test_data/parser/err/0006_named_field_recovery.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0006_named_field_recovery.rs rename to crates/parser/test_data/parser/err/0006_named_field_recovery.rs diff --git a/crates/parser/test_data/parser/err/0006_named_field_recovery.txt b/crates/parser/test_data/parser/err/0006_named_field_recovery.txt new file mode 100644 index 0000000000..7a4aa93b24 --- /dev/null +++ b/crates/parser/test_data/parser/err/0006_named_field_recovery.txt @@ -0,0 +1,74 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE "\n " + RECORD_FIELD + NAME + IDENT "f" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + COMMA "," + WHITESPACE "\n " + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + ERROR + INT_NUMBER "92" + WHITESPACE "\n " + ERROR + PLUS "+" + WHITESPACE " " + ERROR + MINUS "-" + WHITESPACE " " + ERROR + STAR "*" + WHITESPACE "\n " + RECORD_FIELD + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + COMMA "," + WHITESPACE "\n " + RECORD_FIELD + NAME + IDENT "z" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "f64" + COMMA "," + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 31: expected field declaration +error 33: expected COMMA +error 38: expected field declaration +error 39: expected COMMA +error 40: expected field declaration +error 41: expected COMMA +error 42: expected field declaration +error 43: expected COMMA diff --git a/crates/syntax/test_data/parser/err/0007_stray_curly_in_file.rast b/crates/parser/test_data/parser/err/0007_stray_curly_in_file.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0007_stray_curly_in_file.rast rename to crates/parser/test_data/parser/err/0007_stray_curly_in_file.rast diff --git a/crates/syntax/test_data/parser/err/0007_stray_curly_in_file.rs b/crates/parser/test_data/parser/err/0007_stray_curly_in_file.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0007_stray_curly_in_file.rs rename to crates/parser/test_data/parser/err/0007_stray_curly_in_file.rs diff --git a/crates/parser/test_data/parser/err/0007_stray_curly_in_file.txt b/crates/parser/test_data/parser/err/0007_stray_curly_in_file.txt new file mode 100644 index 0000000000..5d87ff866b --- /dev/null +++ b/crates/parser/test_data/parser/err/0007_stray_curly_in_file.txt @@ -0,0 +1,33 @@ +SOURCE_FILE + ERROR + R_CURLY "}" + WHITESPACE "\n\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + SEMICOLON ";" + WHITESPACE "\n\n" + ERROR + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n\n" + ERROR + R_CURLY "}" + WHITESPACE "\n" +error 0: unmatched `}` +error 14: unmatched `}` +error 29: unmatched `}` diff --git a/crates/syntax/test_data/parser/err/0008_item_block_recovery.rast b/crates/parser/test_data/parser/err/0008_item_block_recovery.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0008_item_block_recovery.rast rename to crates/parser/test_data/parser/err/0008_item_block_recovery.rast diff --git a/crates/syntax/test_data/parser/err/0008_item_block_recovery.rs b/crates/parser/test_data/parser/err/0008_item_block_recovery.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0008_item_block_recovery.rs rename to crates/parser/test_data/parser/err/0008_item_block_recovery.rs diff --git a/crates/parser/test_data/parser/err/0008_item_block_recovery.txt b/crates/parser/test_data/parser/err/0008_item_block_recovery.txt new file mode 100644 index 0000000000..6dd70e7cd9 --- /dev/null +++ b/crates/parser/test_data/parser/err/0008_item_block_recovery.txt @@ -0,0 +1,81 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + ERROR + L_CURLY "{" + WHITESPACE "\n " + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + LITERAL + TRUE_KW "true" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LITERAL + INT_NUMBER "1" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE " " + ELSE_KW "else" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + BIN_EXPR + LITERAL + INT_NUMBER "2" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + LITERAL + INT_NUMBER "3" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "baz" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 17: expected BANG +error 19: expected SEMICOLON +error 20: expected an item diff --git a/crates/syntax/test_data/parser/err/0009_broken_struct_type_parameter.rast b/crates/parser/test_data/parser/err/0009_broken_struct_type_parameter.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0009_broken_struct_type_parameter.rast rename to crates/parser/test_data/parser/err/0009_broken_struct_type_parameter.rast diff --git a/crates/syntax/test_data/parser/err/0009_broken_struct_type_parameter.rs b/crates/parser/test_data/parser/err/0009_broken_struct_type_parameter.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0009_broken_struct_type_parameter.rs rename to crates/parser/test_data/parser/err/0009_broken_struct_type_parameter.rs diff --git a/crates/parser/test_data/parser/err/0009_broken_struct_type_parameter.txt b/crates/parser/test_data/parser/err/0009_broken_struct_type_parameter.txt new file mode 100644 index 0000000000..a015432171 --- /dev/null +++ b/crates/parser/test_data/parser/err/0009_broken_struct_type_parameter.txt @@ -0,0 +1,56 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + GENERIC_PARAM_LIST + L_ANGLE "<" + ERROR + INT_NUMBER "90" + WHITESPACE " " + ERROR + PLUS "+" + WHITESPACE " " + ERROR + INT_NUMBER "2" + ERROR + R_ANGLE ">" + WHITESPACE " " + ERROR + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "f" + ERROR + COLON ":" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "T" + SEMICOLON ";" + WHITESPACE "\n" +error 9: expected type parameter +error 11: expected COMMA +error 11: expected R_ANGLE +error 11: expected `;`, `{`, or `(` +error 12: expected an item +error 14: expected an item +error 15: expected an item +error 17: expected an item +error 24: expected SEMICOLON +error 24: expected expression diff --git a/crates/syntax/test_data/parser/err/0010_unsafe_lambda_block.rast b/crates/parser/test_data/parser/err/0010_unsafe_lambda_block.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0010_unsafe_lambda_block.rast rename to crates/parser/test_data/parser/err/0010_unsafe_lambda_block.rast diff --git a/crates/syntax/test_data/parser/err/0010_unsafe_lambda_block.rs b/crates/parser/test_data/parser/err/0010_unsafe_lambda_block.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0010_unsafe_lambda_block.rs rename to crates/parser/test_data/parser/err/0010_unsafe_lambda_block.rs diff --git a/crates/parser/test_data/parser/err/0010_unsafe_lambda_block.txt b/crates/parser/test_data/parser/err/0010_unsafe_lambda_block.txt new file mode 100644 index 0000000000..9427ee5c0e --- /dev/null +++ b/crates/parser/test_data/parser/err/0010_unsafe_lambda_block.txt @@ -0,0 +1,45 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + CLOSURE_EXPR + PARAM_LIST + PIPE "|" + PIPE "|" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + EXPR_STMT + BLOCK_EXPR + UNSAFE_KW "unsafe" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 24: expected a block +error 24: expected SEMICOLON diff --git a/crates/syntax/test_data/parser/err/0011_extern_struct.rast b/crates/parser/test_data/parser/err/0011_extern_struct.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0011_extern_struct.rast rename to crates/parser/test_data/parser/err/0011_extern_struct.rast diff --git a/crates/syntax/test_data/parser/err/0011_extern_struct.rs b/crates/parser/test_data/parser/err/0011_extern_struct.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0011_extern_struct.rs rename to crates/parser/test_data/parser/err/0011_extern_struct.rs diff --git a/crates/parser/test_data/parser/err/0011_extern_struct.txt b/crates/parser/test_data/parser/err/0011_extern_struct.txt new file mode 100644 index 0000000000..bd5ec4b7c2 --- /dev/null +++ b/crates/parser/test_data/parser/err/0011_extern_struct.txt @@ -0,0 +1,13 @@ +SOURCE_FILE + ERROR + ABI + EXTERN_KW "extern" + WHITESPACE " " + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "Foo" + SEMICOLON ";" + WHITESPACE "\n" +error 6: expected existential, fn, trait or impl diff --git a/crates/syntax/test_data/parser/err/0012_broken_lambda.rast b/crates/parser/test_data/parser/err/0012_broken_lambda.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0012_broken_lambda.rast rename to crates/parser/test_data/parser/err/0012_broken_lambda.rast diff --git a/crates/syntax/test_data/parser/err/0013_invalid_type.rast b/crates/parser/test_data/parser/err/0013_invalid_type.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0013_invalid_type.rast rename to crates/parser/test_data/parser/err/0013_invalid_type.rast diff --git a/crates/syntax/test_data/parser/err/0013_invalid_type.rs b/crates/parser/test_data/parser/err/0013_invalid_type.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0013_invalid_type.rs rename to crates/parser/test_data/parser/err/0013_invalid_type.rs diff --git a/crates/parser/test_data/parser/err/0013_invalid_type.txt b/crates/parser/test_data/parser/err/0013_invalid_type.txt new file mode 100644 index 0000000000..eec84a0c67 --- /dev/null +++ b/crates/parser/test_data/parser/err/0013_invalid_type.txt @@ -0,0 +1,89 @@ +SOURCE_FILE + STRUCT + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "Cache" + TUPLE_FIELD_LIST + L_PAREN "(" + WHITESPACE "\n " + TUPLE_FIELD + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "RefCell" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "HashMap" + GENERIC_ARG_LIST + L_ANGLE "<" + WHITESPACE "\n " + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "TypeId" + COMMA "," + WHITESPACE "\n " + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Box" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + ERROR + AT "@" + WHITESPACE " " + TUPLE_FIELD + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Any" + ERROR + ERROR + R_ANGLE ">" + ERROR + COMMA "," + WHITESPACE "\n " + ERROR + R_ANGLE ">" + ERROR + R_ANGLE ">" + WHITESPACE "\n" + ERROR + R_PAREN ")" + ERROR + SEMICOLON ";" + WHITESPACE "\n\n" +error 67: expected type +error 68: expected COMMA +error 68: expected R_ANGLE +error 68: expected COMMA +error 68: expected R_ANGLE +error 68: expected COMMA +error 68: expected R_ANGLE +error 68: expected COMMA +error 72: expected COMMA +error 72: expected a type +error 72: expected R_PAREN +error 72: expected SEMICOLON +error 72: expected an item +error 73: expected an item +error 79: expected an item +error 80: expected an item +error 82: expected an item +error 83: expected an item diff --git a/crates/syntax/test_data/parser/err/0014_where_no_bounds.rast b/crates/parser/test_data/parser/err/0014_where_no_bounds.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0014_where_no_bounds.rast rename to crates/parser/test_data/parser/err/0014_where_no_bounds.rast diff --git a/crates/syntax/test_data/parser/err/0014_where_no_bounds.rs b/crates/parser/test_data/parser/err/0014_where_no_bounds.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0014_where_no_bounds.rs rename to crates/parser/test_data/parser/err/0014_where_no_bounds.rs diff --git a/crates/parser/test_data/parser/err/0014_where_no_bounds.txt b/crates/parser/test_data/parser/err/0014_where_no_bounds.txt new file mode 100644 index 0000000000..fd2f9ada33 --- /dev/null +++ b/crates/parser/test_data/parser/err/0014_where_no_bounds.txt @@ -0,0 +1,32 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE " " + WHERE_PRED + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" +error 19: expected colon diff --git a/crates/syntax/test_data/parser/err/0015_curly_in_params.rast b/crates/parser/test_data/parser/err/0015_curly_in_params.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0015_curly_in_params.rast rename to crates/parser/test_data/parser/err/0015_curly_in_params.rast diff --git a/crates/syntax/test_data/parser/err/0015_curly_in_params.rs b/crates/parser/test_data/parser/err/0015_curly_in_params.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0015_curly_in_params.rs rename to crates/parser/test_data/parser/err/0015_curly_in_params.rs diff --git a/crates/parser/test_data/parser/err/0015_curly_in_params.txt b/crates/parser/test_data/parser/err/0015_curly_in_params.txt new file mode 100644 index 0000000000..8e169320d9 --- /dev/null +++ b/crates/parser/test_data/parser/err/0015_curly_in_params.txt @@ -0,0 +1,24 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + ERROR + R_CURLY "}" + ERROR + R_PAREN ")" + WHITESPACE " " + ERROR + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 7: expected value parameter +error 7: expected R_PAREN +error 7: expected a block +error 7: unmatched `}` +error 8: expected an item +error 10: expected an item diff --git a/crates/syntax/test_data/parser/err/0016_missing_semi.rast b/crates/parser/test_data/parser/err/0016_missing_semi.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0016_missing_semi.rast rename to crates/parser/test_data/parser/err/0016_missing_semi.rast diff --git a/crates/syntax/test_data/parser/err/0016_missing_semi.rs b/crates/parser/test_data/parser/err/0016_missing_semi.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0016_missing_semi.rs rename to crates/parser/test_data/parser/err/0016_missing_semi.rs diff --git a/crates/parser/test_data/parser/err/0016_missing_semi.txt b/crates/parser/test_data/parser/err/0016_missing_semi.txt new file mode 100644 index 0000000000..c48c35bf82 --- /dev/null +++ b/crates/parser/test_data/parser/err/0016_missing_semi.txt @@ -0,0 +1,44 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + ARG_LIST + L_PAREN "(" + WHITESPACE "\n " + LITERAL + INT_NUMBER "1" + COMMA "," + WHITESPACE " " + LITERAL + INT_NUMBER "2" + WHITESPACE "\n " + R_PAREN ")" + WHITESPACE "\n " + EXPR_STMT + RETURN_EXPR + RETURN_KW "return" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 38: expected SEMICOLON diff --git a/crates/syntax/test_data/parser/err/0017_incomplete_binexpr.rast b/crates/parser/test_data/parser/err/0017_incomplete_binexpr.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0017_incomplete_binexpr.rast rename to crates/parser/test_data/parser/err/0017_incomplete_binexpr.rast diff --git a/crates/syntax/test_data/parser/err/0017_incomplete_binexpr.rs b/crates/parser/test_data/parser/err/0017_incomplete_binexpr.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0017_incomplete_binexpr.rs rename to crates/parser/test_data/parser/err/0017_incomplete_binexpr.rs diff --git a/crates/parser/test_data/parser/err/0017_incomplete_binexpr.txt b/crates/parser/test_data/parser/err/0017_incomplete_binexpr.txt new file mode 100644 index 0000000000..8073564629 --- /dev/null +++ b/crates/parser/test_data/parser/err/0017_incomplete_binexpr.txt @@ -0,0 +1,47 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "foo" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "bar" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + SEMICOLON ";" + WHITESPACE "\n " + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + PLUS "+" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 44: expected expression diff --git a/crates/syntax/test_data/parser/err/0018_incomplete_fn.rast b/crates/parser/test_data/parser/err/0018_incomplete_fn.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0018_incomplete_fn.rast rename to crates/parser/test_data/parser/err/0018_incomplete_fn.rast diff --git a/crates/syntax/test_data/parser/err/0018_incomplete_fn.rs b/crates/parser/test_data/parser/err/0018_incomplete_fn.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0018_incomplete_fn.rs rename to crates/parser/test_data/parser/err/0018_incomplete_fn.rs diff --git a/crates/parser/test_data/parser/err/0018_incomplete_fn.txt b/crates/parser/test_data/parser/err/0018_incomplete_fn.txt new file mode 100644 index 0000000000..799720b557 --- /dev/null +++ b/crates/parser/test_data/parser/err/0018_incomplete_fn.txt @@ -0,0 +1,133 @@ +SOURCE_FILE + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "FnScopes" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "new_scope" + PARAM_LIST + L_PAREN "(" + PARAM + REF_PAT + AMP "&" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "ScopeId" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "res" + WHITESPACE " " + EQ "=" + WHITESPACE " " + METHOD_CALL_EXPR + FIELD_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + SELF_KW "self" + DOT "." + NAME_REF + IDENT "scopes" + DOT "." + NAME_REF + IDENT "len" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + METHOD_CALL_EXPR + FIELD_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + SELF_KW "self" + DOT "." + NAME_REF + IDENT "scopes" + DOT "." + NAME_REF + IDENT "push" + ARG_LIST + L_PAREN "(" + RECORD_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "ScopeData" + WHITESPACE " " + RECORD_EXPR_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_EXPR_FIELD + NAME_REF + IDENT "parent" + COLON ":" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "None" + COMMA "," + WHITESPACE " " + RECORD_EXPR_FIELD + NAME_REF + IDENT "entries" + COLON ":" + WHITESPACE " " + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "vec" + BANG "!" + TOKEN_TREE + L_BRACK "[" + R_BRACK "]" + WHITESPACE " " + R_CURLY "}" + R_PAREN ")" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "set_parent" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 34: expected pattern +error 34: missing type for function parameter +error 180: expected function arguments +error 180: expected a block diff --git a/crates/syntax/test_data/parser/err/0019_let_recover.rast b/crates/parser/test_data/parser/err/0019_let_recover.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0019_let_recover.rast rename to crates/parser/test_data/parser/err/0019_let_recover.rast diff --git a/crates/syntax/test_data/parser/err/0019_let_recover.rs b/crates/parser/test_data/parser/err/0019_let_recover.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0019_let_recover.rs rename to crates/parser/test_data/parser/err/0019_let_recover.rs diff --git a/crates/parser/test_data/parser/err/0019_let_recover.txt b/crates/parser/test_data/parser/err/0019_let_recover.txt new file mode 100644 index 0000000000..25722b1355 --- /dev/null +++ b/crates/parser/test_data/parser/err/0019_let_recover.txt @@ -0,0 +1,107 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "foo" + WHITESPACE " " + EQ "=" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "bar" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "baz" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE "\n " + EXPR_STMT + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + LITERAL + TRUE_KW "true" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE "\n " + EXPR_STMT + WHILE_EXPR + WHILE_KW "while" + WHITESPACE " " + CONDITION + LITERAL + TRUE_KW "true" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE "\n " + LOOP_EXPR + LOOP_KW "loop" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 24: expected expression +error 24: expected SEMICOLON +error 49: expected pattern +error 49: expected SEMICOLON +error 75: expected pattern +error 75: expected SEMICOLON +error 98: expected pattern +error 98: expected SEMICOLON +error 124: expected pattern +error 124: expected SEMICOLON diff --git a/crates/syntax/test_data/parser/err/0020_fn_recover.rast b/crates/parser/test_data/parser/err/0020_fn_recover.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0020_fn_recover.rast rename to crates/parser/test_data/parser/err/0020_fn_recover.rast diff --git a/crates/syntax/test_data/parser/err/0020_fn_recover.rs b/crates/parser/test_data/parser/err/0020_fn_recover.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0020_fn_recover.rs rename to crates/parser/test_data/parser/err/0020_fn_recover.rs diff --git a/crates/parser/test_data/parser/err/0020_fn_recover.txt b/crates/parser/test_data/parser/err/0020_fn_recover.txt new file mode 100644 index 0000000000..56d124cb95 --- /dev/null +++ b/crates/parser/test_data/parser/err/0020_fn_recover.txt @@ -0,0 +1,21 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" +error 2: expected a name +error 2: expected function arguments +error 2: expected a block diff --git a/crates/syntax/test_data/parser/err/0021_incomplete_param.rast b/crates/parser/test_data/parser/err/0021_incomplete_param.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0021_incomplete_param.rast rename to crates/parser/test_data/parser/err/0021_incomplete_param.rast diff --git a/crates/syntax/test_data/parser/err/0021_incomplete_param.rs b/crates/parser/test_data/parser/err/0021_incomplete_param.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0021_incomplete_param.rs rename to crates/parser/test_data/parser/err/0021_incomplete_param.rs diff --git a/crates/parser/test_data/parser/err/0021_incomplete_param.txt b/crates/parser/test_data/parser/err/0021_incomplete_param.txt new file mode 100644 index 0000000000..762840aa2a --- /dev/null +++ b/crates/parser/test_data/parser/err/0021_incomplete_param.txt @@ -0,0 +1,34 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "y" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 16: missing type for function parameter diff --git a/crates/syntax/test_data/parser/err/0022_bad_exprs.rast b/crates/parser/test_data/parser/err/0022_bad_exprs.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0022_bad_exprs.rast rename to crates/parser/test_data/parser/err/0022_bad_exprs.rast diff --git a/crates/syntax/test_data/parser/err/0022_bad_exprs.rs b/crates/parser/test_data/parser/err/0022_bad_exprs.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0022_bad_exprs.rs rename to crates/parser/test_data/parser/err/0022_bad_exprs.rs diff --git a/crates/parser/test_data/parser/err/0022_bad_exprs.txt b/crates/parser/test_data/parser/err/0022_bad_exprs.txt new file mode 100644 index 0000000000..900394bd96 --- /dev/null +++ b/crates/parser/test_data/parser/err/0022_bad_exprs.txt @@ -0,0 +1,171 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "a" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + ARRAY_EXPR + L_BRACK "[" + LITERAL + INT_NUMBER "1" + COMMA "," + WHITESPACE " " + LITERAL + INT_NUMBER "2" + COMMA "," + WHITESPACE " " + ERROR + AT "@" + ERROR + COMMA "," + WHITESPACE " " + STRUCT + STRUCT_KW "struct" + ERROR + COMMA "," + WHITESPACE " " + LET_STMT + LET_KW "let" + ERROR + R_BRACK "]" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "b" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + ARG_LIST + L_PAREN "(" + LITERAL + INT_NUMBER "1" + COMMA "," + WHITESPACE " " + LITERAL + INT_NUMBER "2" + COMMA "," + WHITESPACE " " + ERROR + AT "@" + ERROR + COMMA "," + WHITESPACE " " + IMPL + IMPL_KW "impl" + ERROR + COMMA "," + WHITESPACE " " + LET_STMT + LET_KW "let" + ERROR + R_PAREN ")" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "c" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + METHOD_CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + DOT "." + NAME_REF + IDENT "bar" + ARG_LIST + L_PAREN "(" + LITERAL + INT_NUMBER "1" + COMMA "," + WHITESPACE " " + LITERAL + INT_NUMBER "2" + COMMA "," + WHITESPACE " " + ERROR + AT "@" + ERROR + COMMA "," + WHITESPACE " " + ERROR + R_BRACK "]" + ERROR + COMMA "," + WHITESPACE " " + TRAIT + TRAIT_KW "trait" + ERROR + COMMA "," + WHITESPACE " " + LET_STMT + LET_KW "let" + ERROR + R_PAREN ")" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" +error 16: expected expression +error 17: expected R_BRACK +error 17: expected SEMICOLON +error 17: expected expression +error 25: expected a name +error 26: expected `;`, `{`, or `(` +error 30: expected pattern +error 31: expected SEMICOLON +error 53: expected expression +error 54: expected SEMICOLON +error 54: expected expression +error 60: expected type +error 60: expected `{` +error 60: expected expression +error 65: expected pattern +error 65: expected SEMICOLON +error 65: expected expression +error 92: expected expression +error 93: expected SEMICOLON +error 93: expected expression +error 95: expected expression +error 96: expected expression +error 103: expected a name +error 104: expected `{` +error 108: expected pattern +error 108: expected SEMICOLON +error 108: expected expression diff --git a/crates/syntax/test_data/parser/err/0023_mismatched_paren.rast b/crates/parser/test_data/parser/err/0023_mismatched_paren.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0023_mismatched_paren.rast rename to crates/parser/test_data/parser/err/0023_mismatched_paren.rast diff --git a/crates/syntax/test_data/parser/err/0023_mismatched_paren.rs b/crates/parser/test_data/parser/err/0023_mismatched_paren.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0023_mismatched_paren.rs rename to crates/parser/test_data/parser/err/0023_mismatched_paren.rs diff --git a/crates/parser/test_data/parser/err/0023_mismatched_paren.txt b/crates/parser/test_data/parser/err/0023_mismatched_paren.txt new file mode 100644 index 0000000000..1176400634 --- /dev/null +++ b/crates/parser/test_data/parser/err/0023_mismatched_paren.txt @@ -0,0 +1,44 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + BANG "!" + WHITESPACE " " + TOKEN_TREE + L_PAREN "(" + WHITESPACE "\n " + IDENT "bar" + COMMA "," + WHITESPACE " " + STRING "\"baz\"" + COMMA "," + WHITESPACE " " + INT_NUMBER "1" + COMMA "," + WHITESPACE " " + FLOAT_NUMBER "2.0" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE " " + COMMENT "//~ ERROR incorrect close delimiter" + WHITESPACE "\n" + ERROR + R_CURLY "}" + WHITESPACE "\n" +error 49: unmatched `}` +error 92: unmatched `}` diff --git a/crates/syntax/test_data/parser/err/0024_many_type_parens.rast b/crates/parser/test_data/parser/err/0024_many_type_parens.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0024_many_type_parens.rast rename to crates/parser/test_data/parser/err/0024_many_type_parens.rast diff --git a/crates/syntax/test_data/parser/err/0024_many_type_parens.rs b/crates/parser/test_data/parser/err/0024_many_type_parens.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0024_many_type_parens.rs rename to crates/parser/test_data/parser/err/0024_many_type_parens.rs diff --git a/crates/parser/test_data/parser/err/0024_many_type_parens.txt b/crates/parser/test_data/parser/err/0024_many_type_parens.txt new file mode 100644 index 0000000000..446e1a8233 --- /dev/null +++ b/crates/parser/test_data/parser/err/0024_many_type_parens.txt @@ -0,0 +1,321 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + L_PAREN "(" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Copy" + R_PAREN ")" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + L_PAREN "(" + QUESTION "?" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Sized" + R_PAREN ")" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + L_PAREN "(" + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Trait" + GENERIC_ARG_LIST + L_ANGLE "<" + LIFETIME_ARG + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + R_PAREN ")" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + DYN_TRAIT_TYPE + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Box" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PAREN_TYPE + L_PAREN "(" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Copy" + R_PAREN ")" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + L_PAREN "(" + QUESTION "?" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Sized" + R_PAREN ")" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + L_PAREN "(" + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Trait" + GENERIC_ARG_LIST + L_ANGLE "<" + LIFETIME_ARG + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + R_PAREN ")" + ERROR + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Box" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PAREN_TYPE + L_PAREN "(" + ERROR + QUESTION "?" + EXPR_STMT + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Sized" + ERROR + R_PAREN ")" + WHITESPACE " " + ERROR + PLUS "+" + WHITESPACE " " + EXPR_STMT + TUPLE_EXPR + L_PAREN "(" + FOR_EXPR + FOR_KW "for" + PATH_PAT + PATH + PATH_SEGMENT + L_ANGLE "<" + ERROR + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + BIN_EXPR + BIN_EXPR + BIN_EXPR + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Trait" + L_ANGLE "<" + ERROR + LIFETIME_IDENT "'a" + R_ANGLE ">" + ERROR + R_PAREN ")" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + PAREN_EXPR + L_PAREN "(" + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Copy" + R_PAREN ")" + R_ANGLE ">" + ERROR + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + DYN_TRAIT_TYPE + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Box" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PAREN_TYPE + L_PAREN "(" + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Trait" + GENERIC_ARG_LIST + L_ANGLE "<" + LIFETIME_ARG + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + R_PAREN ")" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + L_PAREN "(" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Copy" + R_PAREN ")" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + L_PAREN "(" + QUESTION "?" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Sized" + R_PAREN ")" + ERROR + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 88: expected COMMA +error 88: expected R_ANGLE +error 121: expected SEMICOLON +error 121: expected expression +error 140: expected type +error 141: expected R_PAREN +error 141: expected COMMA +error 141: expected R_ANGLE +error 141: expected SEMICOLON +error 146: expected SEMICOLON +error 146: expected expression +error 148: expected expression +error 155: expected type +error 158: expected IN_KW +error 165: expected expression +error 168: expected expression +error 179: expected expression +error 180: expected a block +error 180: expected COMMA +error 180: expected expression +error 180: expected R_PAREN +error 180: expected SEMICOLON +error 215: expected COMMA +error 215: expected R_ANGLE +error 235: expected SEMICOLON +error 235: expected expression diff --git a/crates/syntax/test_data/parser/err/0025_nope.rast b/crates/parser/test_data/parser/err/0025_nope.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0025_nope.rast rename to crates/parser/test_data/parser/err/0025_nope.rast diff --git a/crates/syntax/test_data/parser/err/0025_nope.rs b/crates/parser/test_data/parser/err/0025_nope.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0025_nope.rs rename to crates/parser/test_data/parser/err/0025_nope.rs diff --git a/crates/parser/test_data/parser/err/0025_nope.txt b/crates/parser/test_data/parser/err/0025_nope.txt new file mode 100644 index 0000000000..aca57faf96 --- /dev/null +++ b/crates/parser/test_data/parser/err/0025_nope.txt @@ -0,0 +1,204 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + ENUM + ENUM_KW "enum" + WHITESPACE " " + NAME + IDENT "Test" + WHITESPACE " " + VARIANT_LIST + L_CURLY "{" + WHITESPACE "\n " + VARIANT + NAME + IDENT "Var1" + COMMA "," + WHITESPACE "\n " + VARIANT + NAME + IDENT "Var2" + TUPLE_FIELD_LIST + L_PAREN "(" + TUPLE_FIELD + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "String" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + VARIANT + NAME + IDENT "Var3" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE "\n " + RECORD_FIELD + NAME + IDENT "abc" + COLON ":" + WHITESPACE " " + ERROR + L_CURLY "{" + R_CURLY "}" + ERROR + COMMA "," + WHITESPACE " " + COMMENT "//~ ERROR: expected type, found `{`" + WHITESPACE "\n " + R_CURLY "}" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n\n " + COMMENT "// recover..." + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "a" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n " + ENUM + ENUM_KW "enum" + WHITESPACE " " + NAME + IDENT "Test2" + WHITESPACE " " + VARIANT_LIST + L_CURLY "{" + WHITESPACE "\n " + VARIANT + NAME + IDENT "Fine" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n\n " + ENUM + ENUM_KW "enum" + WHITESPACE " " + NAME + IDENT "Test3" + WHITESPACE " " + VARIANT_LIST + L_CURLY "{" + WHITESPACE "\n " + VARIANT + NAME + IDENT "StillFine" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE "\n " + RECORD_FIELD + NAME + IDENT "def" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n\n " + EXPR_STMT + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + ENUM + COMMENT "// fail again" + WHITESPACE "\n " + ENUM_KW "enum" + WHITESPACE " " + NAME + IDENT "Test4" + WHITESPACE " " + VARIANT_LIST + L_CURLY "{" + WHITESPACE "\n " + VARIANT + NAME + IDENT "Nope" + TUPLE_FIELD_LIST + L_PAREN "(" + TUPLE_FIELD + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + WHITESPACE " " + ERROR + ERROR + L_CURLY "{" + R_CURLY "}" + ERROR + R_PAREN ")" + WHITESPACE " " + COMMENT "//~ ERROR: found `{`" + WHITESPACE "\n " + COMMENT "//~^ ERROR: found `{`" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n " + COMMENT "// still recover later" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "bad_syntax" + WHITESPACE " " + EQ "=" + WHITESPACE " " + ERROR + UNDERSCORE "_" + SEMICOLON ";" + WHITESPACE " " + COMMENT "//~ ERROR: expected expression, found reserved identifier `_`" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 95: expected type +error 95: expected COMMA +error 96: expected field +error 98: expected field declaration +error 371: expected COMMA +error 372: expected a type +error 372: expected R_PAREN +error 372: expected COMMA +error 372: expected enum variant +error 374: expected enum variant +error 508: expected expression diff --git a/crates/syntax/test_data/parser/err/0026_imp_recovery.rast b/crates/parser/test_data/parser/err/0026_imp_recovery.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0026_imp_recovery.rast rename to crates/parser/test_data/parser/err/0026_imp_recovery.rast diff --git a/crates/syntax/test_data/parser/err/0026_imp_recovery.rs b/crates/parser/test_data/parser/err/0026_imp_recovery.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0026_imp_recovery.rs rename to crates/parser/test_data/parser/err/0026_imp_recovery.rs diff --git a/crates/parser/test_data/parser/err/0026_imp_recovery.txt b/crates/parser/test_data/parser/err/0026_imp_recovery.txt new file mode 100644 index 0000000000..1068418e0d --- /dev/null +++ b/crates/parser/test_data/parser/err/0026_imp_recovery.txt @@ -0,0 +1,49 @@ +SOURCE_FILE + IMPL + IMPL_KW "impl" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Clone" + R_ANGLE ">" + WHITESPACE "\n" + IMPL + IMPL_KW "impl" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + R_ANGLE ">" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "OnceCell" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + R_ANGLE ">" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" +error 14: expected trait or type +error 14: expected `{` diff --git a/crates/syntax/test_data/parser/err/0027_incomplere_where_for.rast b/crates/parser/test_data/parser/err/0027_incomplere_where_for.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0027_incomplere_where_for.rast rename to crates/parser/test_data/parser/err/0027_incomplere_where_for.rast diff --git a/crates/syntax/test_data/parser/err/0027_incomplere_where_for.rs b/crates/parser/test_data/parser/err/0027_incomplere_where_for.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0027_incomplere_where_for.rs rename to crates/parser/test_data/parser/err/0027_incomplere_where_for.rs diff --git a/crates/parser/test_data/parser/err/0027_incomplere_where_for.txt b/crates/parser/test_data/parser/err/0027_incomplere_where_for.txt new file mode 100644 index 0000000000..674c8d536c --- /dev/null +++ b/crates/parser/test_data/parser/err/0027_incomplere_where_for.txt @@ -0,0 +1,29 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n " + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE " " + WHERE_PRED + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE "\n" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" +error 26: expected type +error 26: expected colon diff --git a/crates/syntax/test_data/parser/err/0029_field_completion.rast b/crates/parser/test_data/parser/err/0029_field_completion.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0029_field_completion.rast rename to crates/parser/test_data/parser/err/0029_field_completion.rast diff --git a/crates/syntax/test_data/parser/err/0029_field_completion.rs b/crates/parser/test_data/parser/err/0029_field_completion.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0029_field_completion.rs rename to crates/parser/test_data/parser/err/0029_field_completion.rs diff --git a/crates/parser/test_data/parser/err/0029_field_completion.txt b/crates/parser/test_data/parser/err/0029_field_completion.txt new file mode 100644 index 0000000000..fb037112fa --- /dev/null +++ b/crates/parser/test_data/parser/err/0029_field_completion.txt @@ -0,0 +1,36 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "a" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "A" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + FIELD_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + DOT "." + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 21: expected field name or number diff --git a/crates/syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast b/crates/parser/test_data/parser/err/0032_match_arms_inner_attrs.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast rename to crates/parser/test_data/parser/err/0032_match_arms_inner_attrs.rast diff --git a/crates/syntax/test_data/parser/err/0032_match_arms_inner_attrs.rs b/crates/parser/test_data/parser/err/0032_match_arms_inner_attrs.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0032_match_arms_inner_attrs.rs rename to crates/parser/test_data/parser/err/0032_match_arms_inner_attrs.rs diff --git a/crates/parser/test_data/parser/err/0032_match_arms_inner_attrs.txt b/crates/parser/test_data/parser/err/0032_match_arms_inner_attrs.txt new file mode 100644 index 0000000000..327bf94a49 --- /dev/null +++ b/crates/parser/test_data/parser/err/0032_match_arms_inner_attrs.txt @@ -0,0 +1,205 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + ATTR + POUND "#" + ERROR + BANG "!" + ARRAY_EXPR + L_BRACK "[" + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "doc" + ARG_LIST + L_PAREN "(" + LITERAL + STRING "\"Not allowed here\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + ATTR + POUND "#" + ERROR + BANG "!" + ARRAY_EXPR + L_BRACK "[" + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "doc" + ARG_LIST + L_PAREN "(" + LITERAL + STRING "\"Nor here\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n\n " + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "cfg" + TOKEN_TREE + L_PAREN "(" + IDENT "test" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + ATTR + POUND "#" + ERROR + BANG "!" + ARRAY_EXPR + L_BRACK "[" + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "doc" + ARG_LIST + L_PAREN "(" + LITERAL + STRING "\"Nor here\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 52: expected `[` +error 52: expected pattern +error 53: expected FAT_ARROW +error 78: expected `,` +error 161: expected `[` +error 161: expected pattern +error 162: expected FAT_ARROW +error 232: expected `[` +error 232: expected pattern +error 233: expected FAT_ARROW +error 250: expected `,` diff --git a/crates/syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast b/crates/parser/test_data/parser/err/0033_match_arms_outer_attrs.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast rename to crates/parser/test_data/parser/err/0033_match_arms_outer_attrs.rast diff --git a/crates/syntax/test_data/parser/err/0033_match_arms_outer_attrs.rs b/crates/parser/test_data/parser/err/0033_match_arms_outer_attrs.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0033_match_arms_outer_attrs.rs rename to crates/parser/test_data/parser/err/0033_match_arms_outer_attrs.rs diff --git a/crates/parser/test_data/parser/err/0033_match_arms_outer_attrs.txt b/crates/parser/test_data/parser/err/0033_match_arms_outer_attrs.txt new file mode 100644 index 0000000000..b5bc3d84df --- /dev/null +++ b/crates/parser/test_data/parser/err/0033_match_arms_outer_attrs.txt @@ -0,0 +1,68 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "cfg" + TOKEN_TREE + L_PAREN "(" + IDENT "test" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 80: expected pattern +error 80: expected FAT_ARROW +error 80: expected expression diff --git a/crates/syntax/test_data/parser/err/0034_bad_box_pattern.rast b/crates/parser/test_data/parser/err/0034_bad_box_pattern.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0034_bad_box_pattern.rast rename to crates/parser/test_data/parser/err/0034_bad_box_pattern.rast diff --git a/crates/syntax/test_data/parser/err/0034_bad_box_pattern.rs b/crates/parser/test_data/parser/err/0034_bad_box_pattern.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0034_bad_box_pattern.rs rename to crates/parser/test_data/parser/err/0034_bad_box_pattern.rs diff --git a/crates/parser/test_data/parser/err/0034_bad_box_pattern.txt b/crates/parser/test_data/parser/err/0034_bad_box_pattern.txt new file mode 100644 index 0000000000..7a2ae9103f --- /dev/null +++ b/crates/parser/test_data/parser/err/0034_bad_box_pattern.txt @@ -0,0 +1,96 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + REF_KW "ref" + WHITESPACE " " + ERROR + BOX_KW "box" + WHITESPACE " " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "i" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + MUT_KW "mut" + WHITESPACE " " + ERROR + BOX_KW "box" + WHITESPACE " " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "i" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + REF_KW "ref" + WHITESPACE " " + MUT_KW "mut" + WHITESPACE " " + ERROR + BOX_KW "box" + WHITESPACE " " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "i" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" +error 24: expected a name +error 27: expected SEMICOLON +error 48: expected a name +error 51: expected SEMICOLON +error 76: expected a name +error 79: expected SEMICOLON diff --git a/crates/syntax/test_data/parser/err/0035_use_recover.rast b/crates/parser/test_data/parser/err/0035_use_recover.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0035_use_recover.rast rename to crates/parser/test_data/parser/err/0035_use_recover.rast diff --git a/crates/syntax/test_data/parser/err/0035_use_recover.rs b/crates/parser/test_data/parser/err/0035_use_recover.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0035_use_recover.rs rename to crates/parser/test_data/parser/err/0035_use_recover.rs diff --git a/crates/parser/test_data/parser/err/0035_use_recover.txt b/crates/parser/test_data/parser/err/0035_use_recover.txt new file mode 100644 index 0000000000..f9287d42e2 --- /dev/null +++ b/crates/parser/test_data/parser/err/0035_use_recover.txt @@ -0,0 +1,55 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "bar" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH_SEGMENT + NAME_REF + CRATE_KW "crate" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "baz" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" +error 17: expected one of `*`, `::`, `{`, `self`, `super` or an identifier +error 17: expected SEMICOLON +error 37: expected one of `*`, `::`, `{`, `self`, `super` or an identifier +error 37: expected SEMICOLON diff --git a/crates/syntax/test_data/parser/err/0036_partial_use.rast b/crates/parser/test_data/parser/err/0036_partial_use.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0036_partial_use.rast rename to crates/parser/test_data/parser/err/0036_partial_use.rast diff --git a/crates/syntax/test_data/parser/err/0036_partial_use.rs b/crates/parser/test_data/parser/err/0036_partial_use.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0036_partial_use.rs rename to crates/parser/test_data/parser/err/0036_partial_use.rs diff --git a/crates/parser/test_data/parser/err/0036_partial_use.txt b/crates/parser/test_data/parser/err/0036_partial_use.txt new file mode 100644 index 0000000000..13e76e6830 --- /dev/null +++ b/crates/parser/test_data/parser/err/0036_partial_use.txt @@ -0,0 +1,51 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "std" + COLON2 "::" + USE_TREE_LIST + L_CURLY "{" + USE_TREE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "error" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Error" + ERROR + SEMICOLON ";" + WHITESPACE "\n" + ERROR + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "std" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "io" + ERROR + SEMICOLON ";" + WHITESPACE "\n" +error 22: expected COMMA +error 22: expected one of `*`, `::`, `{`, `self`, `super` or an identifier +error 23: expected COMMA +error 24: expected one of `*`, `::`, `{`, `self`, `super` or an identifier +error 27: expected COMMA +error 35: expected COMMA +error 35: expected one of `*`, `::`, `{`, `self`, `super` or an identifier +error 36: expected COMMA +error 36: expected R_CURLY +error 36: expected SEMICOLON diff --git a/crates/syntax/test_data/parser/err/0039_lambda_recovery.rast b/crates/parser/test_data/parser/err/0039_lambda_recovery.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0039_lambda_recovery.rast rename to crates/parser/test_data/parser/err/0039_lambda_recovery.rast diff --git a/crates/syntax/test_data/parser/err/0039_lambda_recovery.rs b/crates/parser/test_data/parser/err/0039_lambda_recovery.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0039_lambda_recovery.rs rename to crates/parser/test_data/parser/err/0039_lambda_recovery.rs diff --git a/crates/parser/test_data/parser/err/0039_lambda_recovery.txt b/crates/parser/test_data/parser/err/0039_lambda_recovery.txt new file mode 100644 index 0000000000..8ca1606015 --- /dev/null +++ b/crates/parser/test_data/parser/err/0039_lambda_recovery.txt @@ -0,0 +1,83 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + METHOD_CALL_EXPR + METHOD_CALL_EXPR + METHOD_CALL_EXPR + ARRAY_EXPR + L_BRACK "[" + LITERAL + INT_NUMBER "1" + COMMA "," + WHITESPACE " " + LITERAL + INT_NUMBER "2" + COMMA "," + WHITESPACE " " + LITERAL + INT_NUMBER "3" + R_BRACK "]" + DOT "." + NAME_REF + IDENT "iter" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n " + DOT "." + NAME_REF + IDENT "map" + ARG_LIST + L_PAREN "(" + CLOSURE_EXPR + PARAM_LIST + PIPE "|" + PARAM + IDENT_PAT + NAME + IDENT "it" + PIPE "|" + R_PAREN ")" + WHITESPACE "\n " + DOT "." + NAME_REF + IDENT "max" + GENERIC_ARG_LIST + COLON2 "::" + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_ANGLE ">" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 56: expected expression diff --git a/crates/syntax/test_data/parser/err/0042_weird_blocks.rast b/crates/parser/test_data/parser/err/0042_weird_blocks.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0042_weird_blocks.rast rename to crates/parser/test_data/parser/err/0042_weird_blocks.rast diff --git a/crates/syntax/test_data/parser/err/0042_weird_blocks.rs b/crates/parser/test_data/parser/err/0042_weird_blocks.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0042_weird_blocks.rs rename to crates/parser/test_data/parser/err/0042_weird_blocks.rs diff --git a/crates/parser/test_data/parser/err/0042_weird_blocks.txt b/crates/parser/test_data/parser/err/0042_weird_blocks.txt new file mode 100644 index 0000000000..9cea337ce9 --- /dev/null +++ b/crates/parser/test_data/parser/err/0042_weird_blocks.txt @@ -0,0 +1,75 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + ERROR + UNSAFE_KW "unsafe" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + ERROR + ASYNC_KW "async" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + BLOCK_EXPR + TRY_KW "try" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + ERROR + LABEL + LIFETIME + LIFETIME_IDENT "'label" + COLON ":" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 24: expected existential, fn, trait or impl +error 41: expected existential, fn, trait or impl +error 56: expected a block +error 75: expected a loop diff --git a/crates/syntax/test_data/parser/err/0043_unexpected_for_type.rast b/crates/parser/test_data/parser/err/0043_unexpected_for_type.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0043_unexpected_for_type.rast rename to crates/parser/test_data/parser/err/0043_unexpected_for_type.rast diff --git a/crates/syntax/test_data/parser/err/0043_unexpected_for_type.rs b/crates/parser/test_data/parser/err/0043_unexpected_for_type.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0043_unexpected_for_type.rs rename to crates/parser/test_data/parser/err/0043_unexpected_for_type.rs diff --git a/crates/parser/test_data/parser/err/0043_unexpected_for_type.txt b/crates/parser/test_data/parser/err/0043_unexpected_for_type.txt new file mode 100644 index 0000000000..cb4fb1642d --- /dev/null +++ b/crates/parser/test_data/parser/err/0043_unexpected_for_type.txt @@ -0,0 +1,256 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "ForRef" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "ForTup" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + COMMA "," + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "ForSlice" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + SLICE_TYPE + L_BRACK "[" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + R_BRACK "]" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "ForForFn" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'b" + R_ANGLE ">" + WHITESPACE " " + FN_PTR_TYPE + FN_KW "fn" + PARAM_LIST + L_PAREN "(" + PARAM + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + COMMA "," + WHITESPACE " " + PARAM + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'b" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "for_for_for" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n" + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE "\n " + WHERE_PRED + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'b" + R_ANGLE ">" + WHITESPACE " " + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'c" + R_ANGLE ">" + WHITESPACE " " + FN_PTR_TYPE + FN_KW "fn" + PARAM_LIST + L_PAREN "(" + PARAM + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + COMMA "," + WHITESPACE " " + PARAM + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'b" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + COMMA "," + WHITESPACE " " + PARAM + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'c" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + R_PAREN ")" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Copy" + COMMA "," + WHITESPACE "\n" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 21: expected a function pointer or path +error 52: expected a function pointer or path +error 88: expected a function pointer or path +error 119: expected a function pointer or path +error 195: expected a function pointer or path diff --git a/crates/syntax/test_data/parser/err/0044_item_modifiers.rast b/crates/parser/test_data/parser/err/0044_item_modifiers.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0044_item_modifiers.rast rename to crates/parser/test_data/parser/err/0044_item_modifiers.rast diff --git a/crates/syntax/test_data/parser/err/0044_item_modifiers.rs b/crates/parser/test_data/parser/err/0044_item_modifiers.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0044_item_modifiers.rs rename to crates/parser/test_data/parser/err/0044_item_modifiers.rs diff --git a/crates/parser/test_data/parser/err/0044_item_modifiers.txt b/crates/parser/test_data/parser/err/0044_item_modifiers.txt new file mode 100644 index 0000000000..96e471a69a --- /dev/null +++ b/crates/parser/test_data/parser/err/0044_item_modifiers.txt @@ -0,0 +1,48 @@ +SOURCE_FILE + ERROR + UNSAFE_KW "unsafe" + WHITESPACE " " + FN + ASYNC_KW "async" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + CONST + UNSAFE_KW "unsafe" + WHITESPACE " " + CONST_KW "const" + WHITESPACE " " + ERROR + FN_KW "fn" + WHITESPACE " " + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + ERROR + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" +error 6: expected existential, fn, trait or impl +error 38: expected a name +error 40: missing type for `const` or `static` +error 40: expected SEMICOLON +error 44: expected BANG +error 46: expected SEMICOLON +error 47: expected an item diff --git a/crates/syntax/test_data/parser/err/0047_repated_extern_modifier.rast b/crates/parser/test_data/parser/err/0047_repated_extern_modifier.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0047_repated_extern_modifier.rast rename to crates/parser/test_data/parser/err/0047_repated_extern_modifier.rast diff --git a/crates/parser/test_data/parser/err/0047_repated_extern_modifier.rs b/crates/parser/test_data/parser/err/0047_repated_extern_modifier.rs new file mode 100644 index 0000000000..db32b98dfb --- /dev/null +++ b/crates/parser/test_data/parser/err/0047_repated_extern_modifier.rs @@ -0,0 +1 @@ +extern "C" extern "C" diff --git a/crates/parser/test_data/parser/err/0047_repated_extern_modifier.txt b/crates/parser/test_data/parser/err/0047_repated_extern_modifier.txt new file mode 100644 index 0000000000..4b2a740362 --- /dev/null +++ b/crates/parser/test_data/parser/err/0047_repated_extern_modifier.txt @@ -0,0 +1,15 @@ +SOURCE_FILE + ERROR + ABI + EXTERN_KW "extern" + WHITESPACE " " + STRING "\"C\"" + WHITESPACE " " + ERROR + ABI + EXTERN_KW "extern" + WHITESPACE " " + STRING "\"C\"" + WHITESPACE "\n" +error 10: expected existential, fn, trait or impl +error 21: expected existential, fn, trait or impl diff --git a/crates/syntax/test_data/parser/err/0048_double_fish.rast b/crates/parser/test_data/parser/err/0048_double_fish.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0048_double_fish.rast rename to crates/parser/test_data/parser/err/0048_double_fish.rast diff --git a/crates/syntax/test_data/parser/err/0048_double_fish.rs b/crates/parser/test_data/parser/err/0048_double_fish.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0048_double_fish.rs rename to crates/parser/test_data/parser/err/0048_double_fish.rs diff --git a/crates/parser/test_data/parser/err/0048_double_fish.txt b/crates/parser/test_data/parser/err/0048_double_fish.txt new file mode 100644 index 0000000000..3a05bfee1e --- /dev/null +++ b/crates/parser/test_data/parser/err/0048_double_fish.txt @@ -0,0 +1,123 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + GENERIC_ARG_LIST + COLON2 "::" + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "Item" + GENERIC_ARG_LIST + COLON2 "::" + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "lol" + R_ANGLE ">" + COLON2 "::" + ERROR + L_ANGLE "<" + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "nope" + SHR ">>" + ERROR + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "g" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "Item" + GENERIC_ARG_LIST + COLON2 "::" + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "lol" + R_ANGLE ">" + COLON2 "::" + ERROR + L_ANGLE "<" + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "nope" + R_ANGLE ">" + WHITESPACE " " + ERROR + EQ "=" + WHITESPACE " " + EXPR_STMT + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 30: expected identifier +error 31: expected COMMA +error 31: expected R_ANGLE +error 31: expected SEMICOLON +error 37: expected expression +error 75: expected identifier +error 76: expected SEMICOLON +error 82: expected expression +error 83: expected SEMICOLON diff --git a/crates/syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast b/crates/parser/test_data/parser/inline/err/0001_array_type_missing_semi.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast rename to crates/parser/test_data/parser/inline/err/0001_array_type_missing_semi.rast diff --git a/crates/syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rs b/crates/parser/test_data/parser/inline/err/0001_array_type_missing_semi.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rs rename to crates/parser/test_data/parser/inline/err/0001_array_type_missing_semi.rs diff --git a/crates/parser/test_data/parser/inline/err/0001_array_type_missing_semi.txt b/crates/parser/test_data/parser/inline/err/0001_array_type_missing_semi.txt new file mode 100644 index 0000000000..ed739a7e39 --- /dev/null +++ b/crates/parser/test_data/parser/inline/err/0001_array_type_missing_semi.txt @@ -0,0 +1,27 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + SLICE_TYPE + L_BRACK "[" + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + ERROR + INT_NUMBER "92" + ERROR + R_BRACK "]" + ERROR + SEMICOLON ";" + WHITESPACE "\n" +error 12: expected `;` or `]` +error 12: expected SEMICOLON +error 13: expected an item +error 15: expected an item +error 16: expected an item diff --git a/crates/syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast b/crates/parser/test_data/parser/inline/err/0002_misplaced_label_err.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast rename to crates/parser/test_data/parser/inline/err/0002_misplaced_label_err.rast diff --git a/crates/syntax/test_data/parser/inline/err/0002_misplaced_label_err.rs b/crates/parser/test_data/parser/inline/err/0002_misplaced_label_err.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0002_misplaced_label_err.rs rename to crates/parser/test_data/parser/inline/err/0002_misplaced_label_err.rs diff --git a/crates/parser/test_data/parser/inline/err/0002_misplaced_label_err.txt b/crates/parser/test_data/parser/inline/err/0002_misplaced_label_err.txt new file mode 100644 index 0000000000..56cea4b156 --- /dev/null +++ b/crates/parser/test_data/parser/inline/err/0002_misplaced_label_err.txt @@ -0,0 +1,28 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + ERROR + LABEL + LIFETIME + LIFETIME_IDENT "'loop" + COLON ":" + WHITESPACE " " + IMPL + IMPL_KW "impl" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 22: expected a loop +error 27: expected type +error 27: expected `{` diff --git a/crates/syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast b/crates/parser/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast rename to crates/parser/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast diff --git a/crates/syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rs b/crates/parser/test_data/parser/inline/err/0003_pointer_type_no_mutability.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rs rename to crates/parser/test_data/parser/inline/err/0003_pointer_type_no_mutability.rs diff --git a/crates/parser/test_data/parser/inline/err/0003_pointer_type_no_mutability.txt b/crates/parser/test_data/parser/inline/err/0003_pointer_type_no_mutability.txt new file mode 100644 index 0000000000..354c4135a4 --- /dev/null +++ b/crates/parser/test_data/parser/inline/err/0003_pointer_type_no_mutability.txt @@ -0,0 +1,17 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PTR_TYPE + STAR "*" + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" +error 10: expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate) diff --git a/crates/syntax/test_data/parser/inline/err/0004_impl_type.rast b/crates/parser/test_data/parser/inline/err/0004_impl_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0004_impl_type.rast rename to crates/parser/test_data/parser/inline/err/0004_impl_type.rast diff --git a/crates/syntax/test_data/parser/inline/err/0004_impl_type.rs b/crates/parser/test_data/parser/inline/err/0004_impl_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0004_impl_type.rs rename to crates/parser/test_data/parser/inline/err/0004_impl_type.rs diff --git a/crates/parser/test_data/parser/inline/err/0004_impl_type.txt b/crates/parser/test_data/parser/inline/err/0004_impl_type.txt new file mode 100644 index 0000000000..dbeb878a2e --- /dev/null +++ b/crates/parser/test_data/parser/inline/err/0004_impl_type.txt @@ -0,0 +1,79 @@ +SOURCE_FILE + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Type" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Trait1" + WHITESPACE " " + FOR_KW "for" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + IMPL + IMPL_KW "impl" + WHITESPACE " " + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "NotType" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Trait2" + WHITESPACE " " + FOR_KW "for" + WHITESPACE " " + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "NotType" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" +error 38: expected trait or type +error 38: expected `{` +error 70: expected trait or type +error 70: expected `{` diff --git a/crates/syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast b/crates/parser/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast rename to crates/parser/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast diff --git a/crates/syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rs b/crates/parser/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rs rename to crates/parser/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rs diff --git a/crates/parser/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt b/crates/parser/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt new file mode 100644 index 0000000000..eb05952939 --- /dev/null +++ b/crates/parser/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt @@ -0,0 +1,23 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "F" + WHITESPACE " " + EQ "=" + WHITESPACE " " + UNSAFE_KW "unsafe" + WHITESPACE " " + ERROR + L_PAREN "(" + ERROR + R_PAREN ")" + ERROR + SEMICOLON ";" + WHITESPACE "\n" +error 15: expected `fn` +error 15: expected SEMICOLON +error 16: expected an item +error 17: expected an item +error 18: expected an item diff --git a/crates/syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast b/crates/parser/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast rename to crates/parser/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast diff --git a/crates/syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rs b/crates/parser/test_data/parser/inline/err/0006_unsafe_block_in_mod.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rs rename to crates/parser/test_data/parser/inline/err/0006_unsafe_block_in_mod.rs diff --git a/crates/parser/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt b/crates/parser/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt new file mode 100644 index 0000000000..77c2b56adf --- /dev/null +++ b/crates/parser/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt @@ -0,0 +1,37 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE " " + ERROR + UNSAFE_KW "unsafe" + WHITESPACE " " + ERROR + L_CURLY "{" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "bar" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" +error 11: expected an item +error 18: expected an item diff --git a/crates/syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast b/crates/parser/test_data/parser/inline/err/0007_async_without_semicolon.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast rename to crates/parser/test_data/parser/inline/err/0007_async_without_semicolon.rast diff --git a/crates/syntax/test_data/parser/inline/err/0007_async_without_semicolon.rs b/crates/parser/test_data/parser/inline/err/0007_async_without_semicolon.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0007_async_without_semicolon.rs rename to crates/parser/test_data/parser/inline/err/0007_async_without_semicolon.rs diff --git a/crates/parser/test_data/parser/inline/err/0007_async_without_semicolon.txt b/crates/parser/test_data/parser/inline/err/0007_async_without_semicolon.txt new file mode 100644 index 0000000000..bf20d5fa4f --- /dev/null +++ b/crates/parser/test_data/parser/inline/err/0007_async_without_semicolon.txt @@ -0,0 +1,32 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + BLOCK_EXPR + ASYNC_KW "async" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" +error 27: expected SEMICOLON diff --git a/crates/syntax/test_data/parser/inline/err/0008_pub_expr.rast b/crates/parser/test_data/parser/inline/err/0008_pub_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0008_pub_expr.rast rename to crates/parser/test_data/parser/inline/err/0008_pub_expr.rast diff --git a/crates/syntax/test_data/parser/inline/err/0008_pub_expr.rs b/crates/parser/test_data/parser/inline/err/0008_pub_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0008_pub_expr.rs rename to crates/parser/test_data/parser/inline/err/0008_pub_expr.rs diff --git a/crates/parser/test_data/parser/inline/err/0008_pub_expr.txt b/crates/parser/test_data/parser/inline/err/0008_pub_expr.txt new file mode 100644 index 0000000000..0ae9f64e7e --- /dev/null +++ b/crates/parser/test_data/parser/inline/err/0008_pub_expr.txt @@ -0,0 +1,26 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + ERROR + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + EXPR_STMT + LITERAL + INT_NUMBER "92" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" +error 14: expected an item diff --git a/crates/syntax/test_data/parser/inline/err/0013_anonymous_static.rast b/crates/parser/test_data/parser/inline/err/0013_anonymous_static.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0013_anonymous_static.rast rename to crates/parser/test_data/parser/inline/err/0013_anonymous_static.rast diff --git a/crates/syntax/test_data/parser/inline/err/0013_anonymous_static.rs b/crates/parser/test_data/parser/inline/err/0013_anonymous_static.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0013_anonymous_static.rs rename to crates/parser/test_data/parser/inline/err/0013_anonymous_static.rs diff --git a/crates/parser/test_data/parser/inline/err/0013_anonymous_static.txt b/crates/parser/test_data/parser/inline/err/0013_anonymous_static.txt new file mode 100644 index 0000000000..823db94f58 --- /dev/null +++ b/crates/parser/test_data/parser/inline/err/0013_anonymous_static.txt @@ -0,0 +1,21 @@ +SOURCE_FILE + STATIC + STATIC_KW "static" + WHITESPACE " " + ERROR + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "5" + SEMICOLON ";" + WHITESPACE "\n" +error 7: expected a name diff --git a/crates/syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast b/crates/parser/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast rename to crates/parser/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast diff --git a/crates/syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rs b/crates/parser/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rs rename to crates/parser/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rs diff --git a/crates/parser/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.txt b/crates/parser/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.txt new file mode 100644 index 0000000000..f511960040 --- /dev/null +++ b/crates/parser/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.txt @@ -0,0 +1,49 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + RECORD_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_EXPR_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_EXPR_FIELD + NAME_REF + IDENT "field" + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + CALL_EXPR + PATH_EXPR + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "default" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" +error 25: expected COLON diff --git a/crates/syntax/test_data/parser/inline/err/0014_struct_field_recover.rast b/crates/parser/test_data/parser/inline/err/0014_struct_field_recover.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0014_struct_field_recover.rast rename to crates/parser/test_data/parser/inline/err/0014_struct_field_recover.rast diff --git a/crates/syntax/test_data/parser/inline/err/0014_struct_field_recover.rs b/crates/parser/test_data/parser/inline/err/0014_struct_field_recover.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0014_struct_field_recover.rs rename to crates/parser/test_data/parser/inline/err/0014_struct_field_recover.rs diff --git a/crates/parser/test_data/parser/inline/err/0014_struct_field_recover.txt b/crates/parser/test_data/parser/inline/err/0014_struct_field_recover.txt new file mode 100644 index 0000000000..458d7f4e2f --- /dev/null +++ b/crates/parser/test_data/parser/inline/err/0014_struct_field_recover.txt @@ -0,0 +1,31 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_FIELD + NAME + IDENT "f" + WHITESPACE " " + RECORD_FIELD + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + NAME + IDENT "g" + COLON ":" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" +error 12: expected COLON +error 12: expected type +error 12: expected COMMA diff --git a/crates/syntax/test_data/parser/inline/err/0015_empty_segment.rast b/crates/parser/test_data/parser/inline/err/0015_empty_segment.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0015_empty_segment.rast rename to crates/parser/test_data/parser/inline/err/0015_empty_segment.rast diff --git a/crates/syntax/test_data/parser/inline/err/0015_empty_segment.rs b/crates/parser/test_data/parser/inline/err/0015_empty_segment.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0015_empty_segment.rs rename to crates/parser/test_data/parser/inline/err/0015_empty_segment.rs diff --git a/crates/parser/test_data/parser/inline/err/0015_empty_segment.txt b/crates/parser/test_data/parser/inline/err/0015_empty_segment.txt new file mode 100644 index 0000000000..b03f5ad9f7 --- /dev/null +++ b/crates/parser/test_data/parser/inline/err/0015_empty_segment.txt @@ -0,0 +1,14 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH_SEGMENT + NAME_REF + CRATE_KW "crate" + COLON2 "::" + SEMICOLON ";" + WHITESPACE "\n" +error 11: expected identifier diff --git a/crates/syntax/test_data/parser/inline/err/0015_missing_fn_param_type.rast b/crates/parser/test_data/parser/inline/err/0015_missing_fn_param_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0015_missing_fn_param_type.rast rename to crates/parser/test_data/parser/inline/err/0015_missing_fn_param_type.rast diff --git a/crates/syntax/test_data/parser/inline/err/0015_missing_fn_param_type.rs b/crates/parser/test_data/parser/inline/err/0015_missing_fn_param_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/err/0015_missing_fn_param_type.rs rename to crates/parser/test_data/parser/inline/err/0015_missing_fn_param_type.rs diff --git a/crates/parser/test_data/parser/inline/err/0015_missing_fn_param_type.txt b/crates/parser/test_data/parser/inline/err/0015_missing_fn_param_type.txt new file mode 100644 index 0000000000..e72df374d1 --- /dev/null +++ b/crates/parser/test_data/parser/inline/err/0015_missing_fn_param_type.txt @@ -0,0 +1,53 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "x" + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "y" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "z" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "t" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" +error 6: missing type for function parameter +error 6: expected COMMA +error 16: missing type for function parameter diff --git a/crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rast b/crates/parser/test_data/parser/inline/ok/0002_use_tree_list.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rast rename to crates/parser/test_data/parser/inline/ok/0002_use_tree_list.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rs b/crates/parser/test_data/parser/inline/ok/0002_use_tree_list.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rs rename to crates/parser/test_data/parser/inline/ok/0002_use_tree_list.rs diff --git a/crates/parser/test_data/parser/inline/ok/0002_use_tree_list.txt b/crates/parser/test_data/parser/inline/ok/0002_use_tree_list.txt new file mode 100644 index 0000000000..f3b1129f27 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0002_use_tree_list.txt @@ -0,0 +1,29 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + USE_TREE_LIST + L_CURLY "{" + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + COMMA "," + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "b" + COMMA "," + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "c" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0003_where_pred_for.rast b/crates/parser/test_data/parser/inline/ok/0003_where_pred_for.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0003_where_pred_for.rast rename to crates/parser/test_data/parser/inline/ok/0003_where_pred_for.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0003_where_pred_for.rs b/crates/parser/test_data/parser/inline/ok/0003_where_pred_for.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0003_where_pred_for.rs rename to crates/parser/test_data/parser/inline/ok/0003_where_pred_for.rs diff --git a/crates/parser/test_data/parser/inline/ok/0003_where_pred_for.txt b/crates/parser/test_data/parser/inline/ok/0003_where_pred_for.txt new file mode 100644 index 0000000000..8407e99f61 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0003_where_pred_for.txt @@ -0,0 +1,63 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "for_trait" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "F" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n" + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE "\n " + WHERE_PRED + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "F" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Fn" + PARAM_LIST + L_PAREN "(" + PARAM + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "str" + R_PAREN ")" + WHITESPACE "\n" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast b/crates/parser/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast rename to crates/parser/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rs b/crates/parser/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rs rename to crates/parser/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rs diff --git a/crates/parser/test_data/parser/inline/ok/0004_value_parameters_no_patterns.txt b/crates/parser/test_data/parser/inline/ok/0004_value_parameters_no_patterns.txt new file mode 100644 index 0000000000..902b06484c --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0004_value_parameters_no_patterns.txt @@ -0,0 +1,60 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "F" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Box" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Fn" + PARAM_LIST + L_PAREN "(" + PARAM + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + COMMA "," + WHITESPACE " " + PARAM + REF_TYPE + AMP "&" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + COMMA "," + WHITESPACE " " + PARAM + REF_TYPE + AMP "&" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + COMMA "," + WHITESPACE " " + PARAM + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0005_function_type_params.rast b/crates/parser/test_data/parser/inline/ok/0005_function_type_params.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0005_function_type_params.rast rename to crates/parser/test_data/parser/inline/ok/0005_function_type_params.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0005_function_type_params.rs b/crates/parser/test_data/parser/inline/ok/0005_function_type_params.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0005_function_type_params.rs rename to crates/parser/test_data/parser/inline/ok/0005_function_type_params.rs diff --git a/crates/parser/test_data/parser/inline/ok/0005_function_type_params.txt b/crates/parser/test_data/parser/inline/ok/0005_function_type_params.txt new file mode 100644 index 0000000000..3858e3eed5 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0005_function_type_params.txt @@ -0,0 +1,38 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Clone" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Copy" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0006_self_param.rast b/crates/parser/test_data/parser/inline/ok/0006_self_param.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0006_self_param.rast rename to crates/parser/test_data/parser/inline/ok/0006_self_param.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0006_self_param.rs b/crates/parser/test_data/parser/inline/ok/0006_self_param.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0006_self_param.rs rename to crates/parser/test_data/parser/inline/ok/0006_self_param.rs diff --git a/crates/parser/test_data/parser/inline/ok/0006_self_param.txt b/crates/parser/test_data/parser/inline/ok/0006_self_param.txt new file mode 100644 index 0000000000..67e2823639 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0006_self_param.txt @@ -0,0 +1,128 @@ +SOURCE_FILE + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "a" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + NAME + SELF_KW "self" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "b" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + AMP "&" + NAME + SELF_KW "self" + COMMA "," + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "c" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + NAME + SELF_KW "self" + COMMA "," + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "d" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + MUT_KW "mut" + WHITESPACE " " + NAME + SELF_KW "self" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "e" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + MUT_KW "mut" + WHITESPACE " " + NAME + SELF_KW "self" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0007_type_param_bounds.rast b/crates/parser/test_data/parser/inline/ok/0007_type_param_bounds.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0007_type_param_bounds.rast rename to crates/parser/test_data/parser/inline/ok/0007_type_param_bounds.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0007_type_param_bounds.rs b/crates/parser/test_data/parser/inline/ok/0007_type_param_bounds.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0007_type_param_bounds.rs rename to crates/parser/test_data/parser/inline/ok/0007_type_param_bounds.rs diff --git a/crates/parser/test_data/parser/inline/ok/0007_type_param_bounds.txt b/crates/parser/test_data/parser/inline/ok/0007_type_param_bounds.txt new file mode 100644 index 0000000000..dee860c241 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0007_type_param_bounds.txt @@ -0,0 +1,53 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + QUESTION "?" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Sized" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + L_PAREN "(" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Copy" + R_PAREN ")" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + TILDE "~" + CONST_KW "const" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Drop" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0008_path_part.rast b/crates/parser/test_data/parser/inline/ok/0008_path_part.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0008_path_part.rast rename to crates/parser/test_data/parser/inline/ok/0008_path_part.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0008_path_part.rs b/crates/parser/test_data/parser/inline/ok/0008_path_part.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0008_path_part.rs rename to crates/parser/test_data/parser/inline/ok/0008_path_part.rs diff --git a/crates/parser/test_data/parser/inline/ok/0008_path_part.txt b/crates/parser/test_data/parser/inline/ok/0008_path_part.txt new file mode 100644 index 0000000000..4ccda19a8d --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0008_path_part.txt @@ -0,0 +1,98 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + PATH_PAT + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Bar" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + PATH_PAT + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "Bar" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + RECORD_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Bar" + WHITESPACE " " + RECORD_PAT_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + REST_PAT + DOT2 ".." + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Bar" + L_PAREN "(" + REST_PAT + DOT2 ".." + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0009_loop_expr.rast b/crates/parser/test_data/parser/inline/ok/0009_loop_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0009_loop_expr.rast rename to crates/parser/test_data/parser/inline/ok/0009_loop_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0009_loop_expr.rs b/crates/parser/test_data/parser/inline/ok/0009_loop_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0009_loop_expr.rs rename to crates/parser/test_data/parser/inline/ok/0009_loop_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0009_loop_expr.txt b/crates/parser/test_data/parser/inline/ok/0009_loop_expr.txt new file mode 100644 index 0000000000..ab3b49b0d6 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0009_loop_expr.txt @@ -0,0 +1,26 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + LOOP_EXPR + LOOP_KW "loop" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0010_extern_block.rast b/crates/parser/test_data/parser/inline/ok/0010_extern_block.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0010_extern_block.rast rename to crates/parser/test_data/parser/inline/ok/0010_extern_block.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0010_extern_block.rs b/crates/parser/test_data/parser/inline/ok/0010_extern_block.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0010_extern_block.rs rename to crates/parser/test_data/parser/inline/ok/0010_extern_block.rs diff --git a/crates/parser/test_data/parser/inline/ok/0010_extern_block.txt b/crates/parser/test_data/parser/inline/ok/0010_extern_block.txt new file mode 100644 index 0000000000..7a3cd6a0df --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0010_extern_block.txt @@ -0,0 +1,21 @@ +SOURCE_FILE + EXTERN_BLOCK + UNSAFE_KW "unsafe" + WHITESPACE " " + ABI + EXTERN_KW "extern" + WHITESPACE " " + STRING "\"C\"" + WHITESPACE " " + EXTERN_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + EXTERN_BLOCK + ABI + EXTERN_KW "extern" + WHITESPACE " " + EXTERN_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0011_field_expr.rast b/crates/parser/test_data/parser/inline/ok/0011_field_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0011_field_expr.rast rename to crates/parser/test_data/parser/inline/ok/0011_field_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0011_field_expr.rs b/crates/parser/test_data/parser/inline/ok/0011_field_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0011_field_expr.rs rename to crates/parser/test_data/parser/inline/ok/0011_field_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0011_field_expr.txt b/crates/parser/test_data/parser/inline/ok/0011_field_expr.txt new file mode 100644 index 0000000000..8498724b9e --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0011_field_expr.txt @@ -0,0 +1,60 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + FIELD_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + DOT "." + NAME_REF + IDENT "foo" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + FIELD_EXPR + FIELD_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + DOT "." + NAME_REF + INT_NUMBER "0" + DOT "." + NAME_REF + IDENT "bar" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + FIELD_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + DOT "." + NAME_REF + INT_NUMBER "0" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rast b/crates/parser/test_data/parser/inline/ok/0012_type_item_where_clause.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rast rename to crates/parser/test_data/parser/inline/ok/0012_type_item_where_clause.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rs b/crates/parser/test_data/parser/inline/ok/0012_type_item_where_clause.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rs rename to crates/parser/test_data/parser/inline/ok/0012_type_item_where_clause.rs diff --git a/crates/parser/test_data/parser/inline/ok/0012_type_item_where_clause.txt b/crates/parser/test_data/parser/inline/ok/0012_type_item_where_clause.txt new file mode 100644 index 0000000000..7210b73895 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0012_type_item_where_clause.txt @@ -0,0 +1,33 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "Foo" + WHITESPACE " " + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE " " + WHERE_PRED + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Copy" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rast b/crates/parser/test_data/parser/inline/ok/0013_pointer_type_mut.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rast rename to crates/parser/test_data/parser/inline/ok/0013_pointer_type_mut.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rs b/crates/parser/test_data/parser/inline/ok/0013_pointer_type_mut.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rs rename to crates/parser/test_data/parser/inline/ok/0013_pointer_type_mut.rs diff --git a/crates/parser/test_data/parser/inline/ok/0013_pointer_type_mut.txt b/crates/parser/test_data/parser/inline/ok/0013_pointer_type_mut.txt new file mode 100644 index 0000000000..bfe7ed5b40 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0013_pointer_type_mut.txt @@ -0,0 +1,35 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "M" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PTR_TYPE + STAR "*" + MUT_KW "mut" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "C" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PTR_TYPE + STAR "*" + MUT_KW "mut" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0014_never_type.rast b/crates/parser/test_data/parser/inline/ok/0014_never_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0014_never_type.rast rename to crates/parser/test_data/parser/inline/ok/0014_never_type.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0014_never_type.rs b/crates/parser/test_data/parser/inline/ok/0014_never_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0014_never_type.rs rename to crates/parser/test_data/parser/inline/ok/0014_never_type.rs diff --git a/crates/parser/test_data/parser/inline/ok/0014_never_type.txt b/crates/parser/test_data/parser/inline/ok/0014_never_type.txt new file mode 100644 index 0000000000..53dbf3999b --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0014_never_type.txt @@ -0,0 +1,13 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "Never" + WHITESPACE " " + EQ "=" + WHITESPACE " " + NEVER_TYPE + BANG "!" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0015_continue_expr.rast b/crates/parser/test_data/parser/inline/ok/0015_continue_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0015_continue_expr.rast rename to crates/parser/test_data/parser/inline/ok/0015_continue_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0015_continue_expr.rs b/crates/parser/test_data/parser/inline/ok/0015_continue_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0015_continue_expr.rs rename to crates/parser/test_data/parser/inline/ok/0015_continue_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0015_continue_expr.txt b/crates/parser/test_data/parser/inline/ok/0015_continue_expr.txt new file mode 100644 index 0000000000..5d80a57a2e --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0015_continue_expr.txt @@ -0,0 +1,38 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LOOP_EXPR + LOOP_KW "loop" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + CONTINUE_EXPR + CONTINUE_KW "continue" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CONTINUE_EXPR + CONTINUE_KW "continue" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'l" + SEMICOLON ";" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0017_array_type.rast b/crates/parser/test_data/parser/inline/ok/0017_array_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0017_array_type.rast rename to crates/parser/test_data/parser/inline/ok/0017_array_type.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0017_array_type.rs b/crates/parser/test_data/parser/inline/ok/0017_array_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0017_array_type.rs rename to crates/parser/test_data/parser/inline/ok/0017_array_type.rs diff --git a/crates/parser/test_data/parser/inline/ok/0017_array_type.txt b/crates/parser/test_data/parser/inline/ok/0017_array_type.txt new file mode 100644 index 0000000000..2a5c644d46 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0017_array_type.txt @@ -0,0 +1,21 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + ARRAY_TYPE + L_BRACK "[" + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + R_BRACK "]" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0018_arb_self_types.rast b/crates/parser/test_data/parser/inline/ok/0018_arb_self_types.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0018_arb_self_types.rast rename to crates/parser/test_data/parser/inline/ok/0018_arb_self_types.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0018_arb_self_types.rs b/crates/parser/test_data/parser/inline/ok/0018_arb_self_types.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0018_arb_self_types.rs rename to crates/parser/test_data/parser/inline/ok/0018_arb_self_types.rs diff --git a/crates/parser/test_data/parser/inline/ok/0018_arb_self_types.txt b/crates/parser/test_data/parser/inline/ok/0018_arb_self_types.txt new file mode 100644 index 0000000000..d542e0edc7 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0018_arb_self_types.txt @@ -0,0 +1,76 @@ +SOURCE_FILE + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "a" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + NAME + SELF_KW "self" + COLON ":" + WHITESPACE " " + REF_TYPE + AMP "&" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Self" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "b" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + MUT_KW "mut" + WHITESPACE " " + NAME + SELF_KW "self" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Box" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Self" + R_ANGLE ">" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0019_unary_expr.rast b/crates/parser/test_data/parser/inline/ok/0019_unary_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0019_unary_expr.rast rename to crates/parser/test_data/parser/inline/ok/0019_unary_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0019_unary_expr.rs b/crates/parser/test_data/parser/inline/ok/0019_unary_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0019_unary_expr.rs rename to crates/parser/test_data/parser/inline/ok/0019_unary_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0019_unary_expr.txt b/crates/parser/test_data/parser/inline/ok/0019_unary_expr.txt new file mode 100644 index 0000000000..525b267458 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0019_unary_expr.txt @@ -0,0 +1,45 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + PREFIX_EXPR + STAR "*" + PREFIX_EXPR + STAR "*" + REF_EXPR + AMP "&" + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + PREFIX_EXPR + BANG "!" + PREFIX_EXPR + BANG "!" + LITERAL + TRUE_KW "true" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + PREFIX_EXPR + MINUS "-" + PREFIX_EXPR + MINUS "-" + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0021_assoc_item_list.rast b/crates/parser/test_data/parser/inline/ok/0021_assoc_item_list.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0021_assoc_item_list.rast rename to crates/parser/test_data/parser/inline/ok/0021_assoc_item_list.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0021_assoc_item_list.rs b/crates/parser/test_data/parser/inline/ok/0021_assoc_item_list.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0021_assoc_item_list.rs rename to crates/parser/test_data/parser/inline/ok/0021_assoc_item_list.rs diff --git a/crates/parser/test_data/parser/inline/ok/0021_assoc_item_list.txt b/crates/parser/test_data/parser/inline/ok/0021_assoc_item_list.txt new file mode 100644 index 0000000000..def7373c9d --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0021_assoc_item_list.txt @@ -0,0 +1,81 @@ +SOURCE_FILE + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "F" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "A" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + SEMICOLON ";" + WHITESPACE "\n " + CONST + CONST_KW "const" + WHITESPACE " " + NAME + IDENT "B" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + SEMICOLON ";" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "bar" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + AMP "&" + NAME + SELF_KW "self" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0022_crate_visibility.rast b/crates/parser/test_data/parser/inline/ok/0022_crate_visibility.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0022_crate_visibility.rast rename to crates/parser/test_data/parser/inline/ok/0022_crate_visibility.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0022_crate_visibility.rs b/crates/parser/test_data/parser/inline/ok/0022_crate_visibility.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0022_crate_visibility.rs rename to crates/parser/test_data/parser/inline/ok/0022_crate_visibility.rs diff --git a/crates/parser/test_data/parser/inline/ok/0022_crate_visibility.txt b/crates/parser/test_data/parser/inline/ok/0022_crate_visibility.txt new file mode 100644 index 0000000000..8738292a9f --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0022_crate_visibility.txt @@ -0,0 +1,49 @@ +SOURCE_FILE + STRUCT + VISIBILITY + PUB_KW "pub" + L_PAREN "(" + PATH + PATH_SEGMENT + NAME_REF + CRATE_KW "crate" + R_PAREN ")" + WHITESPACE " " + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + VISIBILITY + PUB_KW "pub" + L_PAREN "(" + PATH + PATH_SEGMENT + NAME_REF + SELF_KW "self" + R_PAREN ")" + WHITESPACE " " + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + VISIBILITY + PUB_KW "pub" + L_PAREN "(" + PATH + PATH_SEGMENT + NAME_REF + SUPER_KW "super" + R_PAREN ")" + WHITESPACE " " + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0023_placeholder_type.rast b/crates/parser/test_data/parser/inline/ok/0023_placeholder_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0023_placeholder_type.rast rename to crates/parser/test_data/parser/inline/ok/0023_placeholder_type.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0023_placeholder_type.rs b/crates/parser/test_data/parser/inline/ok/0023_placeholder_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0023_placeholder_type.rs rename to crates/parser/test_data/parser/inline/ok/0023_placeholder_type.rs diff --git a/crates/parser/test_data/parser/inline/ok/0023_placeholder_type.txt b/crates/parser/test_data/parser/inline/ok/0023_placeholder_type.txt new file mode 100644 index 0000000000..d9db1c34bf --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0023_placeholder_type.txt @@ -0,0 +1,13 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "Placeholder" + WHITESPACE " " + EQ "=" + WHITESPACE " " + INFER_TYPE + UNDERSCORE "_" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0024_slice_pat.rast b/crates/parser/test_data/parser/inline/ok/0024_slice_pat.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0024_slice_pat.rast rename to crates/parser/test_data/parser/inline/ok/0024_slice_pat.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0024_slice_pat.rs b/crates/parser/test_data/parser/inline/ok/0024_slice_pat.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0024_slice_pat.rs rename to crates/parser/test_data/parser/inline/ok/0024_slice_pat.rs diff --git a/crates/parser/test_data/parser/inline/ok/0024_slice_pat.txt b/crates/parser/test_data/parser/inline/ok/0024_slice_pat.txt new file mode 100644 index 0000000000..235a9d7f40 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0024_slice_pat.txt @@ -0,0 +1,42 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + SLICE_PAT + L_BRACK "[" + IDENT_PAT + NAME + IDENT "a" + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "b" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + R_BRACK "]" + WHITESPACE " " + EQ "=" + WHITESPACE " " + ARRAY_EXPR + L_BRACK "[" + R_BRACK "]" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0025_slice_type.rast b/crates/parser/test_data/parser/inline/ok/0025_slice_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0025_slice_type.rast rename to crates/parser/test_data/parser/inline/ok/0025_slice_type.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0025_slice_type.rs b/crates/parser/test_data/parser/inline/ok/0025_slice_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0025_slice_type.rs rename to crates/parser/test_data/parser/inline/ok/0025_slice_type.rs diff --git a/crates/parser/test_data/parser/inline/ok/0025_slice_type.txt b/crates/parser/test_data/parser/inline/ok/0025_slice_type.txt new file mode 100644 index 0000000000..0bcb315248 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0025_slice_type.txt @@ -0,0 +1,17 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + SLICE_TYPE + L_BRACK "[" + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + R_BRACK "]" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast b/crates/parser/test_data/parser/inline/ok/0026_tuple_pat_fields.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast rename to crates/parser/test_data/parser/inline/ok/0026_tuple_pat_fields.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rs b/crates/parser/test_data/parser/inline/ok/0026_tuple_pat_fields.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rs rename to crates/parser/test_data/parser/inline/ok/0026_tuple_pat_fields.rs diff --git a/crates/parser/test_data/parser/inline/ok/0026_tuple_pat_fields.txt b/crates/parser/test_data/parser/inline/ok/0026_tuple_pat_fields.txt new file mode 100644 index 0000000000..3cdaf32b57 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0026_tuple_pat_fields.txt @@ -0,0 +1,105 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + L_PAREN "(" + WILDCARD_PAT + UNDERSCORE "_" + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + L_PAREN "(" + WILDCARD_PAT + UNDERSCORE "_" + COMMA "," + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + L_PAREN "(" + WILDCARD_PAT + UNDERSCORE "_" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + WHITESPACE " " + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "x" + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0027_ref_pat.rast b/crates/parser/test_data/parser/inline/ok/0027_ref_pat.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0027_ref_pat.rast rename to crates/parser/test_data/parser/inline/ok/0027_ref_pat.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0027_ref_pat.rs b/crates/parser/test_data/parser/inline/ok/0027_ref_pat.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0027_ref_pat.rs rename to crates/parser/test_data/parser/inline/ok/0027_ref_pat.rs diff --git a/crates/parser/test_data/parser/inline/ok/0027_ref_pat.txt b/crates/parser/test_data/parser/inline/ok/0027_ref_pat.txt new file mode 100644 index 0000000000..4516fd0113 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0027_ref_pat.txt @@ -0,0 +1,50 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + REF_PAT + AMP "&" + IDENT_PAT + NAME + IDENT "a" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + REF_PAT + AMP "&" + MUT_KW "mut" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "b" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0028_impl_trait_type.rast b/crates/parser/test_data/parser/inline/ok/0028_impl_trait_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0028_impl_trait_type.rast rename to crates/parser/test_data/parser/inline/ok/0028_impl_trait_type.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0028_impl_trait_type.rs b/crates/parser/test_data/parser/inline/ok/0028_impl_trait_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0028_impl_trait_type.rs rename to crates/parser/test_data/parser/inline/ok/0028_impl_trait_type.rs diff --git a/crates/parser/test_data/parser/inline/ok/0028_impl_trait_type.txt b/crates/parser/test_data/parser/inline/ok/0028_impl_trait_type.txt new file mode 100644 index 0000000000..c7478da942 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0028_impl_trait_type.txt @@ -0,0 +1,45 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "A" + WHITESPACE " " + EQ "=" + WHITESPACE " " + IMPL_TRAIT_TYPE + IMPL_KW "impl" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Iterator" + GENERIC_ARG_LIST + L_ANGLE "<" + ASSOC_TYPE_ARG + NAME_REF + IDENT "Item" + EQ "=" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + GENERIC_ARG_LIST + L_ANGLE "<" + LIFETIME_ARG + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + R_ANGLE ">" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'a" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0029_cast_expr.rast b/crates/parser/test_data/parser/inline/ok/0029_cast_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0029_cast_expr.rast rename to crates/parser/test_data/parser/inline/ok/0029_cast_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0029_cast_expr.rs b/crates/parser/test_data/parser/inline/ok/0029_cast_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0029_cast_expr.rs rename to crates/parser/test_data/parser/inline/ok/0029_cast_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0029_cast_expr.txt b/crates/parser/test_data/parser/inline/ok/0029_cast_expr.txt new file mode 100644 index 0000000000..d53dde5381 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0029_cast_expr.txt @@ -0,0 +1,90 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + CAST_EXPR + LITERAL + INT_NUMBER "82" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + CAST_EXPR + LITERAL + INT_NUMBER "81" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i8" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + CAST_EXPR + LITERAL + INT_NUMBER "79" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i16" + WHITESPACE " " + MINUS "-" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + CAST_EXPR + LITERAL + INT_NUMBER "0x36" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + WHITESPACE " " + LTEQ "<=" + WHITESPACE " " + LITERAL + INT_NUMBER "0x37" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0030_cond.rast b/crates/parser/test_data/parser/inline/ok/0030_cond.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0030_cond.rast rename to crates/parser/test_data/parser/inline/ok/0030_cond.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0030_cond.rs b/crates/parser/test_data/parser/inline/ok/0030_cond.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0030_cond.rs rename to crates/parser/test_data/parser/inline/ok/0030_cond.rs diff --git a/crates/parser/test_data/parser/inline/ok/0030_cond.txt b/crates/parser/test_data/parser/inline/ok/0030_cond.txt new file mode 100644 index 0000000000..5b89937013 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0030_cond.txt @@ -0,0 +1,209 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + LET_KW "let" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + L_PAREN "(" + WILDCARD_PAT + UNDERSCORE "_" + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "None" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "bar" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + LET_KW "let" + WHITESPACE " " + OR_PAT + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + L_PAREN "(" + WILDCARD_PAT + UNDERSCORE "_" + R_PAREN ")" + WHITESPACE " " + PIPE "|" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + L_PAREN "(" + WILDCARD_PAT + UNDERSCORE "_" + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "None" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + LET_KW "let" + WHITESPACE " " + PIPE "|" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + L_PAREN "(" + WILDCARD_PAT + UNDERSCORE "_" + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "None" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + WHILE_EXPR + WHILE_KW "while" + WHITESPACE " " + CONDITION + LET_KW "let" + WHITESPACE " " + OR_PAT + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + L_PAREN "(" + WILDCARD_PAT + UNDERSCORE "_" + R_PAREN ")" + WHITESPACE " " + PIPE "|" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + L_PAREN "(" + WILDCARD_PAT + UNDERSCORE "_" + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "None" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + WHILE_EXPR + WHILE_KW "while" + WHITESPACE " " + CONDITION + LET_KW "let" + WHITESPACE " " + PIPE "|" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + L_PAREN "(" + WILDCARD_PAT + UNDERSCORE "_" + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "None" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0031_while_expr.rast b/crates/parser/test_data/parser/inline/ok/0031_while_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0031_while_expr.rast rename to crates/parser/test_data/parser/inline/ok/0031_while_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0031_while_expr.rs b/crates/parser/test_data/parser/inline/ok/0031_while_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0031_while_expr.rs rename to crates/parser/test_data/parser/inline/ok/0031_while_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0031_while_expr.txt b/crates/parser/test_data/parser/inline/ok/0031_while_expr.txt new file mode 100644 index 0000000000..fc1ca4934c --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0031_while_expr.txt @@ -0,0 +1,89 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + WHILE_EXPR + WHILE_KW "while" + WHITESPACE " " + CONDITION + LITERAL + TRUE_KW "true" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + WHILE_EXPR + WHILE_KW "while" + WHITESPACE " " + CONDITION + LET_KW "let" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + L_PAREN "(" + IDENT_PAT + NAME + IDENT "x" + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + METHOD_CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "it" + DOT "." + NAME_REF + IDENT "next" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + WHILE_EXPR + WHILE_KW "while" + WHITESPACE " " + CONDITION + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LITERAL + TRUE_KW "true" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rast b/crates/parser/test_data/parser/inline/ok/0032_fn_pointer_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rast rename to crates/parser/test_data/parser/inline/ok/0032_fn_pointer_type.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rs b/crates/parser/test_data/parser/inline/ok/0032_fn_pointer_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rs rename to crates/parser/test_data/parser/inline/ok/0032_fn_pointer_type.rs diff --git a/crates/parser/test_data/parser/inline/ok/0032_fn_pointer_type.txt b/crates/parser/test_data/parser/inline/ok/0032_fn_pointer_type.txt new file mode 100644 index 0000000000..608b0be160 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0032_fn_pointer_type.txt @@ -0,0 +1,98 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "A" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FN_PTR_TYPE + FN_KW "fn" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "B" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FN_PTR_TYPE + UNSAFE_KW "unsafe" + WHITESPACE " " + FN_KW "fn" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "C" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FN_PTR_TYPE + UNSAFE_KW "unsafe" + WHITESPACE " " + ABI + EXTERN_KW "extern" + WHITESPACE " " + STRING "\"C\"" + WHITESPACE " " + FN_KW "fn" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "D" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FN_PTR_TYPE + ABI + EXTERN_KW "extern" + WHITESPACE " " + STRING "\"C\"" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + PARAM_LIST + L_PAREN "(" + WHITESPACE " " + PARAM + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + WHITESPACE " " + COMMA "," + WHITESPACE " " + PARAM + DOT3 "..." + WHITESPACE " " + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0033_reference_type;.rast b/crates/parser/test_data/parser/inline/ok/0033_reference_type;.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0033_reference_type;.rast rename to crates/parser/test_data/parser/inline/ok/0033_reference_type;.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0033_reference_type;.rs b/crates/parser/test_data/parser/inline/ok/0033_reference_type;.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0033_reference_type;.rs rename to crates/parser/test_data/parser/inline/ok/0033_reference_type;.rs diff --git a/crates/parser/test_data/parser/inline/ok/0033_reference_type;.txt b/crates/parser/test_data/parser/inline/ok/0033_reference_type;.txt new file mode 100644 index 0000000000..b5c9d7a8df --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0033_reference_type;.txt @@ -0,0 +1,51 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "A" + WHITESPACE " " + EQ "=" + WHITESPACE " " + REF_TYPE + AMP "&" + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "B" + WHITESPACE " " + EQ "=" + WHITESPACE " " + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'static" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "C" + WHITESPACE " " + EQ "=" + WHITESPACE " " + REF_TYPE + AMP "&" + MUT_KW "mut" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0034_break_expr.rast b/crates/parser/test_data/parser/inline/ok/0034_break_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0034_break_expr.rast rename to crates/parser/test_data/parser/inline/ok/0034_break_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0034_break_expr.rs b/crates/parser/test_data/parser/inline/ok/0034_break_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0034_break_expr.rs rename to crates/parser/test_data/parser/inline/ok/0034_break_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0034_break_expr.txt b/crates/parser/test_data/parser/inline/ok/0034_break_expr.txt new file mode 100644 index 0000000000..06c053d0f8 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0034_break_expr.txt @@ -0,0 +1,57 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LOOP_EXPR + LOOP_KW "loop" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + BREAK_EXPR + BREAK_KW "break" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BREAK_EXPR + BREAK_KW "break" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'l" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BREAK_EXPR + BREAK_KW "break" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BREAK_EXPR + BREAK_KW "break" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'l" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + SEMICOLON ";" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0037_qual_paths.rast b/crates/parser/test_data/parser/inline/ok/0037_qual_paths.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0037_qual_paths.rast rename to crates/parser/test_data/parser/inline/ok/0037_qual_paths.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0037_qual_paths.rs b/crates/parser/test_data/parser/inline/ok/0037_qual_paths.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0037_qual_paths.rs rename to crates/parser/test_data/parser/inline/ok/0037_qual_paths.rs diff --git a/crates/parser/test_data/parser/inline/ok/0037_qual_paths.txt b/crates/parser/test_data/parser/inline/ok/0037_qual_paths.txt new file mode 100644 index 0000000000..8c66cfe599 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0037_qual_paths.txt @@ -0,0 +1,79 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "X" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH + PATH_SEGMENT + L_ANGLE "<" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "A" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "B" + R_ANGLE ">" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Output" + SEMICOLON ";" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH + PATH_SEGMENT + L_ANGLE "<" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "usize" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Default" + R_ANGLE ">" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "default" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0038_full_range_expr.rast b/crates/parser/test_data/parser/inline/ok/0038_full_range_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0038_full_range_expr.rast rename to crates/parser/test_data/parser/inline/ok/0038_full_range_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0038_full_range_expr.rs b/crates/parser/test_data/parser/inline/ok/0038_full_range_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0038_full_range_expr.rs rename to crates/parser/test_data/parser/inline/ok/0038_full_range_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0038_full_range_expr.txt b/crates/parser/test_data/parser/inline/ok/0038_full_range_expr.txt new file mode 100644 index 0000000000..9ffc076304 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0038_full_range_expr.txt @@ -0,0 +1,29 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + INDEX_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "xs" + L_BRACK "[" + RANGE_EXPR + DOT2 ".." + R_BRACK "]" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast b/crates/parser/test_data/parser/inline/ok/0040_crate_keyword_vis.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast rename to crates/parser/test_data/parser/inline/ok/0040_crate_keyword_vis.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rs b/crates/parser/test_data/parser/inline/ok/0040_crate_keyword_vis.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rs rename to crates/parser/test_data/parser/inline/ok/0040_crate_keyword_vis.rs diff --git a/crates/parser/test_data/parser/inline/ok/0040_crate_keyword_vis.txt b/crates/parser/test_data/parser/inline/ok/0040_crate_keyword_vis.txt new file mode 100644 index 0000000000..07b0210e44 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0040_crate_keyword_vis.txt @@ -0,0 +1,63 @@ +SOURCE_FILE + FN + VISIBILITY + CRATE_KW "crate" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_FIELD + VISIBILITY + CRATE_KW "crate" + WHITESPACE " " + NAME + IDENT "field" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "T" + TUPLE_FIELD_LIST + L_PAREN "(" + TUPLE_FIELD + VISIBILITY + CRATE_KW "crate" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0041_trait_item.rast b/crates/parser/test_data/parser/inline/ok/0041_trait_item.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0041_trait_item.rast rename to crates/parser/test_data/parser/inline/ok/0041_trait_item.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0041_trait_item.rs b/crates/parser/test_data/parser/inline/ok/0041_trait_item.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0041_trait_item.rs rename to crates/parser/test_data/parser/inline/ok/0041_trait_item.rs diff --git a/crates/parser/test_data/parser/inline/ok/0041_trait_item.txt b/crates/parser/test_data/parser/inline/ok/0041_trait_item.txt new file mode 100644 index 0000000000..86d92406d8 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0041_trait_item.txt @@ -0,0 +1,31 @@ +SOURCE_FILE + TRAIT + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE " " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "new" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Self" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0042_call_expr.rast b/crates/parser/test_data/parser/inline/ok/0042_call_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0042_call_expr.rast rename to crates/parser/test_data/parser/inline/ok/0042_call_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0042_call_expr.rs b/crates/parser/test_data/parser/inline/ok/0042_call_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0042_call_expr.rs rename to crates/parser/test_data/parser/inline/ok/0042_call_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0042_call_expr.txt b/crates/parser/test_data/parser/inline/ok/0042_call_expr.txt new file mode 100644 index 0000000000..19cc8d5ac7 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0042_call_expr.txt @@ -0,0 +1,148 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "f" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + CALL_EXPR + CALL_EXPR + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "f" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + ARG_LIST + L_PAREN "(" + LITERAL + INT_NUMBER "1" + R_PAREN ")" + ARG_LIST + L_PAREN "(" + LITERAL + INT_NUMBER "1" + COMMA "," + WHITESPACE " " + LITERAL + INT_NUMBER "2" + COMMA "," + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "f" + ARG_LIST + L_PAREN "(" + CALL_EXPR + PATH_EXPR + PATH + PATH + PATH_SEGMENT + L_ANGLE "<" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + R_ANGLE ">" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "func" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "f" + ARG_LIST + L_PAREN "(" + CALL_EXPR + PATH_EXPR + PATH + PATH + PATH_SEGMENT + L_ANGLE "<" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Trait" + R_ANGLE ">" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "func" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0044_block_items.rast b/crates/parser/test_data/parser/inline/ok/0044_block_items.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0044_block_items.rast rename to crates/parser/test_data/parser/inline/ok/0044_block_items.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0044_block_items.rs b/crates/parser/test_data/parser/inline/ok/0044_block_items.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0044_block_items.rs rename to crates/parser/test_data/parser/inline/ok/0044_block_items.rs diff --git a/crates/parser/test_data/parser/inline/ok/0044_block_items.txt b/crates/parser/test_data/parser/inline/ok/0044_block_items.txt new file mode 100644 index 0000000000..2e4b515cab --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0044_block_items.txt @@ -0,0 +1,30 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "a" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "b" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast b/crates/parser/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast rename to crates/parser/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rs b/crates/parser/test_data/parser/inline/ok/0045_param_list_opt_patterns.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rs rename to crates/parser/test_data/parser/inline/ok/0045_param_list_opt_patterns.rs diff --git a/crates/parser/test_data/parser/inline/ok/0045_param_list_opt_patterns.txt b/crates/parser/test_data/parser/inline/ok/0045_param_list_opt_patterns.txt new file mode 100644 index 0000000000..e9d93a0d0a --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0045_param_list_opt_patterns.txt @@ -0,0 +1,48 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "F" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "FnMut" + PARAM_LIST + L_PAREN "(" + PARAM + REF_TYPE + AMP "&" + MUT_KW "mut" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + GENERIC_ARG_LIST + L_ANGLE "<" + LIFETIME_ARG + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + R_PAREN ")" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rast b/crates/parser/test_data/parser/inline/ok/0046_singleton_tuple_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rast rename to crates/parser/test_data/parser/inline/ok/0046_singleton_tuple_type.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rs b/crates/parser/test_data/parser/inline/ok/0046_singleton_tuple_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rs rename to crates/parser/test_data/parser/inline/ok/0046_singleton_tuple_type.rs diff --git a/crates/parser/test_data/parser/inline/ok/0046_singleton_tuple_type.txt b/crates/parser/test_data/parser/inline/ok/0046_singleton_tuple_type.txt new file mode 100644 index 0000000000..0129955d13 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0046_singleton_tuple_type.txt @@ -0,0 +1,20 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + COMMA "," + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast b/crates/parser/test_data/parser/inline/ok/0048_path_type_with_bounds.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast rename to crates/parser/test_data/parser/inline/ok/0048_path_type_with_bounds.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rs b/crates/parser/test_data/parser/inline/ok/0048_path_type_with_bounds.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rs rename to crates/parser/test_data/parser/inline/ok/0048_path_type_with_bounds.rs diff --git a/crates/parser/test_data/parser/inline/ok/0048_path_type_with_bounds.txt b/crates/parser/test_data/parser/inline/ok/0048_path_type_with_bounds.txt new file mode 100644 index 0000000000..a059e124ae --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0048_path_type_with_bounds.txt @@ -0,0 +1,85 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Box" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + DYN_TRAIT_TYPE + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'f" + R_ANGLE ">" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Box" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + DYN_TRAIT_TYPE + DYN_KW "dyn" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'f" + R_ANGLE ">" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0050_fn_decl.rast b/crates/parser/test_data/parser/inline/ok/0050_fn_decl.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0050_fn_decl.rast rename to crates/parser/test_data/parser/inline/ok/0050_fn_decl.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0050_fn_decl.rs b/crates/parser/test_data/parser/inline/ok/0050_fn_decl.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0050_fn_decl.rs rename to crates/parser/test_data/parser/inline/ok/0050_fn_decl.rs diff --git a/crates/parser/test_data/parser/inline/ok/0050_fn_decl.txt b/crates/parser/test_data/parser/inline/ok/0050_fn_decl.txt new file mode 100644 index 0000000000..f7fac807f4 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0050_fn_decl.txt @@ -0,0 +1,22 @@ +SOURCE_FILE + TRAIT + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE " " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0051_unit_type.rast b/crates/parser/test_data/parser/inline/ok/0051_unit_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0051_unit_type.rast rename to crates/parser/test_data/parser/inline/ok/0051_unit_type.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0051_unit_type.rs b/crates/parser/test_data/parser/inline/ok/0051_unit_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0051_unit_type.rs rename to crates/parser/test_data/parser/inline/ok/0051_unit_type.rs diff --git a/crates/parser/test_data/parser/inline/ok/0051_unit_type.txt b/crates/parser/test_data/parser/inline/ok/0051_unit_type.txt new file mode 100644 index 0000000000..b3df315354 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0051_unit_type.txt @@ -0,0 +1,14 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0052_path_type.rast b/crates/parser/test_data/parser/inline/ok/0052_path_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0052_path_type.rast rename to crates/parser/test_data/parser/inline/ok/0052_path_type.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0052_path_type.rs b/crates/parser/test_data/parser/inline/ok/0052_path_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0052_path_type.rs rename to crates/parser/test_data/parser/inline/ok/0052_path_type.rs diff --git a/crates/parser/test_data/parser/inline/ok/0052_path_type.txt b/crates/parser/test_data/parser/inline/ok/0052_path_type.txt new file mode 100644 index 0000000000..d498d37218 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0052_path_type.txt @@ -0,0 +1,72 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "A" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "B" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "Foo" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "C" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + SELF_KW "self" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Foo" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "D" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + SUPER_KW "super" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Foo" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0053_path_expr.rast b/crates/parser/test_data/parser/inline/ok/0053_path_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0053_path_expr.rast rename to crates/parser/test_data/parser/inline/ok/0053_path_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0053_path_expr.rs b/crates/parser/test_data/parser/inline/ok/0053_path_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0053_path_expr.rs rename to crates/parser/test_data/parser/inline/ok/0053_path_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0053_path_expr.txt b/crates/parser/test_data/parser/inline/ok/0053_path_expr.txt new file mode 100644 index 0000000000..abd8accf41 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0053_path_expr.txt @@ -0,0 +1,96 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_EXPR + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "b" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "a" + GENERIC_ARG_LIST + COLON2 "::" + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "b" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "format" + BANG "!" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0054_record_field_attrs.rast b/crates/parser/test_data/parser/inline/ok/0054_record_field_attrs.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0054_record_field_attrs.rast rename to crates/parser/test_data/parser/inline/ok/0054_record_field_attrs.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0054_record_field_attrs.rs b/crates/parser/test_data/parser/inline/ok/0054_record_field_attrs.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0054_record_field_attrs.rs rename to crates/parser/test_data/parser/inline/ok/0054_record_field_attrs.rs diff --git a/crates/parser/test_data/parser/inline/ok/0054_record_field_attrs.txt b/crates/parser/test_data/parser/inline/ok/0054_record_field_attrs.txt new file mode 100644 index 0000000000..639ee0eb77 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0054_record_field_attrs.txt @@ -0,0 +1,33 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_FIELD + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE " " + NAME + IDENT "f" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "f32" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0055_literal_pattern.rast b/crates/parser/test_data/parser/inline/ok/0055_literal_pattern.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0055_literal_pattern.rast rename to crates/parser/test_data/parser/inline/ok/0055_literal_pattern.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0055_literal_pattern.rs b/crates/parser/test_data/parser/inline/ok/0055_literal_pattern.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0055_literal_pattern.rs rename to crates/parser/test_data/parser/inline/ok/0055_literal_pattern.rs diff --git a/crates/parser/test_data/parser/inline/ok/0055_literal_pattern.txt b/crates/parser/test_data/parser/inline/ok/0055_literal_pattern.txt new file mode 100644 index 0000000000..c83ea7ade7 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0055_literal_pattern.txt @@ -0,0 +1,77 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + LITERAL_PAT + MINUS "-" + LITERAL + INT_NUMBER "1" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + LITERAL_PAT + LITERAL + INT_NUMBER "92" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + LITERAL_PAT + LITERAL + CHAR "'c'" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + LITERAL_PAT + LITERAL + STRING "\"hello\"" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0056_where_clause.rast b/crates/parser/test_data/parser/inline/ok/0056_where_clause.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0056_where_clause.rast rename to crates/parser/test_data/parser/inline/ok/0056_where_clause.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0056_where_clause.rs b/crates/parser/test_data/parser/inline/ok/0056_where_clause.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0056_where_clause.rs rename to crates/parser/test_data/parser/inline/ok/0056_where_clause.rs diff --git a/crates/parser/test_data/parser/inline/ok/0056_where_clause.txt b/crates/parser/test_data/parser/inline/ok/0056_where_clause.txt new file mode 100644 index 0000000000..a3cbe457e1 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0056_where_clause.txt @@ -0,0 +1,117 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n" + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE "\n " + WHERE_PRED + LIFETIME + LIFETIME_IDENT "'a" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'b" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'c" + COMMA "," + WHITESPACE "\n " + WHERE_PRED + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Clone" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Copy" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'static" + COMMA "," + WHITESPACE "\n " + WHERE_PRED + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "Iterator" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Item" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'a" + COMMA "," + WHITESPACE "\n " + WHERE_PRED + PATH_TYPE + PATH + PATH + PATH_SEGMENT + L_ANGLE "<" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Iterator" + R_ANGLE ">" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Item" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE "\n" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0058_range_pat.rast b/crates/parser/test_data/parser/inline/ok/0058_range_pat.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0058_range_pat.rast rename to crates/parser/test_data/parser/inline/ok/0058_range_pat.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0058_range_pat.rs b/crates/parser/test_data/parser/inline/ok/0058_range_pat.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0058_range_pat.rs rename to crates/parser/test_data/parser/inline/ok/0058_range_pat.rs diff --git a/crates/parser/test_data/parser/inline/ok/0058_range_pat.txt b/crates/parser/test_data/parser/inline/ok/0058_range_pat.txt new file mode 100644 index 0000000000..44c967e8dc --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0058_range_pat.txt @@ -0,0 +1,251 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + RANGE_PAT + LITERAL_PAT + LITERAL + INT_NUMBER "0" + WHITESPACE " " + DOT3 "..." + WHITESPACE " " + LITERAL_PAT + LITERAL + INT_NUMBER "100" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + RANGE_PAT + LITERAL_PAT + LITERAL + INT_NUMBER "101" + WHITESPACE " " + DOT2EQ "..=" + WHITESPACE " " + LITERAL_PAT + LITERAL + INT_NUMBER "200" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + RANGE_PAT + LITERAL_PAT + LITERAL + INT_NUMBER "200" + WHITESPACE " " + DOT2 ".." + WHITESPACE " " + LITERAL_PAT + LITERAL + INT_NUMBER "301" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + RANGE_PAT + LITERAL_PAT + LITERAL + INT_NUMBER "302" + WHITESPACE " " + DOT2 ".." + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + ARG_LIST + L_PAREN "(" + CAST_EXPR + LITERAL + INT_NUMBER "10" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + OR_PAT + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + L_PAREN "(" + LITERAL_PAT + LITERAL + INT_NUMBER "0" + R_PAREN ")" + WHITESPACE " " + PIPE "|" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "None" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + L_PAREN "(" + RANGE_PAT + LITERAL_PAT + LITERAL + INT_NUMBER "1" + DOT2 ".." + R_PAREN ")" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n\n " + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + CAST_EXPR + LITERAL + INT_NUMBER "10" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + COMMA "," + WHITESPACE " " + CAST_EXPR + LITERAL + INT_NUMBER "5" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + TUPLE_PAT + L_PAREN "(" + LITERAL_PAT + LITERAL + INT_NUMBER "0" + COMMA "," + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + R_PAREN ")" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + TUPLE_PAT + L_PAREN "(" + RANGE_PAT + LITERAL_PAT + LITERAL + INT_NUMBER "1" + DOT2 ".." + COMMA "," + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + R_PAREN ")" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast b/crates/parser/test_data/parser/inline/ok/0059_match_arms_commas.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast rename to crates/parser/test_data/parser/inline/ok/0059_match_arms_commas.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0059_match_arms_commas.rs b/crates/parser/test_data/parser/inline/ok/0059_match_arms_commas.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0059_match_arms_commas.rs rename to crates/parser/test_data/parser/inline/ok/0059_match_arms_commas.rs diff --git a/crates/parser/test_data/parser/inline/ok/0059_match_arms_commas.txt b/crates/parser/test_data/parser/inline/ok/0059_match_arms_commas.txt new file mode 100644 index 0000000000..94897c2d20 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0059_match_arms_commas.txt @@ -0,0 +1,60 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0060_extern_crate.rast b/crates/parser/test_data/parser/inline/ok/0060_extern_crate.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0060_extern_crate.rast rename to crates/parser/test_data/parser/inline/ok/0060_extern_crate.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0060_extern_crate.rs b/crates/parser/test_data/parser/inline/ok/0060_extern_crate.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0060_extern_crate.rs rename to crates/parser/test_data/parser/inline/ok/0060_extern_crate.rs diff --git a/crates/parser/test_data/parser/inline/ok/0060_extern_crate.txt b/crates/parser/test_data/parser/inline/ok/0060_extern_crate.txt new file mode 100644 index 0000000000..0a660957d1 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0060_extern_crate.txt @@ -0,0 +1,10 @@ +SOURCE_FILE + EXTERN_CRATE + EXTERN_KW "extern" + WHITESPACE " " + CRATE_KW "crate" + WHITESPACE " " + NAME_REF + IDENT "foo" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0061_record_lit.rast b/crates/parser/test_data/parser/inline/ok/0061_record_lit.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0061_record_lit.rast rename to crates/parser/test_data/parser/inline/ok/0061_record_lit.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0061_record_lit.rs b/crates/parser/test_data/parser/inline/ok/0061_record_lit.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0061_record_lit.rs rename to crates/parser/test_data/parser/inline/ok/0061_record_lit.rs diff --git a/crates/parser/test_data/parser/inline/ok/0061_record_lit.txt b/crates/parser/test_data/parser/inline/ok/0061_record_lit.txt new file mode 100644 index 0000000000..9997d0ae34 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0061_record_lit.txt @@ -0,0 +1,125 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + RECORD_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_EXPR_FIELD_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + RECORD_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_EXPR_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_EXPR_FIELD + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + COMMA "," + WHITESPACE " " + RECORD_EXPR_FIELD + NAME_REF + IDENT "y" + COLON ":" + WHITESPACE " " + LITERAL + INT_NUMBER "32" + COMMA "," + WHITESPACE " " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + RECORD_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_EXPR_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_EXPR_FIELD + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + COMMA "," + WHITESPACE " " + RECORD_EXPR_FIELD + NAME_REF + IDENT "y" + COLON ":" + WHITESPACE " " + LITERAL + INT_NUMBER "32" + COMMA "," + WHITESPACE " " + DOT2 ".." + CALL_EXPR + PATH_EXPR + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "Default" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "default" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + RECORD_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "TupleStruct" + WHITESPACE " " + RECORD_EXPR_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_EXPR_FIELD + NAME_REF + INT_NUMBER "0" + COLON ":" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + WHITESPACE " " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rast b/crates/parser/test_data/parser/inline/ok/0062_mod_contents.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rast rename to crates/parser/test_data/parser/inline/ok/0062_mod_contents.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rs b/crates/parser/test_data/parser/inline/ok/0062_mod_contents.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rs rename to crates/parser/test_data/parser/inline/ok/0062_mod_contents.rs diff --git a/crates/parser/test_data/parser/inline/ok/0062_mod_contents.txt b/crates/parser/test_data/parser/inline/ok/0062_mod_contents.txt new file mode 100644 index 0000000000..5f60e03d44 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0062_mod_contents.txt @@ -0,0 +1,65 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + MACRO_RULES + MACRO_RULES_KW "macro_rules" + BANG "!" + WHITESPACE " " + NAME + IDENT "foo" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + MACRO_CALL + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "bar" + BANG "!" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + MACRO_CALL + PATH + PATH + PATH_SEGMENT + NAME_REF + SUPER_KW "super" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "baz" + BANG "!" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0063_impl_item_neg.rast b/crates/parser/test_data/parser/inline/ok/0063_impl_item_neg.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0063_impl_item_neg.rast rename to crates/parser/test_data/parser/inline/ok/0063_impl_item_neg.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0063_impl_item_neg.rs b/crates/parser/test_data/parser/inline/ok/0063_impl_item_neg.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0063_impl_item_neg.rs rename to crates/parser/test_data/parser/inline/ok/0063_impl_item_neg.rs diff --git a/crates/parser/test_data/parser/inline/ok/0063_impl_item_neg.txt b/crates/parser/test_data/parser/inline/ok/0063_impl_item_neg.txt new file mode 100644 index 0000000000..805052fbca --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0063_impl_item_neg.txt @@ -0,0 +1,23 @@ +SOURCE_FILE + IMPL + IMPL_KW "impl" + WHITESPACE " " + BANG "!" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Send" + WHITESPACE " " + FOR_KW "for" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0064_if_expr.rast b/crates/parser/test_data/parser/inline/ok/0064_if_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0064_if_expr.rast rename to crates/parser/test_data/parser/inline/ok/0064_if_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0064_if_expr.rs b/crates/parser/test_data/parser/inline/ok/0064_if_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0064_if_expr.rs rename to crates/parser/test_data/parser/inline/ok/0064_if_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0064_if_expr.txt b/crates/parser/test_data/parser/inline/ok/0064_if_expr.txt new file mode 100644 index 0000000000..c1f8381271 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0064_if_expr.txt @@ -0,0 +1,132 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + LITERAL + TRUE_KW "true" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + LITERAL + TRUE_KW "true" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE " " + ELSE_KW "else" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + LITERAL + TRUE_KW "true" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE " " + ELSE_KW "else" + WHITESPACE " " + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + LITERAL + FALSE_KW "false" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE " " + ELSE_KW "else" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LITERAL + TRUE_KW "true" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + ELSE_KW "else" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rast b/crates/parser/test_data/parser/inline/ok/0065_dyn_trait_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rast rename to crates/parser/test_data/parser/inline/ok/0065_dyn_trait_type.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rs b/crates/parser/test_data/parser/inline/ok/0065_dyn_trait_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rs rename to crates/parser/test_data/parser/inline/ok/0065_dyn_trait_type.rs diff --git a/crates/parser/test_data/parser/inline/ok/0065_dyn_trait_type.txt b/crates/parser/test_data/parser/inline/ok/0065_dyn_trait_type.txt new file mode 100644 index 0000000000..e37d43aac6 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0065_dyn_trait_type.txt @@ -0,0 +1,45 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "A" + WHITESPACE " " + EQ "=" + WHITESPACE " " + DYN_TRAIT_TYPE + DYN_KW "dyn" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Iterator" + GENERIC_ARG_LIST + L_ANGLE "<" + ASSOC_TYPE_ARG + NAME_REF + IDENT "Item" + EQ "=" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + GENERIC_ARG_LIST + L_ANGLE "<" + LIFETIME_ARG + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + R_ANGLE ">" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'a" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0066_match_arm.rast b/crates/parser/test_data/parser/inline/ok/0066_match_arm.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0066_match_arm.rast rename to crates/parser/test_data/parser/inline/ok/0066_match_arm.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0066_match_arm.rs b/crates/parser/test_data/parser/inline/ok/0066_match_arm.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0066_match_arm.rs rename to crates/parser/test_data/parser/inline/ok/0066_match_arm.rs diff --git a/crates/parser/test_data/parser/inline/ok/0066_match_arm.txt b/crates/parser/test_data/parser/inline/ok/0066_match_arm.txt new file mode 100644 index 0000000000..8189cf0a8e --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0066_match_arm.txt @@ -0,0 +1,152 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + MATCH_GUARD + IF_KW "if" + WHITESPACE " " + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Test" + WHITESPACE " " + R_ANGLE ">" + WHITESPACE " " + RECORD_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Test" + RECORD_EXPR_FIELD_LIST + L_CURLY "{" + RECORD_EXPR_FIELD + NAME_REF + IDENT "field" + COLON ":" + WHITESPACE " " + LITERAL + INT_NUMBER "0" + R_CURLY "}" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + OR_PAT + IDENT_PAT + NAME + IDENT "X" + WHITESPACE " " + PIPE "|" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "Y" + WHITESPACE " " + MATCH_GUARD + IF_KW "if" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Z" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + PIPE "|" + WHITESPACE " " + OR_PAT + IDENT_PAT + NAME + IDENT "X" + WHITESPACE " " + PIPE "|" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "Y" + WHITESPACE " " + MATCH_GUARD + IF_KW "if" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Z" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + PIPE "|" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "X" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0067_crate_path.rast b/crates/parser/test_data/parser/inline/ok/0067_crate_path.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0067_crate_path.rast rename to crates/parser/test_data/parser/inline/ok/0067_crate_path.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0067_crate_path.rs b/crates/parser/test_data/parser/inline/ok/0067_crate_path.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0067_crate_path.rs rename to crates/parser/test_data/parser/inline/ok/0067_crate_path.rs diff --git a/crates/parser/test_data/parser/inline/ok/0067_crate_path.txt b/crates/parser/test_data/parser/inline/ok/0067_crate_path.txt new file mode 100644 index 0000000000..f71367ae1e --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0067_crate_path.txt @@ -0,0 +1,16 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH_SEGMENT + NAME_REF + CRATE_KW "crate" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "foo" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast b/crates/parser/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast rename to crates/parser/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rs b/crates/parser/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rs rename to crates/parser/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rs diff --git a/crates/parser/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.txt b/crates/parser/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.txt new file mode 100644 index 0000000000..e387e14d14 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.txt @@ -0,0 +1,53 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + BIN_EXPR + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + LITERAL + INT_NUMBER "1" + R_CURLY "}" + WHITESPACE " " + AMP "&" + WHITESPACE " " + LITERAL + INT_NUMBER "2" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + LITERAL + INT_NUMBER "1" + R_CURLY "}" + WHITESPACE " " + EXPR_STMT + REF_EXPR + AMP "&" + LITERAL + INT_NUMBER "2" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0071_match_expr.rast b/crates/parser/test_data/parser/inline/ok/0071_match_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0071_match_expr.rast rename to crates/parser/test_data/parser/inline/ok/0071_match_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0071_match_expr.rs b/crates/parser/test_data/parser/inline/ok/0071_match_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0071_match_expr.rs rename to crates/parser/test_data/parser/inline/ok/0071_match_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0071_match_expr.txt b/crates/parser/test_data/parser/inline/ok/0071_match_expr.txt new file mode 100644 index 0000000000..0d6cd390ea --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0071_match_expr.txt @@ -0,0 +1,96 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE " " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE " " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_EXPR_FIELD_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0072_return_expr.rast b/crates/parser/test_data/parser/inline/ok/0072_return_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0072_return_expr.rast rename to crates/parser/test_data/parser/inline/ok/0072_return_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0072_return_expr.rs b/crates/parser/test_data/parser/inline/ok/0072_return_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0072_return_expr.rs rename to crates/parser/test_data/parser/inline/ok/0072_return_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0072_return_expr.txt b/crates/parser/test_data/parser/inline/ok/0072_return_expr.txt new file mode 100644 index 0000000000..62cff12202 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0072_return_expr.txt @@ -0,0 +1,29 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + RETURN_EXPR + RETURN_KW "return" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + RETURN_EXPR + RETURN_KW "return" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0073_type_item_type_params.rast b/crates/parser/test_data/parser/inline/ok/0073_type_item_type_params.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0073_type_item_type_params.rast rename to crates/parser/test_data/parser/inline/ok/0073_type_item_type_params.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0073_type_item_type_params.rs b/crates/parser/test_data/parser/inline/ok/0073_type_item_type_params.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0073_type_item_type_params.rs rename to crates/parser/test_data/parser/inline/ok/0073_type_item_type_params.rs diff --git a/crates/parser/test_data/parser/inline/ok/0073_type_item_type_params.txt b/crates/parser/test_data/parser/inline/ok/0073_type_item_type_params.txt new file mode 100644 index 0000000000..60ac3b3c4a --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0073_type_item_type_params.txt @@ -0,0 +1,20 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "Result" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + R_ANGLE ">" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast b/crates/parser/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast rename to crates/parser/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rs b/crates/parser/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rs rename to crates/parser/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rs diff --git a/crates/parser/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.txt b/crates/parser/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.txt new file mode 100644 index 0000000000..950421feb7 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.txt @@ -0,0 +1,63 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + MATCH_ARM + TUPLE_PAT + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + MATCH_ARM + SLICE_PAT + L_BRACK "[" + R_BRACK "]" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0075_block.rast b/crates/parser/test_data/parser/inline/ok/0075_block.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0075_block.rast rename to crates/parser/test_data/parser/inline/ok/0075_block.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0075_block.rs b/crates/parser/test_data/parser/inline/ok/0075_block.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0075_block.rs rename to crates/parser/test_data/parser/inline/ok/0075_block.rs diff --git a/crates/parser/test_data/parser/inline/ok/0075_block.txt b/crates/parser/test_data/parser/inline/ok/0075_block.txt new file mode 100644 index 0000000000..a23364d152 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0075_block.txt @@ -0,0 +1,90 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "a" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "b" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "c" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE " " + EXPR_STMT + LITERAL + INT_NUMBER "2" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "d" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE " " + LITERAL + INT_NUMBER "2" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0076_function_where_clause.rast b/crates/parser/test_data/parser/inline/ok/0076_function_where_clause.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0076_function_where_clause.rast rename to crates/parser/test_data/parser/inline/ok/0076_function_where_clause.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0076_function_where_clause.rs b/crates/parser/test_data/parser/inline/ok/0076_function_where_clause.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0076_function_where_clause.rs rename to crates/parser/test_data/parser/inline/ok/0076_function_where_clause.rs diff --git a/crates/parser/test_data/parser/inline/ok/0076_function_where_clause.txt b/crates/parser/test_data/parser/inline/ok/0076_function_where_clause.txt new file mode 100644 index 0000000000..a000d7e592 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0076_function_where_clause.txt @@ -0,0 +1,40 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE " " + WHERE_PRED + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Copy" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0077_try_expr.rast b/crates/parser/test_data/parser/inline/ok/0077_try_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0077_try_expr.rast rename to crates/parser/test_data/parser/inline/ok/0077_try_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0077_try_expr.rs b/crates/parser/test_data/parser/inline/ok/0077_try_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0077_try_expr.rs rename to crates/parser/test_data/parser/inline/ok/0077_try_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0077_try_expr.txt b/crates/parser/test_data/parser/inline/ok/0077_try_expr.txt new file mode 100644 index 0000000000..c3aa8c15de --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0077_try_expr.txt @@ -0,0 +1,26 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + TRY_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + QUESTION "?" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0078_type_alias.rast b/crates/parser/test_data/parser/inline/ok/0078_type_alias.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0078_type_alias.rast rename to crates/parser/test_data/parser/inline/ok/0078_type_alias.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0078_type_alias.rs b/crates/parser/test_data/parser/inline/ok/0078_type_alias.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0078_type_alias.rs rename to crates/parser/test_data/parser/inline/ok/0078_type_alias.rs diff --git a/crates/parser/test_data/parser/inline/ok/0078_type_alias.txt b/crates/parser/test_data/parser/inline/ok/0078_type_alias.txt new file mode 100644 index 0000000000..c5da799741 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0078_type_alias.txt @@ -0,0 +1,16 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "Foo" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Bar" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0079_impl_item.rast b/crates/parser/test_data/parser/inline/ok/0079_impl_item.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0079_impl_item.rast rename to crates/parser/test_data/parser/inline/ok/0079_impl_item.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0079_impl_item.rs b/crates/parser/test_data/parser/inline/ok/0079_impl_item.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0079_impl_item.rs rename to crates/parser/test_data/parser/inline/ok/0079_impl_item.rs diff --git a/crates/parser/test_data/parser/inline/ok/0079_impl_item.txt b/crates/parser/test_data/parser/inline/ok/0079_impl_item.txt new file mode 100644 index 0000000000..879676309a --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0079_impl_item.txt @@ -0,0 +1,14 @@ +SOURCE_FILE + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0080_postfix_range.rast b/crates/parser/test_data/parser/inline/ok/0080_postfix_range.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0080_postfix_range.rast rename to crates/parser/test_data/parser/inline/ok/0080_postfix_range.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0080_postfix_range.rs b/crates/parser/test_data/parser/inline/ok/0080_postfix_range.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0080_postfix_range.rs rename to crates/parser/test_data/parser/inline/ok/0080_postfix_range.rs diff --git a/crates/parser/test_data/parser/inline/ok/0080_postfix_range.txt b/crates/parser/test_data/parser/inline/ok/0080_postfix_range.txt new file mode 100644 index 0000000000..3a59cf7b83 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0080_postfix_range.txt @@ -0,0 +1,96 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "x" + WHITESPACE " " + EQ "=" + WHITESPACE " " + RANGE_EXPR + LITERAL + INT_NUMBER "1" + DOT2 ".." + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + RANGE_EXPR + LITERAL + INT_NUMBER "1" + DOT2 ".." + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE " " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + RANGE_EXPR + METHOD_CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + DOT "." + NAME_REF + IDENT "b" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + DOT2 ".." + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE " " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0081_for_type.rast b/crates/parser/test_data/parser/inline/ok/0081_for_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0081_for_type.rast rename to crates/parser/test_data/parser/inline/ok/0081_for_type.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0081_for_type.rs b/crates/parser/test_data/parser/inline/ok/0081_for_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0081_for_type.rs rename to crates/parser/test_data/parser/inline/ok/0081_for_type.rs diff --git a/crates/parser/test_data/parser/inline/ok/0081_for_type.txt b/crates/parser/test_data/parser/inline/ok/0081_for_type.txt new file mode 100644 index 0000000000..7600457a9b --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0081_for_type.txt @@ -0,0 +1,117 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "A" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + FN_PTR_TYPE + FN_KW "fn" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "B" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + FN_PTR_TYPE + UNSAFE_KW "unsafe" + WHITESPACE " " + ABI + EXTERN_KW "extern" + WHITESPACE " " + STRING "\"C\"" + WHITESPACE " " + FN_KW "fn" + PARAM_LIST + L_PAREN "(" + PARAM + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "Obj" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "PartialEq" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0082_ref_expr.rast b/crates/parser/test_data/parser/inline/ok/0082_ref_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0082_ref_expr.rast rename to crates/parser/test_data/parser/inline/ok/0082_ref_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0082_ref_expr.rs b/crates/parser/test_data/parser/inline/ok/0082_ref_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0082_ref_expr.rs rename to crates/parser/test_data/parser/inline/ok/0082_ref_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0082_ref_expr.txt b/crates/parser/test_data/parser/inline/ok/0082_ref_expr.txt new file mode 100644 index 0000000000..108b0802c3 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0082_ref_expr.txt @@ -0,0 +1,139 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + COMMENT "// reference operator" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + REF_EXPR + AMP "&" + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + REF_EXPR + AMP "&" + MUT_KW "mut" + WHITESPACE " " + REF_EXPR + AMP "&" + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "f" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + REF_EXPR + AMP "&" + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "raw" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + REF_EXPR + AMP "&" + FIELD_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "raw" + DOT "." + NAME_REF + INT_NUMBER "0" + SEMICOLON ";" + WHITESPACE "\n " + COMMENT "// raw reference operator" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + REF_EXPR + AMP "&" + RAW_KW "raw" + WHITESPACE " " + MUT_KW "mut" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + REF_EXPR + AMP "&" + RAW_KW "raw" + WHITESPACE " " + CONST_KW "const" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0083_struct_items.rast b/crates/parser/test_data/parser/inline/ok/0083_struct_items.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0083_struct_items.rast rename to crates/parser/test_data/parser/inline/ok/0083_struct_items.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0084_paren_type.rast b/crates/parser/test_data/parser/inline/ok/0084_paren_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0084_paren_type.rast rename to crates/parser/test_data/parser/inline/ok/0084_paren_type.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0084_paren_type.rs b/crates/parser/test_data/parser/inline/ok/0084_paren_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0084_paren_type.rs rename to crates/parser/test_data/parser/inline/ok/0084_paren_type.rs diff --git a/crates/parser/test_data/parser/inline/ok/0084_paren_type.txt b/crates/parser/test_data/parser/inline/ok/0084_paren_type.txt new file mode 100644 index 0000000000..29995bb752 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0084_paren_type.txt @@ -0,0 +1,19 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PAREN_TYPE + L_PAREN "(" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0085_expr_literals.rast b/crates/parser/test_data/parser/inline/ok/0085_expr_literals.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0085_expr_literals.rast rename to crates/parser/test_data/parser/inline/ok/0085_expr_literals.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0085_expr_literals.rs b/crates/parser/test_data/parser/inline/ok/0085_expr_literals.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0085_expr_literals.rs rename to crates/parser/test_data/parser/inline/ok/0085_expr_literals.rs diff --git a/crates/parser/test_data/parser/inline/ok/0085_expr_literals.txt b/crates/parser/test_data/parser/inline/ok/0085_expr_literals.txt new file mode 100644 index 0000000000..403c265ea3 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0085_expr_literals.txt @@ -0,0 +1,136 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + TRUE_KW "true" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + FALSE_KW "false" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + FLOAT_NUMBER "2.0" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + BYTE "b'a'" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + CHAR "'b'" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + STRING "\"c\"" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + STRING "r\"d\"" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + BYTE_STRING "b\"e\"" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + BYTE_STRING "br\"f\"" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0086_function_ret_type.rast b/crates/parser/test_data/parser/inline/ok/0086_function_ret_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0086_function_ret_type.rast rename to crates/parser/test_data/parser/inline/ok/0086_function_ret_type.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0086_function_ret_type.rs b/crates/parser/test_data/parser/inline/ok/0086_function_ret_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0086_function_ret_type.rs rename to crates/parser/test_data/parser/inline/ok/0086_function_ret_type.rs diff --git a/crates/parser/test_data/parser/inline/ok/0086_function_ret_type.txt b/crates/parser/test_data/parser/inline/ok/0086_function_ret_type.txt new file mode 100644 index 0000000000..6687c843fb --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0086_function_ret_type.txt @@ -0,0 +1,36 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "bar" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast b/crates/parser/test_data/parser/inline/ok/0088_break_ambiguity.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast rename to crates/parser/test_data/parser/inline/ok/0088_break_ambiguity.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0088_break_ambiguity.rs b/crates/parser/test_data/parser/inline/ok/0088_break_ambiguity.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0088_break_ambiguity.rs rename to crates/parser/test_data/parser/inline/ok/0088_break_ambiguity.rs diff --git a/crates/parser/test_data/parser/inline/ok/0088_break_ambiguity.txt b/crates/parser/test_data/parser/inline/ok/0088_break_ambiguity.txt new file mode 100644 index 0000000000..50ce9933b9 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0088_break_ambiguity.txt @@ -0,0 +1,69 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + BREAK_EXPR + BREAK_KW "break" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + WHILE_EXPR + WHILE_KW "while" + WHITESPACE " " + CONDITION + BREAK_EXPR + BREAK_KW "break" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + FOR_EXPR + FOR_KW "for" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "i" + WHITESPACE " " + IN_KW "in" + WHITESPACE " " + BREAK_EXPR + BREAK_KW "break" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + BREAK_EXPR + BREAK_KW "break" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0090_type_param_default.rast b/crates/parser/test_data/parser/inline/ok/0090_type_param_default.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0090_type_param_default.rast rename to crates/parser/test_data/parser/inline/ok/0090_type_param_default.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0090_type_param_default.rs b/crates/parser/test_data/parser/inline/ok/0090_type_param_default.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0090_type_param_default.rs rename to crates/parser/test_data/parser/inline/ok/0090_type_param_default.rs diff --git a/crates/parser/test_data/parser/inline/ok/0090_type_param_default.txt b/crates/parser/test_data/parser/inline/ok/0090_type_param_default.txt new file mode 100644 index 0000000000..cf7236f62e --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0090_type_param_default.txt @@ -0,0 +1,22 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rast b/crates/parser/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rast rename to crates/parser/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rs b/crates/parser/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rs rename to crates/parser/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rs diff --git a/crates/parser/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.txt b/crates/parser/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.txt new file mode 100644 index 0000000000..372c867ae6 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.txt @@ -0,0 +1,23 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "F" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FN_PTR_TYPE + FN_KW "fn" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0093_index_expr.rast b/crates/parser/test_data/parser/inline/ok/0093_index_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0093_index_expr.rast rename to crates/parser/test_data/parser/inline/ok/0093_index_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0093_index_expr.rs b/crates/parser/test_data/parser/inline/ok/0093_index_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0093_index_expr.rs rename to crates/parser/test_data/parser/inline/ok/0093_index_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0093_index_expr.txt b/crates/parser/test_data/parser/inline/ok/0093_index_expr.txt new file mode 100644 index 0000000000..6969259fc0 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0093_index_expr.txt @@ -0,0 +1,34 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + INDEX_EXPR + INDEX_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + L_BRACK "[" + LITERAL + INT_NUMBER "1" + R_BRACK "]" + L_BRACK "[" + LITERAL + INT_NUMBER "2" + R_BRACK "]" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast b/crates/parser/test_data/parser/inline/ok/0095_placeholder_pat.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast rename to crates/parser/test_data/parser/inline/ok/0095_placeholder_pat.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0095_placeholder_pat.rs b/crates/parser/test_data/parser/inline/ok/0095_placeholder_pat.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0095_placeholder_pat.rs rename to crates/parser/test_data/parser/inline/ok/0095_placeholder_pat.rs diff --git a/crates/parser/test_data/parser/inline/ok/0095_placeholder_pat.txt b/crates/parser/test_data/parser/inline/ok/0095_placeholder_pat.txt new file mode 100644 index 0000000000..d39c3df2b7 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0095_placeholder_pat.txt @@ -0,0 +1,29 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast b/crates/parser/test_data/parser/inline/ok/0096_no_semi_after_block.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast rename to crates/parser/test_data/parser/inline/ok/0096_no_semi_after_block.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rs b/crates/parser/test_data/parser/inline/ok/0096_no_semi_after_block.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rs rename to crates/parser/test_data/parser/inline/ok/0096_no_semi_after_block.rs diff --git a/crates/parser/test_data/parser/inline/ok/0096_no_semi_after_block.txt b/crates/parser/test_data/parser/inline/ok/0096_no_semi_after_block.txt new file mode 100644 index 0000000000..2a85371393 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0096_no_semi_after_block.txt @@ -0,0 +1,126 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + LITERAL + TRUE_KW "true" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + LOOP_EXPR + LOOP_KW "loop" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + WHILE_EXPR + WHILE_KW "while" + WHITESPACE " " + CONDITION + LITERAL + TRUE_KW "true" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + FOR_EXPR + FOR_KW "for" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + IN_KW "in" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + MACRO_RULES + MACRO_RULES_KW "macro_rules" + BANG "!" + WHITESPACE " " + NAME + IDENT "test" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + WHITESPACE "\n " + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + EQ "=" + R_ANGLE ">" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n " + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "test" + BANG "!" + TOKEN_TREE + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0099_param_list.rast b/crates/parser/test_data/parser/inline/ok/0099_param_list.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0099_param_list.rast rename to crates/parser/test_data/parser/inline/ok/0099_param_list.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0099_param_list.rs b/crates/parser/test_data/parser/inline/ok/0099_param_list.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0099_param_list.rs rename to crates/parser/test_data/parser/inline/ok/0099_param_list.rs diff --git a/crates/parser/test_data/parser/inline/ok/0099_param_list.txt b/crates/parser/test_data/parser/inline/ok/0099_param_list.txt new file mode 100644 index 0000000000..d240a52f6f --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0099_param_list.txt @@ -0,0 +1,103 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "a" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "b" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "c" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + COMMA "," + WHITESPACE " " + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "d" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "y" + COLON ":" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0100_for_expr.rast b/crates/parser/test_data/parser/inline/ok/0100_for_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0100_for_expr.rast rename to crates/parser/test_data/parser/inline/ok/0100_for_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0100_for_expr.rs b/crates/parser/test_data/parser/inline/ok/0100_for_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0100_for_expr.rs rename to crates/parser/test_data/parser/inline/ok/0100_for_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0100_for_expr.txt b/crates/parser/test_data/parser/inline/ok/0100_for_expr.txt new file mode 100644 index 0000000000..6bc3c0fb05 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0100_for_expr.txt @@ -0,0 +1,36 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + FOR_EXPR + FOR_KW "for" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "x" + WHITESPACE " " + IN_KW "in" + WHITESPACE " " + ARRAY_EXPR + L_BRACK "[" + R_BRACK "]" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0102_record_pat_field_list.rast b/crates/parser/test_data/parser/inline/ok/0102_record_pat_field_list.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0102_record_pat_field_list.rast rename to crates/parser/test_data/parser/inline/ok/0102_record_pat_field_list.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0102_record_pat_field_list.rs b/crates/parser/test_data/parser/inline/ok/0102_record_pat_field_list.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0102_record_pat_field_list.rs rename to crates/parser/test_data/parser/inline/ok/0102_record_pat_field_list.rs diff --git a/crates/parser/test_data/parser/inline/ok/0102_record_pat_field_list.txt b/crates/parser/test_data/parser/inline/ok/0102_record_pat_field_list.txt new file mode 100644 index 0000000000..f69ae1d644 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0102_record_pat_field_list.txt @@ -0,0 +1,175 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + RECORD_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_PAT_FIELD_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + RECORD_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_PAT_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_PAT_FIELD + IDENT_PAT + NAME + IDENT "f" + COMMA "," + WHITESPACE " " + RECORD_PAT_FIELD + IDENT_PAT + REF_KW "ref" + WHITESPACE " " + MUT_KW "mut" + WHITESPACE " " + NAME + IDENT "g" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + RECORD_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_PAT_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_PAT_FIELD + NAME_REF + IDENT "h" + COLON ":" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + R_CURLY "}" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + RECORD_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_PAT_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_PAT_FIELD + NAME_REF + IDENT "h" + COLON ":" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + COMMA "," + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + RECORD_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_PAT_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + REST_PAT + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "cfg" + TOKEN_TREE + L_PAREN "(" + IDENT "any" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + R_BRACK "]" + WHITESPACE " " + DOT2 ".." + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0103_array_expr.rast b/crates/parser/test_data/parser/inline/ok/0103_array_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0103_array_expr.rast rename to crates/parser/test_data/parser/inline/ok/0103_array_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0103_array_expr.rs b/crates/parser/test_data/parser/inline/ok/0103_array_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0103_array_expr.rs rename to crates/parser/test_data/parser/inline/ok/0103_array_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0103_array_expr.txt b/crates/parser/test_data/parser/inline/ok/0103_array_expr.txt new file mode 100644 index 0000000000..60395948c1 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0103_array_expr.txt @@ -0,0 +1,55 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + ARRAY_EXPR + L_BRACK "[" + R_BRACK "]" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + ARRAY_EXPR + L_BRACK "[" + LITERAL + INT_NUMBER "1" + R_BRACK "]" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + ARRAY_EXPR + L_BRACK "[" + LITERAL + INT_NUMBER "1" + COMMA "," + WHITESPACE " " + LITERAL + INT_NUMBER "2" + COMMA "," + R_BRACK "]" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + ARRAY_EXPR + L_BRACK "[" + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE " " + LITERAL + INT_NUMBER "2" + R_BRACK "]" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rast b/crates/parser/test_data/parser/inline/ok/0104_path_fn_trait_args.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rast rename to crates/parser/test_data/parser/inline/ok/0104_path_fn_trait_args.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rs b/crates/parser/test_data/parser/inline/ok/0104_path_fn_trait_args.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rs rename to crates/parser/test_data/parser/inline/ok/0104_path_fn_trait_args.rs diff --git a/crates/parser/test_data/parser/inline/ok/0104_path_fn_trait_args.txt b/crates/parser/test_data/parser/inline/ok/0104_path_fn_trait_args.txt new file mode 100644 index 0000000000..fd83daf841 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0104_path_fn_trait_args.txt @@ -0,0 +1,41 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "F" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Box" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Fn" + PARAM_LIST + L_PAREN "(" + PARAM + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0106_lambda_expr.rast b/crates/parser/test_data/parser/inline/ok/0106_lambda_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0106_lambda_expr.rast rename to crates/parser/test_data/parser/inline/ok/0106_lambda_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0106_lambda_expr.rs b/crates/parser/test_data/parser/inline/ok/0106_lambda_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0106_lambda_expr.rs rename to crates/parser/test_data/parser/inline/ok/0106_lambda_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0106_lambda_expr.txt b/crates/parser/test_data/parser/inline/ok/0106_lambda_expr.txt new file mode 100644 index 0000000000..4571788948 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0106_lambda_expr.txt @@ -0,0 +1,140 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + CLOSURE_EXPR + PARAM_LIST + PIPE "|" + PIPE "|" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CLOSURE_EXPR + PARAM_LIST + PIPE "|" + PIPE "|" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + WHITESPACE " " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CLOSURE_EXPR + PARAM_LIST + PIPE "|" + PARAM + IDENT_PAT + NAME + IDENT "x" + PIPE "|" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CLOSURE_EXPR + MOVE_KW "move" + WHITESPACE " " + PARAM_LIST + PIPE "|" + PARAM + IDENT_PAT + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + COMMA "," + PIPE "|" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CLOSURE_EXPR + ASYNC_KW "async" + WHITESPACE " " + PARAM_LIST + PIPE "|" + PIPE "|" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CLOSURE_EXPR + MOVE_KW "move" + WHITESPACE " " + PARAM_LIST + PIPE "|" + PIPE "|" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CLOSURE_EXPR + ASYNC_KW "async" + WHITESPACE " " + MOVE_KW "move" + WHITESPACE " " + PARAM_LIST + PIPE "|" + PIPE "|" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0107_method_call_expr.rast b/crates/parser/test_data/parser/inline/ok/0107_method_call_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0107_method_call_expr.rast rename to crates/parser/test_data/parser/inline/ok/0107_method_call_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0107_method_call_expr.rs b/crates/parser/test_data/parser/inline/ok/0107_method_call_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0107_method_call_expr.rs rename to crates/parser/test_data/parser/inline/ok/0107_method_call_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0107_method_call_expr.txt b/crates/parser/test_data/parser/inline/ok/0107_method_call_expr.txt new file mode 100644 index 0000000000..dcbcfe1231 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0107_method_call_expr.txt @@ -0,0 +1,63 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + METHOD_CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + DOT "." + NAME_REF + IDENT "foo" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + METHOD_CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "y" + DOT "." + NAME_REF + IDENT "bar" + GENERIC_ARG_LIST + COLON2 "::" + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + R_ANGLE ">" + ARG_LIST + L_PAREN "(" + LITERAL + INT_NUMBER "1" + COMMA "," + WHITESPACE " " + LITERAL + INT_NUMBER "2" + COMMA "," + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0108_tuple_expr.rast b/crates/parser/test_data/parser/inline/ok/0108_tuple_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0108_tuple_expr.rast rename to crates/parser/test_data/parser/inline/ok/0108_tuple_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0108_tuple_expr.rs b/crates/parser/test_data/parser/inline/ok/0108_tuple_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0108_tuple_expr.rs rename to crates/parser/test_data/parser/inline/ok/0108_tuple_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0108_tuple_expr.txt b/crates/parser/test_data/parser/inline/ok/0108_tuple_expr.txt new file mode 100644 index 0000000000..ac5a717031 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0108_tuple_expr.txt @@ -0,0 +1,39 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + PAREN_EXPR + L_PAREN "(" + LITERAL + INT_NUMBER "1" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + TUPLE_EXPR + L_PAREN "(" + LITERAL + INT_NUMBER "1" + COMMA "," + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0109_label.rast b/crates/parser/test_data/parser/inline/ok/0109_label.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0109_label.rast rename to crates/parser/test_data/parser/inline/ok/0109_label.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0109_label.rs b/crates/parser/test_data/parser/inline/ok/0109_label.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0109_label.rs rename to crates/parser/test_data/parser/inline/ok/0109_label.rs diff --git a/crates/parser/test_data/parser/inline/ok/0109_label.txt b/crates/parser/test_data/parser/inline/ok/0109_label.txt new file mode 100644 index 0000000000..bd57fa9d4a --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0109_label.txt @@ -0,0 +1,71 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + LOOP_EXPR + LABEL + LIFETIME + LIFETIME_IDENT "'a" + COLON ":" + WHITESPACE " " + LOOP_KW "loop" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + WHILE_EXPR + LABEL + LIFETIME + LIFETIME_IDENT "'b" + COLON ":" + WHITESPACE " " + WHILE_KW "while" + WHITESPACE " " + CONDITION + LITERAL + TRUE_KW "true" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FOR_EXPR + LABEL + LIFETIME + LIFETIME_IDENT "'c" + COLON ":" + WHITESPACE " " + FOR_KW "for" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "x" + WHITESPACE " " + IN_KW "in" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0111_tuple_pat.rast b/crates/parser/test_data/parser/inline/ok/0111_tuple_pat.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0111_tuple_pat.rast rename to crates/parser/test_data/parser/inline/ok/0111_tuple_pat.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0111_tuple_pat.rs b/crates/parser/test_data/parser/inline/ok/0111_tuple_pat.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0111_tuple_pat.rs rename to crates/parser/test_data/parser/inline/ok/0111_tuple_pat.rs diff --git a/crates/parser/test_data/parser/inline/ok/0111_tuple_pat.txt b/crates/parser/test_data/parser/inline/ok/0111_tuple_pat.txt new file mode 100644 index 0000000000..cebe98c43a --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0111_tuple_pat.txt @@ -0,0 +1,90 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_PAT + L_PAREN "(" + IDENT_PAT + NAME + IDENT "a" + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "b" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_PAT + L_PAREN "(" + IDENT_PAT + NAME + IDENT "a" + COMMA "," + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_PAT + L_PAREN "(" + REST_PAT + DOT2 ".." + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_PAT + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0112_bind_pat.rast b/crates/parser/test_data/parser/inline/ok/0112_bind_pat.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0112_bind_pat.rast rename to crates/parser/test_data/parser/inline/ok/0112_bind_pat.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0112_bind_pat.rs b/crates/parser/test_data/parser/inline/ok/0112_bind_pat.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0112_bind_pat.rs rename to crates/parser/test_data/parser/inline/ok/0112_bind_pat.rs diff --git a/crates/parser/test_data/parser/inline/ok/0112_bind_pat.txt b/crates/parser/test_data/parser/inline/ok/0112_bind_pat.txt new file mode 100644 index 0000000000..eb1c32474a --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0112_bind_pat.txt @@ -0,0 +1,128 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "a" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + MUT_KW "mut" + WHITESPACE " " + NAME + IDENT "b" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + REF_KW "ref" + WHITESPACE " " + NAME + IDENT "c" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + REF_KW "ref" + WHITESPACE " " + MUT_KW "mut" + WHITESPACE " " + NAME + IDENT "d" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "e" + WHITESPACE " " + AT "@" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + REF_KW "ref" + WHITESPACE " " + MUT_KW "mut" + WHITESPACE " " + NAME + IDENT "f" + WHITESPACE " " + AT "@" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "g" + WHITESPACE " " + AT "@" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast b/crates/parser/test_data/parser/inline/ok/0113_nocontentexpr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast rename to crates/parser/test_data/parser/inline/ok/0113_nocontentexpr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0113_nocontentexpr.rs b/crates/parser/test_data/parser/inline/ok/0113_nocontentexpr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0113_nocontentexpr.rs rename to crates/parser/test_data/parser/inline/ok/0113_nocontentexpr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0113_nocontentexpr.txt b/crates/parser/test_data/parser/inline/ok/0113_nocontentexpr.txt new file mode 100644 index 0000000000..8bd90a7f67 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0113_nocontentexpr.txt @@ -0,0 +1,57 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + SEMICOLON ";" + SEMICOLON ";" + SEMICOLON ";" + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "some_expr" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + SEMICOLON ";" + SEMICOLON ";" + SEMICOLON ";" + EXPR_STMT + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + SEMICOLON ";" + SEMICOLON ";" + SEMICOLON ";" + R_CURLY "}" + SEMICOLON ";" + SEMICOLON ";" + SEMICOLON ";" + SEMICOLON ";" + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Ok" + ARG_LIST + L_PAREN "(" + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rast b/crates/parser/test_data/parser/inline/ok/0114_tuple_struct_where.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rast rename to crates/parser/test_data/parser/inline/ok/0114_tuple_struct_where.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rs b/crates/parser/test_data/parser/inline/ok/0114_tuple_struct_where.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rs rename to crates/parser/test_data/parser/inline/ok/0114_tuple_struct_where.rs diff --git a/crates/parser/test_data/parser/inline/ok/0114_tuple_struct_where.txt b/crates/parser/test_data/parser/inline/ok/0114_tuple_struct_where.txt new file mode 100644 index 0000000000..aab7741657 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0114_tuple_struct_where.txt @@ -0,0 +1,42 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + R_ANGLE ">" + TUPLE_FIELD_LIST + L_PAREN "(" + TUPLE_FIELD + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + R_PAREN ")" + WHITESPACE " " + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE " " + WHERE_PRED + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Clone" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0115_tuple_field_attrs.rast b/crates/parser/test_data/parser/inline/ok/0115_tuple_field_attrs.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0115_tuple_field_attrs.rast rename to crates/parser/test_data/parser/inline/ok/0115_tuple_field_attrs.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0115_tuple_field_attrs.rs b/crates/parser/test_data/parser/inline/ok/0115_tuple_field_attrs.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0115_tuple_field_attrs.rs rename to crates/parser/test_data/parser/inline/ok/0115_tuple_field_attrs.rs diff --git a/crates/parser/test_data/parser/inline/ok/0115_tuple_field_attrs.txt b/crates/parser/test_data/parser/inline/ok/0115_tuple_field_attrs.txt new file mode 100644 index 0000000000..1699602f4f --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0115_tuple_field_attrs.txt @@ -0,0 +1,28 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + WHITESPACE " " + TUPLE_FIELD_LIST + L_PAREN "(" + TUPLE_FIELD + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "f32" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0117_macro_call_type.rast b/crates/parser/test_data/parser/inline/ok/0117_macro_call_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0117_macro_call_type.rast rename to crates/parser/test_data/parser/inline/ok/0117_macro_call_type.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0117_macro_call_type.rs b/crates/parser/test_data/parser/inline/ok/0117_macro_call_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0117_macro_call_type.rs rename to crates/parser/test_data/parser/inline/ok/0117_macro_call_type.rs diff --git a/crates/parser/test_data/parser/inline/ok/0117_macro_call_type.txt b/crates/parser/test_data/parser/inline/ok/0117_macro_call_type.txt new file mode 100644 index 0000000000..8165cb7d9b --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0117_macro_call_type.txt @@ -0,0 +1,46 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "A" + WHITESPACE " " + EQ "=" + WHITESPACE " " + MACRO_TYPE + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + BANG "!" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "B" + WHITESPACE " " + EQ "=" + WHITESPACE " " + MACRO_TYPE + MACRO_CALL + PATH + PATH + PATH_SEGMENT + NAME_REF + CRATE_KW "crate" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "foo" + BANG "!" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0118_match_guard.rast b/crates/parser/test_data/parser/inline/ok/0118_match_guard.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0118_match_guard.rast rename to crates/parser/test_data/parser/inline/ok/0118_match_guard.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0118_match_guard.rs b/crates/parser/test_data/parser/inline/ok/0118_match_guard.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0118_match_guard.rs rename to crates/parser/test_data/parser/inline/ok/0118_match_guard.rs diff --git a/crates/parser/test_data/parser/inline/ok/0118_match_guard.txt b/crates/parser/test_data/parser/inline/ok/0118_match_guard.txt new file mode 100644 index 0000000000..a28b6ea5d1 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0118_match_guard.txt @@ -0,0 +1,76 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + MATCH_GUARD + IF_KW "if" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + MATCH_GUARD + IF_KW "if" + WHITESPACE " " + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "foo" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast b/crates/parser/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast rename to crates/parser/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rs b/crates/parser/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rs rename to crates/parser/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rs diff --git a/crates/parser/test_data/parser/inline/ok/0120_match_arms_inner_attribute.txt b/crates/parser/test_data/parser/inline/ok/0120_match_arms_inner_attribute.txt new file mode 100644 index 0000000000..6fd9f42467 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0120_match_arms_inner_attribute.txt @@ -0,0 +1,84 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "doc" + TOKEN_TREE + L_PAREN "(" + STRING "\"Inner attribute\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "doc" + TOKEN_TREE + L_PAREN "(" + STRING "\"Can be\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "doc" + TOKEN_TREE + L_PAREN "(" + STRING "\"Stacked\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast b/crates/parser/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast rename to crates/parser/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rs b/crates/parser/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rs rename to crates/parser/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rs diff --git a/crates/parser/test_data/parser/inline/ok/0121_match_arms_outer_attributes.txt b/crates/parser/test_data/parser/inline/ok/0121_match_arms_outer_attributes.txt new file mode 100644 index 0000000000..0f7580c1a3 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0121_match_arms_outer_attributes.txt @@ -0,0 +1,151 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "cfg" + TOKEN_TREE + L_PAREN "(" + IDENT "feature" + WHITESPACE " " + EQ "=" + WHITESPACE " " + STRING "\"some\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "cfg" + TOKEN_TREE + L_PAREN "(" + IDENT "feature" + WHITESPACE " " + EQ "=" + WHITESPACE " " + STRING "\"other\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "cfg" + TOKEN_TREE + L_PAREN "(" + IDENT "feature" + WHITESPACE " " + EQ "=" + WHITESPACE " " + STRING "\"many\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "cfg" + TOKEN_TREE + L_PAREN "(" + IDENT "feature" + WHITESPACE " " + EQ "=" + WHITESPACE " " + STRING "\"attributes\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "cfg" + TOKEN_TREE + L_PAREN "(" + IDENT "feature" + WHITESPACE " " + EQ "=" + WHITESPACE " " + STRING "\"before\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0123_param_list_vararg.rast b/crates/parser/test_data/parser/inline/ok/0123_param_list_vararg.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0123_param_list_vararg.rast rename to crates/parser/test_data/parser/inline/ok/0123_param_list_vararg.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0123_param_list_vararg.rs b/crates/parser/test_data/parser/inline/ok/0123_param_list_vararg.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0123_param_list_vararg.rs rename to crates/parser/test_data/parser/inline/ok/0123_param_list_vararg.rs diff --git a/crates/parser/test_data/parser/inline/ok/0123_param_list_vararg.txt b/crates/parser/test_data/parser/inline/ok/0123_param_list_vararg.txt new file mode 100644 index 0000000000..c86cf18bbe --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0123_param_list_vararg.txt @@ -0,0 +1,50 @@ +SOURCE_FILE + EXTERN_BLOCK + ABI + EXTERN_KW "extern" + WHITESPACE " " + STRING "\"C\"" + WHITESPACE " " + EXTERN_ITEM_LIST + L_CURLY "{" + WHITESPACE " " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "printf" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "format" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + CONST_KW "const" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i8" + COMMA "," + WHITESPACE " " + PARAM + DOT3 "..." + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast b/crates/parser/test_data/parser/inline/ok/0125_crate_keyword_path.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast rename to crates/parser/test_data/parser/inline/ok/0125_crate_keyword_path.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rs b/crates/parser/test_data/parser/inline/ok/0125_crate_keyword_path.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rs rename to crates/parser/test_data/parser/inline/ok/0125_crate_keyword_path.rs diff --git a/crates/parser/test_data/parser/inline/ok/0125_crate_keyword_path.txt b/crates/parser/test_data/parser/inline/ok/0125_crate_keyword_path.txt new file mode 100644 index 0000000000..8d9b61630a --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0125_crate_keyword_path.txt @@ -0,0 +1,33 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH + PATH_SEGMENT + NAME_REF + CRATE_KW "crate" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "foo" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast b/crates/parser/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast rename to crates/parser/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rs b/crates/parser/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rs rename to crates/parser/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0125_record_literal_field_with_attr.txt b/crates/parser/test_data/parser/inline/ok/0125_record_literal_field_with_attr.txt new file mode 100644 index 0000000000..a1df70841e --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0125_record_literal_field_with_attr.txt @@ -0,0 +1,49 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + RECORD_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_EXPR_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_EXPR_FIELD + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "cfg" + TOKEN_TREE + L_PAREN "(" + IDENT "test" + R_PAREN ")" + R_BRACK "]" + WHITESPACE " " + NAME_REF + IDENT "field" + COLON ":" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast b/crates/parser/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast rename to crates/parser/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rs b/crates/parser/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rs rename to crates/parser/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rs diff --git a/crates/parser/test_data/parser/inline/ok/0126_attr_on_expr_stmt.txt b/crates/parser/test_data/parser/inline/ok/0126_attr_on_expr_stmt.txt new file mode 100644 index 0000000000..cafd059f24 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0126_attr_on_expr_stmt.txt @@ -0,0 +1,104 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "A" + R_BRACK "]" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + MACRO_CALL + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "B" + R_BRACK "]" + WHITESPACE " " + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" + BANG "!" + TOKEN_TREE + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + BLOCK_EXPR + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "C" + R_BRACK "]" + WHITESPACE " " + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "D" + R_BRACK "]" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + RETURN_EXPR + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "D" + R_BRACK "]" + WHITESPACE " " + RETURN_KW "return" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0129_marco_pat.rast b/crates/parser/test_data/parser/inline/ok/0129_marco_pat.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0129_marco_pat.rast rename to crates/parser/test_data/parser/inline/ok/0129_marco_pat.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0129_marco_pat.rs b/crates/parser/test_data/parser/inline/ok/0129_marco_pat.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0129_marco_pat.rs rename to crates/parser/test_data/parser/inline/ok/0129_marco_pat.rs diff --git a/crates/parser/test_data/parser/inline/ok/0129_marco_pat.txt b/crates/parser/test_data/parser/inline/ok/0129_marco_pat.txt new file mode 100644 index 0000000000..cedaa90453 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0129_marco_pat.txt @@ -0,0 +1,37 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + MACRO_PAT + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "m" + BANG "!" + TOKEN_TREE + L_PAREN "(" + IDENT "x" + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "0" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0130_let_stmt.rast b/crates/parser/test_data/parser/inline/ok/0130_let_stmt.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0130_let_stmt.rast rename to crates/parser/test_data/parser/inline/ok/0130_let_stmt.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0130_let_stmt.rs b/crates/parser/test_data/parser/inline/ok/0130_let_stmt.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0130_let_stmt.rs rename to crates/parser/test_data/parser/inline/ok/0130_let_stmt.rs diff --git a/crates/parser/test_data/parser/inline/ok/0130_let_stmt.txt b/crates/parser/test_data/parser/inline/ok/0130_let_stmt.txt new file mode 100644 index 0000000000..de9d0fc19e --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0130_let_stmt.txt @@ -0,0 +1,36 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0130_try_block_expr.rast b/crates/parser/test_data/parser/inline/ok/0130_try_block_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0130_try_block_expr.rast rename to crates/parser/test_data/parser/inline/ok/0130_try_block_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0130_try_block_expr.rs b/crates/parser/test_data/parser/inline/ok/0130_try_block_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0130_try_block_expr.rs rename to crates/parser/test_data/parser/inline/ok/0130_try_block_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0130_try_block_expr.txt b/crates/parser/test_data/parser/inline/ok/0130_try_block_expr.txt new file mode 100644 index 0000000000..aec8fbf477 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0130_try_block_expr.txt @@ -0,0 +1,32 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + BLOCK_EXPR + TRY_KW "try" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0131_existential_type.rast b/crates/parser/test_data/parser/inline/ok/0131_existential_type.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0131_existential_type.rast rename to crates/parser/test_data/parser/inline/ok/0131_existential_type.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0131_existential_type.rs b/crates/parser/test_data/parser/inline/ok/0131_existential_type.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0131_existential_type.rs rename to crates/parser/test_data/parser/inline/ok/0131_existential_type.rs diff --git a/crates/parser/test_data/parser/inline/ok/0131_existential_type.txt b/crates/parser/test_data/parser/inline/ok/0131_existential_type.txt new file mode 100644 index 0000000000..b73780261b --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0131_existential_type.txt @@ -0,0 +1,31 @@ +SOURCE_FILE + TYPE_ALIAS + EXISTENTIAL_KW "existential" + WHITESPACE " " + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "Foo" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Fn" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "usize" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0132_box_expr.rast b/crates/parser/test_data/parser/inline/ok/0132_box_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0132_box_expr.rast rename to crates/parser/test_data/parser/inline/ok/0132_box_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0132_box_expr.rs b/crates/parser/test_data/parser/inline/ok/0132_box_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0132_box_expr.rs rename to crates/parser/test_data/parser/inline/ok/0132_box_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0132_box_expr.txt b/crates/parser/test_data/parser/inline/ok/0132_box_expr.txt new file mode 100644 index 0000000000..b21f37cd85 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0132_box_expr.txt @@ -0,0 +1,90 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "x" + WHITESPACE " " + EQ "=" + WHITESPACE " " + BOX_EXPR + BOX_KW "box" + WHITESPACE " " + LITERAL + INT_NUMBER "1i32" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "y" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + BOX_EXPR + BOX_KW "box" + WHITESPACE " " + LITERAL + INT_NUMBER "1i32" + COMMA "," + WHITESPACE " " + BOX_EXPR + BOX_KW "box" + WHITESPACE " " + LITERAL + INT_NUMBER "2i32" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "z" + WHITESPACE " " + EQ "=" + WHITESPACE " " + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + ARG_LIST + L_PAREN "(" + BOX_EXPR + BOX_KW "box" + WHITESPACE " " + LITERAL + INT_NUMBER "1i32" + COMMA "," + WHITESPACE " " + BOX_EXPR + BOX_KW "box" + WHITESPACE " " + LITERAL + INT_NUMBER "2i32" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast b/crates/parser/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast rename to crates/parser/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rs b/crates/parser/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rs rename to crates/parser/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rs diff --git a/crates/parser/test_data/parser/inline/ok/0134_nocontentexpr_after_item.txt b/crates/parser/test_data/parser/inline/ok/0134_nocontentexpr_after_item.txt new file mode 100644 index 0000000000..f5ee12fe96 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0134_nocontentexpr_after_item.txt @@ -0,0 +1,64 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "simple_function" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + ENUM + ENUM_KW "enum" + WHITESPACE " " + NAME + IDENT "LocalEnum" + WHITESPACE " " + VARIANT_LIST + L_CURLY "{" + WHITESPACE "\n " + VARIANT + NAME + IDENT "One" + COMMA "," + WHITESPACE "\n " + VARIANT + NAME + IDENT "Two" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0137_await_expr.rast b/crates/parser/test_data/parser/inline/ok/0137_await_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0137_await_expr.rast rename to crates/parser/test_data/parser/inline/ok/0137_await_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0137_await_expr.rs b/crates/parser/test_data/parser/inline/ok/0137_await_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0137_await_expr.rs rename to crates/parser/test_data/parser/inline/ok/0137_await_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0137_await_expr.txt b/crates/parser/test_data/parser/inline/ok/0137_await_expr.txt new file mode 100644 index 0000000000..9d37ada0da --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0137_await_expr.txt @@ -0,0 +1,70 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + AWAIT_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + DOT "." + AWAIT_KW "await" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + AWAIT_EXPR + FIELD_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + DOT "." + NAME_REF + INT_NUMBER "0" + DOT "." + AWAIT_KW "await" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + METHOD_CALL_EXPR + TRY_EXPR + AWAIT_EXPR + CALL_EXPR + FIELD_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + DOT "." + NAME_REF + INT_NUMBER "0" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + DOT "." + AWAIT_KW "await" + QUESTION "?" + DOT "." + NAME_REF + IDENT "hello" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast b/crates/parser/test_data/parser/inline/ok/0138_associated_type_bounds.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast rename to crates/parser/test_data/parser/inline/ok/0138_associated_type_bounds.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rs b/crates/parser/test_data/parser/inline/ok/0138_associated_type_bounds.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rs rename to crates/parser/test_data/parser/inline/ok/0138_associated_type_bounds.rs diff --git a/crates/parser/test_data/parser/inline/ok/0138_associated_type_bounds.txt b/crates/parser/test_data/parser/inline/ok/0138_associated_type_bounds.txt new file mode 100644 index 0000000000..8cbc98c51c --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0138_associated_type_bounds.txt @@ -0,0 +1,111 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "print_all" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Iterator" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Item" + COMMA "," + WHITESPACE " " + TYPE_ARG + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "Item" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Item" + COMMA "," + WHITESPACE " " + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Item" + GENERIC_ARG_LIST + COLON2 "::" + L_ANGLE "<" + CONST_ARG + LITERAL + TRUE_KW "true" + R_ANGLE ">" + COMMA "," + WHITESPACE " " + ASSOC_TYPE_ARG + NAME_REF + IDENT "Item" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Display" + COMMA "," + WHITESPACE " " + ASSOC_TYPE_ARG + NAME_REF + IDENT "Item" + GENERIC_ARG_LIST + L_ANGLE "<" + LIFETIME_ARG + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Item" + R_ANGLE ">" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "printables" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0138_expression_after_block.rast b/crates/parser/test_data/parser/inline/ok/0138_expression_after_block.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0138_expression_after_block.rast rename to crates/parser/test_data/parser/inline/ok/0138_expression_after_block.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0138_expression_after_block.rs b/crates/parser/test_data/parser/inline/ok/0138_expression_after_block.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0138_expression_after_block.rs rename to crates/parser/test_data/parser/inline/ok/0138_expression_after_block.rs diff --git a/crates/parser/test_data/parser/inline/ok/0138_expression_after_block.txt b/crates/parser/test_data/parser/inline/ok/0138_expression_after_block.txt new file mode 100644 index 0000000000..553ac356d7 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0138_expression_after_block.txt @@ -0,0 +1,66 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + MUT_KW "mut" + WHITESPACE " " + NAME + IDENT "p" + WHITESPACE " " + EQ "=" + WHITESPACE " " + RECORD_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "F" + RECORD_EXPR_FIELD_LIST + L_CURLY "{" + RECORD_EXPR_FIELD + NAME_REF + IDENT "x" + COLON ":" + WHITESPACE " " + LITERAL + INT_NUMBER "5" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + FIELD_EXPR + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "p" + R_CURLY "}" + DOT "." + NAME_REF + IDENT "x" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "10" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast b/crates/parser/test_data/parser/inline/ok/0138_self_param_outer_attr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast rename to crates/parser/test_data/parser/inline/ok/0138_self_param_outer_attr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rs b/crates/parser/test_data/parser/inline/ok/0138_self_param_outer_attr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rs rename to crates/parser/test_data/parser/inline/ok/0138_self_param_outer_attr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0138_self_param_outer_attr.txt b/crates/parser/test_data/parser/inline/ok/0138_self_param_outer_attr.txt new file mode 100644 index 0000000000..db583f7d52 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0138_self_param_outer_attr.txt @@ -0,0 +1,28 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "must_use" + R_BRACK "]" + WHITESPACE " " + NAME + SELF_KW "self" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast b/crates/parser/test_data/parser/inline/ok/0139_param_outer_arg.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast rename to crates/parser/test_data/parser/inline/ok/0139_param_outer_arg.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0139_param_outer_arg.rs b/crates/parser/test_data/parser/inline/ok/0139_param_outer_arg.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0139_param_outer_arg.rs rename to crates/parser/test_data/parser/inline/ok/0139_param_outer_arg.rs diff --git a/crates/parser/test_data/parser/inline/ok/0139_param_outer_arg.txt b/crates/parser/test_data/parser/inline/ok/0139_param_outer_arg.txt new file mode 100644 index 0000000000..c63ea020a3 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0139_param_outer_arg.txt @@ -0,0 +1,36 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr1" + R_BRACK "]" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "pat" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Type" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0142_for_range_from.rast b/crates/parser/test_data/parser/inline/ok/0142_for_range_from.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0142_for_range_from.rast rename to crates/parser/test_data/parser/inline/ok/0142_for_range_from.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0142_for_range_from.rs b/crates/parser/test_data/parser/inline/ok/0142_for_range_from.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0142_for_range_from.rs rename to crates/parser/test_data/parser/inline/ok/0142_for_range_from.rs diff --git a/crates/parser/test_data/parser/inline/ok/0142_for_range_from.txt b/crates/parser/test_data/parser/inline/ok/0142_for_range_from.txt new file mode 100644 index 0000000000..90cf3101c1 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0142_for_range_from.txt @@ -0,0 +1,42 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + FOR_EXPR + FOR_KW "for" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "x" + WHITESPACE " " + IN_KW "in" + WHITESPACE " " + RANGE_EXPR + LITERAL + INT_NUMBER "0" + WHITESPACE " " + DOT2 ".." + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + BREAK_EXPR + BREAK_KW "break" + SEMICOLON ";" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0143_box_pat.rast b/crates/parser/test_data/parser/inline/ok/0143_box_pat.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0143_box_pat.rast rename to crates/parser/test_data/parser/inline/ok/0143_box_pat.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0143_box_pat.rs b/crates/parser/test_data/parser/inline/ok/0143_box_pat.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0143_box_pat.rs rename to crates/parser/test_data/parser/inline/ok/0143_box_pat.rs diff --git a/crates/parser/test_data/parser/inline/ok/0143_box_pat.txt b/crates/parser/test_data/parser/inline/ok/0143_box_pat.txt new file mode 100644 index 0000000000..df22decde1 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0143_box_pat.txt @@ -0,0 +1,111 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + BOX_PAT + BOX_KW "box" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "i" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + BOX_PAT + BOX_KW "box" + WHITESPACE " " + RECORD_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Outer" + WHITESPACE " " + RECORD_PAT_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_PAT_FIELD + BOX_PAT + BOX_KW "box" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "i" + COMMA "," + WHITESPACE " " + RECORD_PAT_FIELD + NAME_REF + IDENT "j" + COLON ":" + WHITESPACE " " + BOX_PAT + BOX_KW "box" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Inner" + L_PAREN "(" + BOX_PAT + BOX_KW "box" + WHITESPACE " " + REF_PAT + AMP "&" + IDENT_PAT + NAME + IDENT "x" + R_PAREN ")" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + BOX_PAT + BOX_KW "box" + WHITESPACE " " + IDENT_PAT + REF_KW "ref" + WHITESPACE " " + MUT_KW "mut" + WHITESPACE " " + NAME + IDENT "i" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast b/crates/parser/test_data/parser/inline/ok/0144_dot_dot_pat.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast rename to crates/parser/test_data/parser/inline/ok/0144_dot_dot_pat.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rs b/crates/parser/test_data/parser/inline/ok/0144_dot_dot_pat.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rs rename to crates/parser/test_data/parser/inline/ok/0144_dot_dot_pat.rs diff --git a/crates/parser/test_data/parser/inline/ok/0144_dot_dot_pat.txt b/crates/parser/test_data/parser/inline/ok/0144_dot_dot_pat.txt new file mode 100644 index 0000000000..4d4011e6b4 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0144_dot_dot_pat.txt @@ -0,0 +1,456 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + REST_PAT + DOT2 ".." + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + COMMENT "//" + WHITESPACE "\n " + COMMENT "// Tuples" + WHITESPACE "\n " + COMMENT "//" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_PAT + L_PAREN "(" + IDENT_PAT + NAME + IDENT "a" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_PAT + L_PAREN "(" + IDENT_PAT + NAME + IDENT "a" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + COMMA "," + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Tuple" + L_PAREN "(" + IDENT_PAT + NAME + IDENT "a" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Tuple" + L_PAREN "(" + IDENT_PAT + NAME + IDENT "a" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + COMMA "," + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_PAT + L_PAREN "(" + REST_PAT + DOT2 ".." + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Tuple" + L_PAREN "(" + REST_PAT + DOT2 ".." + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_PAT + L_PAREN "(" + REST_PAT + DOT2 ".." + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "a" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Tuple" + L_PAREN "(" + REST_PAT + DOT2 ".." + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "a" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + COMMENT "//" + WHITESPACE "\n " + COMMENT "// Slices" + WHITESPACE "\n " + COMMENT "//" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + SLICE_PAT + L_BRACK "[" + REST_PAT + DOT2 ".." + R_BRACK "]" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + SLICE_PAT + L_BRACK "[" + IDENT_PAT + NAME + IDENT "head" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + R_BRACK "]" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + SLICE_PAT + L_BRACK "[" + IDENT_PAT + NAME + IDENT "head" + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "tail" + WHITESPACE " " + AT "@" + WHITESPACE " " + REST_PAT + DOT2 ".." + R_BRACK "]" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + SLICE_PAT + L_BRACK "[" + IDENT_PAT + NAME + IDENT "head" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "cons" + R_BRACK "]" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + SLICE_PAT + L_BRACK "[" + IDENT_PAT + NAME + IDENT "head" + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "mid" + WHITESPACE " " + AT "@" + WHITESPACE " " + REST_PAT + DOT2 ".." + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "cons" + R_BRACK "]" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + SLICE_PAT + L_BRACK "[" + IDENT_PAT + NAME + IDENT "head" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "cons" + R_BRACK "]" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + SLICE_PAT + L_BRACK "[" + IDENT_PAT + NAME + IDENT "head" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "mid" + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "tail" + WHITESPACE " " + AT "@" + WHITESPACE " " + REST_PAT + DOT2 ".." + R_BRACK "]" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + SLICE_PAT + L_BRACK "[" + IDENT_PAT + NAME + IDENT "head" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "mid" + COMMA "," + WHITESPACE " " + REST_PAT + DOT2 ".." + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "cons" + R_BRACK "]" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rast b/crates/parser/test_data/parser/inline/ok/0145_record_pat_field.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rast rename to crates/parser/test_data/parser/inline/ok/0145_record_pat_field.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rs b/crates/parser/test_data/parser/inline/ok/0145_record_pat_field.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0145_record_pat_field.rs rename to crates/parser/test_data/parser/inline/ok/0145_record_pat_field.rs diff --git a/crates/parser/test_data/parser/inline/ok/0145_record_pat_field.txt b/crates/parser/test_data/parser/inline/ok/0145_record_pat_field.txt new file mode 100644 index 0000000000..f3d2fde466 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0145_record_pat_field.txt @@ -0,0 +1,123 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + RECORD_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_PAT_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_PAT_FIELD + NAME_REF + INT_NUMBER "0" + COLON ":" + WHITESPACE " " + LITERAL_PAT + LITERAL + INT_NUMBER "1" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + RECORD_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_PAT_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_PAT_FIELD + NAME_REF + IDENT "x" + COLON ":" + WHITESPACE " " + LITERAL_PAT + LITERAL + INT_NUMBER "1" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + RECORD_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_PAT_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_PAT_FIELD + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "cfg" + TOKEN_TREE + L_PAREN "(" + IDENT "any" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + R_BRACK "]" + WHITESPACE " " + NAME_REF + IDENT "x" + COLON ":" + WHITESPACE " " + LITERAL_PAT + LITERAL + INT_NUMBER "1" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0146_as_precedence.rast b/crates/parser/test_data/parser/inline/ok/0146_as_precedence.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0146_as_precedence.rast rename to crates/parser/test_data/parser/inline/ok/0146_as_precedence.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0146_as_precedence.rs b/crates/parser/test_data/parser/inline/ok/0146_as_precedence.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0146_as_precedence.rs rename to crates/parser/test_data/parser/inline/ok/0146_as_precedence.rs diff --git a/crates/parser/test_data/parser/inline/ok/0146_as_precedence.txt b/crates/parser/test_data/parser/inline/ok/0146_as_precedence.txt new file mode 100644 index 0000000000..4079d2a991 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0146_as_precedence.txt @@ -0,0 +1,43 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + CAST_EXPR + REF_EXPR + AMP "&" + LITERAL + INT_NUMBER "1" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PTR_TYPE + STAR "*" + CONST_KW "const" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0147_const_param.rast b/crates/parser/test_data/parser/inline/ok/0147_const_param.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0147_const_param.rast rename to crates/parser/test_data/parser/inline/ok/0147_const_param.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0147_const_param.rs b/crates/parser/test_data/parser/inline/ok/0147_const_param.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0147_const_param.rs rename to crates/parser/test_data/parser/inline/ok/0147_const_param.rs diff --git a/crates/parser/test_data/parser/inline/ok/0147_const_param.txt b/crates/parser/test_data/parser/inline/ok/0147_const_param.txt new file mode 100644 index 0000000000..24595a1a18 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0147_const_param.txt @@ -0,0 +1,23 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + GENERIC_PARAM_LIST + L_ANGLE "<" + CONST_PARAM + CONST_KW "const" + WHITESPACE " " + NAME + IDENT "N" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0147_macro_def.rast b/crates/parser/test_data/parser/inline/ok/0147_macro_def.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0147_macro_def.rast rename to crates/parser/test_data/parser/inline/ok/0147_macro_def.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0147_macro_def.rs b/crates/parser/test_data/parser/inline/ok/0147_macro_def.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0147_macro_def.rs rename to crates/parser/test_data/parser/inline/ok/0147_macro_def.rs diff --git a/crates/parser/test_data/parser/inline/ok/0147_macro_def.txt b/crates/parser/test_data/parser/inline/ok/0147_macro_def.txt new file mode 100644 index 0000000000..01de13a907 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0147_macro_def.txt @@ -0,0 +1,19 @@ +SOURCE_FILE + MACRO_DEF + MACRO_KW "macro" + WHITESPACE " " + NAME + IDENT "m" + TOKEN_TREE + TOKEN_TREE + L_PAREN "(" + DOLLAR "$" + IDENT "i" + COLON ":" + IDENT "ident" + R_PAREN ")" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0150_array_attrs.rast b/crates/parser/test_data/parser/inline/ok/0150_array_attrs.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0150_array_attrs.rast rename to crates/parser/test_data/parser/inline/ok/0150_array_attrs.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0150_array_attrs.rs b/crates/parser/test_data/parser/inline/ok/0150_array_attrs.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0150_array_attrs.rs rename to crates/parser/test_data/parser/inline/ok/0150_array_attrs.rs diff --git a/crates/parser/test_data/parser/inline/ok/0150_array_attrs.txt b/crates/parser/test_data/parser/inline/ok/0150_array_attrs.txt new file mode 100644 index 0000000000..6eb8af3311 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0150_array_attrs.txt @@ -0,0 +1,48 @@ +SOURCE_FILE + CONST + CONST_KW "const" + WHITESPACE " " + NAME + IDENT "A" + COLON ":" + WHITESPACE " " + REF_TYPE + AMP "&" + SLICE_TYPE + L_BRACK "[" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i64" + R_BRACK "]" + WHITESPACE " " + EQ "=" + WHITESPACE " " + REF_EXPR + AMP "&" + ARRAY_EXPR + L_BRACK "[" + LITERAL + INT_NUMBER "1" + COMMA "," + WHITESPACE " " + LITERAL + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "cfg" + TOKEN_TREE + L_PAREN "(" + IDENT "test" + R_PAREN ")" + R_BRACK "]" + WHITESPACE " " + INT_NUMBER "2" + R_BRACK "]" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0150_impl_type_params.rast b/crates/parser/test_data/parser/inline/ok/0150_impl_type_params.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0150_impl_type_params.rast rename to crates/parser/test_data/parser/inline/ok/0150_impl_type_params.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0150_impl_type_params.rs b/crates/parser/test_data/parser/inline/ok/0150_impl_type_params.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0150_impl_type_params.rs rename to crates/parser/test_data/parser/inline/ok/0150_impl_type_params.rs diff --git a/crates/parser/test_data/parser/inline/ok/0150_impl_type_params.txt b/crates/parser/test_data/parser/inline/ok/0150_impl_type_params.txt new file mode 100644 index 0000000000..24977a22a5 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0150_impl_type_params.txt @@ -0,0 +1,38 @@ +SOURCE_FILE + IMPL + IMPL_KW "impl" + GENERIC_PARAM_LIST + L_ANGLE "<" + CONST_PARAM + CONST_KW "const" + WHITESPACE " " + NAME + IDENT "N" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + R_ANGLE ">" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Bar" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "N" + R_ANGLE ">" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0151_fn.rast b/crates/parser/test_data/parser/inline/ok/0151_fn.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0151_fn.rast rename to crates/parser/test_data/parser/inline/ok/0151_fn.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0151_fn.rs b/crates/parser/test_data/parser/inline/ok/0151_fn.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0151_fn.rs rename to crates/parser/test_data/parser/inline/ok/0151_fn.rs diff --git a/crates/parser/test_data/parser/inline/ok/0151_fn.txt b/crates/parser/test_data/parser/inline/ok/0151_fn.txt new file mode 100644 index 0000000000..a88b3393f2 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0151_fn.txt @@ -0,0 +1,15 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0151_trait_alias.rast b/crates/parser/test_data/parser/inline/ok/0151_trait_alias.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0151_trait_alias.rast rename to crates/parser/test_data/parser/inline/ok/0151_trait_alias.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0151_trait_alias.rs b/crates/parser/test_data/parser/inline/ok/0151_trait_alias.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0151_trait_alias.rs rename to crates/parser/test_data/parser/inline/ok/0151_trait_alias.rs diff --git a/crates/parser/test_data/parser/inline/ok/0151_trait_alias.txt b/crates/parser/test_data/parser/inline/ok/0151_trait_alias.txt new file mode 100644 index 0000000000..2ef66484ae --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0151_trait_alias.txt @@ -0,0 +1,33 @@ +SOURCE_FILE + TRAIT + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "Z" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "U" + R_ANGLE ">" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "U" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast b/crates/parser/test_data/parser/inline/ok/0152_arg_with_attr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast rename to crates/parser/test_data/parser/inline/ok/0152_arg_with_attr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0152_arg_with_attr.rs b/crates/parser/test_data/parser/inline/ok/0152_arg_with_attr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0152_arg_with_attr.rs rename to crates/parser/test_data/parser/inline/ok/0152_arg_with_attr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0152_arg_with_attr.txt b/crates/parser/test_data/parser/inline/ok/0152_arg_with_attr.txt new file mode 100644 index 0000000000..ae1074c368 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0152_arg_with_attr.txt @@ -0,0 +1,38 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + ARG_LIST + L_PAREN "(" + LITERAL + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE " " + INT_NUMBER "92" + R_PAREN ")" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0153_pub_parens_typepath.rast b/crates/parser/test_data/parser/inline/ok/0153_pub_parens_typepath.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0153_pub_parens_typepath.rast rename to crates/parser/test_data/parser/inline/ok/0153_pub_parens_typepath.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0153_pub_parens_typepath.rs b/crates/parser/test_data/parser/inline/ok/0153_pub_parens_typepath.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0153_pub_parens_typepath.rs rename to crates/parser/test_data/parser/inline/ok/0153_pub_parens_typepath.rs diff --git a/crates/parser/test_data/parser/inline/ok/0153_pub_parens_typepath.txt b/crates/parser/test_data/parser/inline/ok/0153_pub_parens_typepath.txt new file mode 100644 index 0000000000..2dede83598 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0153_pub_parens_typepath.txt @@ -0,0 +1,56 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "B" + TUPLE_FIELD_LIST + L_PAREN "(" + TUPLE_FIELD + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + PAREN_TYPE + L_PAREN "(" + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + SUPER_KW "super" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "A" + R_PAREN ")" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "B" + TUPLE_FIELD_LIST + L_PAREN "(" + TUPLE_FIELD + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + CRATE_KW "crate" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "A" + COMMA "," + R_PAREN ")" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rast b/crates/parser/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rast rename to crates/parser/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rs b/crates/parser/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rs rename to crates/parser/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rs diff --git a/crates/parser/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.txt b/crates/parser/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.txt new file mode 100644 index 0000000000..ee8465e6ca --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.txt @@ -0,0 +1,58 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "Foo" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FN_PTR_TYPE + FN_KW "fn" + PARAM_LIST + L_PAREN "(" + PARAM + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "Bar" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Baz" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "Qux" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FN_PTR_TYPE + FN_KW "fn" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "baz" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "Bar" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Baz" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rast b/crates/parser/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rast rename to crates/parser/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rs b/crates/parser/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rs rename to crates/parser/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.rs diff --git a/crates/parser/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.txt b/crates/parser/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.txt new file mode 100644 index 0000000000..30a2842e53 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0154_no_dyn_trait_leading_for.txt @@ -0,0 +1,43 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "A" + WHITESPACE " " + EQ "=" + WHITESPACE " " + DYN_TRAIT_TYPE + TYPE_BOUND_LIST + TYPE_BOUND + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Test" + GENERIC_ARG_LIST + L_ANGLE "<" + LIFETIME_ARG + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Send" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0154_tuple_attrs.rast b/crates/parser/test_data/parser/inline/ok/0154_tuple_attrs.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0154_tuple_attrs.rast rename to crates/parser/test_data/parser/inline/ok/0154_tuple_attrs.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0154_tuple_attrs.rs b/crates/parser/test_data/parser/inline/ok/0154_tuple_attrs.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0154_tuple_attrs.rs rename to crates/parser/test_data/parser/inline/ok/0154_tuple_attrs.rs diff --git a/crates/parser/test_data/parser/inline/ok/0154_tuple_attrs.txt b/crates/parser/test_data/parser/inline/ok/0154_tuple_attrs.txt new file mode 100644 index 0000000000..39857b23c6 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0154_tuple_attrs.txt @@ -0,0 +1,51 @@ +SOURCE_FILE + CONST + CONST_KW "const" + WHITESPACE " " + NAME + IDENT "A" + COLON ":" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i64" + COMMA "," + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i64" + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + LITERAL + INT_NUMBER "1" + COMMA "," + WHITESPACE " " + LITERAL + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "cfg" + TOKEN_TREE + L_PAREN "(" + IDENT "test" + R_PAREN ")" + R_BRACK "]" + WHITESPACE " " + INT_NUMBER "2" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0155_closure_params.rast b/crates/parser/test_data/parser/inline/ok/0155_closure_params.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0155_closure_params.rast rename to crates/parser/test_data/parser/inline/ok/0155_closure_params.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0155_closure_params.rs b/crates/parser/test_data/parser/inline/ok/0155_closure_params.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0155_closure_params.rs rename to crates/parser/test_data/parser/inline/ok/0155_closure_params.rs diff --git a/crates/parser/test_data/parser/inline/ok/0155_closure_params.txt b/crates/parser/test_data/parser/inline/ok/0155_closure_params.txt new file mode 100644 index 0000000000..318eb89dea --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0155_closure_params.txt @@ -0,0 +1,70 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "foo" + WHITESPACE " " + EQ "=" + WHITESPACE " " + CLOSURE_EXPR + PARAM_LIST + PIPE "|" + PARAM + IDENT_PAT + NAME + IDENT "bar" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "baz" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Baz" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "qux" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "Qux" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Quux" + PIPE "|" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0156_const_block_pat.rast b/crates/parser/test_data/parser/inline/ok/0156_const_block_pat.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0156_const_block_pat.rast rename to crates/parser/test_data/parser/inline/ok/0156_const_block_pat.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0156_const_block_pat.rs b/crates/parser/test_data/parser/inline/ok/0156_const_block_pat.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0156_const_block_pat.rs rename to crates/parser/test_data/parser/inline/ok/0156_const_block_pat.rs diff --git a/crates/parser/test_data/parser/inline/ok/0156_const_block_pat.txt b/crates/parser/test_data/parser/inline/ok/0156_const_block_pat.txt new file mode 100644 index 0000000000..59de2b9f16 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0156_const_block_pat.txt @@ -0,0 +1,79 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + CONST_BLOCK_PAT + CONST_KW "const" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LITERAL + INT_NUMBER "15" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + CONST_BLOCK_PAT + CONST_KW "const" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE " " + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0156_fn_def_param.rast b/crates/parser/test_data/parser/inline/ok/0156_fn_def_param.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0156_fn_def_param.rast rename to crates/parser/test_data/parser/inline/ok/0156_fn_def_param.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0156_fn_def_param.rs b/crates/parser/test_data/parser/inline/ok/0156_fn_def_param.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0156_fn_def_param.rs rename to crates/parser/test_data/parser/inline/ok/0156_fn_def_param.rs diff --git a/crates/parser/test_data/parser/inline/ok/0156_fn_def_param.txt b/crates/parser/test_data/parser/inline/ok/0156_fn_def_param.txt new file mode 100644 index 0000000000..7511877aa8 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0156_fn_def_param.txt @@ -0,0 +1,44 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + PARAM + TUPLE_PAT + L_PAREN "(" + IDENT_PAT + NAME + IDENT "x" + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "y" + R_PAREN ")" + COLON ":" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + COMMA "," + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_PAREN ")" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0156_or_pattern.rast b/crates/parser/test_data/parser/inline/ok/0156_or_pattern.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0156_or_pattern.rast rename to crates/parser/test_data/parser/inline/ok/0156_or_pattern.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0156_or_pattern.rs b/crates/parser/test_data/parser/inline/ok/0156_or_pattern.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0156_or_pattern.rs rename to crates/parser/test_data/parser/inline/ok/0156_or_pattern.rs diff --git a/crates/parser/test_data/parser/inline/ok/0156_or_pattern.txt b/crates/parser/test_data/parser/inline/ok/0156_or_pattern.txt new file mode 100644 index 0000000000..6a2046d9e9 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0156_or_pattern.txt @@ -0,0 +1,112 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + PAREN_PAT + L_PAREN "(" + OR_PAT + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + PIPE "|" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + R_PAREN ")" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + REF_PAT + AMP "&" + PAREN_PAT + L_PAREN "(" + OR_PAT + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + PIPE "|" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + R_PAREN ")" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + TUPLE_PAT + L_PAREN "(" + OR_PAT + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + PIPE "|" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + COMMA "," + R_PAREN ")" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + SLICE_PAT + L_BRACK "[" + OR_PAT + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + PIPE "|" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + COMMA "," + R_BRACK "]" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0157_const_block.rast b/crates/parser/test_data/parser/inline/ok/0157_const_block.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0157_const_block.rast rename to crates/parser/test_data/parser/inline/ok/0157_const_block.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0157_const_block.rs b/crates/parser/test_data/parser/inline/ok/0157_const_block.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0157_const_block.rs rename to crates/parser/test_data/parser/inline/ok/0157_const_block.rs diff --git a/crates/parser/test_data/parser/inline/ok/0157_const_block.txt b/crates/parser/test_data/parser/inline/ok/0157_const_block.txt new file mode 100644 index 0000000000..d2025b895d --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0157_const_block.txt @@ -0,0 +1,24 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + BLOCK_EXPR + CONST_KW "const" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast b/crates/parser/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast rename to crates/parser/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rs b/crates/parser/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rs rename to crates/parser/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rs diff --git a/crates/parser/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.txt b/crates/parser/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.txt new file mode 100644 index 0000000000..8a525c6e05 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.txt @@ -0,0 +1,26 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "Foo" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FN_PTR_TYPE + FN_KW "fn" + PARAM_LIST + L_PAREN "(" + PARAM + WILDCARD_PAT + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast b/crates/parser/test_data/parser/inline/ok/0157_variant_discriminant.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast rename to crates/parser/test_data/parser/inline/ok/0157_variant_discriminant.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0157_variant_discriminant.rs b/crates/parser/test_data/parser/inline/ok/0157_variant_discriminant.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0157_variant_discriminant.rs rename to crates/parser/test_data/parser/inline/ok/0157_variant_discriminant.rs diff --git a/crates/parser/test_data/parser/inline/ok/0157_variant_discriminant.txt b/crates/parser/test_data/parser/inline/ok/0157_variant_discriminant.txt new file mode 100644 index 0000000000..9f0c5a7610 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0157_variant_discriminant.txt @@ -0,0 +1,30 @@ +SOURCE_FILE + ENUM + ENUM_KW "enum" + WHITESPACE " " + NAME + IDENT "E" + WHITESPACE " " + VARIANT_LIST + L_CURLY "{" + WHITESPACE " " + VARIANT + NAME + IDENT "X" + TUPLE_FIELD_LIST + L_PAREN "(" + TUPLE_FIELD + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "10" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast b/crates/parser/test_data/parser/inline/ok/0158_binop_resets_statementness.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast rename to crates/parser/test_data/parser/inline/ok/0158_binop_resets_statementness.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rs b/crates/parser/test_data/parser/inline/ok/0158_binop_resets_statementness.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rs rename to crates/parser/test_data/parser/inline/ok/0158_binop_resets_statementness.rs diff --git a/crates/parser/test_data/parser/inline/ok/0158_binop_resets_statementness.txt b/crates/parser/test_data/parser/inline/ok/0158_binop_resets_statementness.txt new file mode 100644 index 0000000000..f667c1972d --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0158_binop_resets_statementness.txt @@ -0,0 +1,38 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "v" + WHITESPACE " " + EQ "=" + WHITESPACE " " + BIN_EXPR + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + LITERAL + INT_NUMBER "1" + R_CURLY "}" + AMP "&" + LITERAL + INT_NUMBER "2" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast b/crates/parser/test_data/parser/inline/ok/0158_lambda_ret_block.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast rename to crates/parser/test_data/parser/inline/ok/0158_lambda_ret_block.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rs b/crates/parser/test_data/parser/inline/ok/0158_lambda_ret_block.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rs rename to crates/parser/test_data/parser/inline/ok/0158_lambda_ret_block.rs diff --git a/crates/parser/test_data/parser/inline/ok/0158_lambda_ret_block.txt b/crates/parser/test_data/parser/inline/ok/0158_lambda_ret_block.txt new file mode 100644 index 0000000000..93238bd8f1 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0158_lambda_ret_block.txt @@ -0,0 +1,45 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + CALL_EXPR + CLOSURE_EXPR + PARAM_LIST + PIPE "|" + PIPE "|" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + WHITESPACE " " + R_CURLY "}" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0158_macro_rules_non_brace.rast b/crates/parser/test_data/parser/inline/ok/0158_macro_rules_non_brace.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0158_macro_rules_non_brace.rast rename to crates/parser/test_data/parser/inline/ok/0158_macro_rules_non_brace.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0158_macro_rules_non_brace.rs b/crates/parser/test_data/parser/inline/ok/0158_macro_rules_non_brace.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0158_macro_rules_non_brace.rs rename to crates/parser/test_data/parser/inline/ok/0158_macro_rules_non_brace.rs diff --git a/crates/parser/test_data/parser/inline/ok/0158_macro_rules_non_brace.txt b/crates/parser/test_data/parser/inline/ok/0158_macro_rules_non_brace.txt new file mode 100644 index 0000000000..45cd4d2aa1 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0158_macro_rules_non_brace.txt @@ -0,0 +1,57 @@ +SOURCE_FILE + MACRO_RULES + MACRO_RULES_KW "macro_rules" + BANG "!" + WHITESPACE " " + NAME + IDENT "m" + WHITESPACE " " + TOKEN_TREE + L_PAREN "(" + WHITESPACE " " + TOKEN_TREE + L_PAREN "(" + DOLLAR "$" + IDENT "i" + COLON ":" + IDENT "ident" + R_PAREN ")" + WHITESPACE " " + EQ "=" + R_ANGLE ">" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + R_CURLY "}" + WHITESPACE " " + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + MACRO_RULES + MACRO_RULES_KW "macro_rules" + BANG "!" + WHITESPACE " " + NAME + IDENT "m" + WHITESPACE " " + TOKEN_TREE + L_BRACK "[" + WHITESPACE " " + TOKEN_TREE + L_PAREN "(" + DOLLAR "$" + IDENT "i" + COLON ":" + IDENT "ident" + R_PAREN ")" + WHITESPACE " " + EQ "=" + R_ANGLE ">" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + R_CURLY "}" + WHITESPACE " " + R_BRACK "]" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0159_try_macro_fallback.rast b/crates/parser/test_data/parser/inline/ok/0159_try_macro_fallback.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0159_try_macro_fallback.rast rename to crates/parser/test_data/parser/inline/ok/0159_try_macro_fallback.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0159_try_macro_fallback.rs b/crates/parser/test_data/parser/inline/ok/0159_try_macro_fallback.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0159_try_macro_fallback.rs rename to crates/parser/test_data/parser/inline/ok/0159_try_macro_fallback.rs diff --git a/crates/parser/test_data/parser/inline/ok/0159_try_macro_fallback.txt b/crates/parser/test_data/parser/inline/ok/0159_try_macro_fallback.txt new file mode 100644 index 0000000000..d11ac22efa --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0159_try_macro_fallback.txt @@ -0,0 +1,35 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "try" + BANG "!" + TOKEN_TREE + L_PAREN "(" + IDENT "Ok" + TOKEN_TREE + L_PAREN "(" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0159_yield_expr.rast b/crates/parser/test_data/parser/inline/ok/0159_yield_expr.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0159_yield_expr.rast rename to crates/parser/test_data/parser/inline/ok/0159_yield_expr.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0159_yield_expr.rs b/crates/parser/test_data/parser/inline/ok/0159_yield_expr.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0159_yield_expr.rs rename to crates/parser/test_data/parser/inline/ok/0159_yield_expr.rs diff --git a/crates/parser/test_data/parser/inline/ok/0159_yield_expr.txt b/crates/parser/test_data/parser/inline/ok/0159_yield_expr.txt new file mode 100644 index 0000000000..31aa58de29 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0159_yield_expr.txt @@ -0,0 +1,29 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + YIELD_EXPR + YIELD_KW "yield" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + YIELD_EXPR + YIELD_KW "yield" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0160_crate_visibility_in.rast b/crates/parser/test_data/parser/inline/ok/0160_crate_visibility_in.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0160_crate_visibility_in.rast rename to crates/parser/test_data/parser/inline/ok/0160_crate_visibility_in.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0160_crate_visibility_in.rs b/crates/parser/test_data/parser/inline/ok/0160_crate_visibility_in.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0160_crate_visibility_in.rs rename to crates/parser/test_data/parser/inline/ok/0160_crate_visibility_in.rs diff --git a/crates/parser/test_data/parser/inline/ok/0160_crate_visibility_in.txt b/crates/parser/test_data/parser/inline/ok/0160_crate_visibility_in.txt new file mode 100644 index 0000000000..ac45c56956 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0160_crate_visibility_in.txt @@ -0,0 +1,42 @@ +SOURCE_FILE + STRUCT + VISIBILITY + PUB_KW "pub" + L_PAREN "(" + IN_KW "in" + WHITESPACE " " + PATH + PATH + PATH_SEGMENT + NAME_REF + SUPER_KW "super" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "A" + R_PAREN ")" + WHITESPACE " " + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + VISIBILITY + PUB_KW "pub" + L_PAREN "(" + IN_KW "in" + WHITESPACE " " + PATH + PATH_SEGMENT + NAME_REF + CRATE_KW "crate" + R_PAREN ")" + WHITESPACE " " + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0160_try_macro_rules.rast b/crates/parser/test_data/parser/inline/ok/0160_try_macro_rules.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0160_try_macro_rules.rast rename to crates/parser/test_data/parser/inline/ok/0160_try_macro_rules.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0160_try_macro_rules.rs b/crates/parser/test_data/parser/inline/ok/0160_try_macro_rules.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0160_try_macro_rules.rs rename to crates/parser/test_data/parser/inline/ok/0160_try_macro_rules.rs diff --git a/crates/parser/test_data/parser/inline/ok/0160_try_macro_rules.txt b/crates/parser/test_data/parser/inline/ok/0160_try_macro_rules.txt new file mode 100644 index 0000000000..e6916ae976 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0160_try_macro_rules.txt @@ -0,0 +1,24 @@ +SOURCE_FILE + MACRO_RULES + MACRO_RULES_KW "macro_rules" + BANG "!" + WHITESPACE " " + NAME + IDENT "try" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + WHITESPACE " " + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + EQ "=" + R_ANGLE ">" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + R_CURLY "}" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0161_impl_item_const.rast b/crates/parser/test_data/parser/inline/ok/0161_impl_item_const.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0161_impl_item_const.rast rename to crates/parser/test_data/parser/inline/ok/0161_impl_item_const.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0161_impl_item_const.rs b/crates/parser/test_data/parser/inline/ok/0161_impl_item_const.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0161_impl_item_const.rs rename to crates/parser/test_data/parser/inline/ok/0161_impl_item_const.rs diff --git a/crates/parser/test_data/parser/inline/ok/0161_impl_item_const.txt b/crates/parser/test_data/parser/inline/ok/0161_impl_item_const.txt new file mode 100644 index 0000000000..f7c7aaabc7 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0161_impl_item_const.txt @@ -0,0 +1,24 @@ +SOURCE_FILE + IMPL + IMPL_KW "impl" + WHITESPACE " " + CONST_KW "const" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Send" + WHITESPACE " " + FOR_KW "for" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0161_labeled_block.rast b/crates/parser/test_data/parser/inline/ok/0161_labeled_block.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0161_labeled_block.rast rename to crates/parser/test_data/parser/inline/ok/0161_labeled_block.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0161_labeled_block.rs b/crates/parser/test_data/parser/inline/ok/0161_labeled_block.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0161_labeled_block.rs rename to crates/parser/test_data/parser/inline/ok/0161_labeled_block.rs diff --git a/crates/parser/test_data/parser/inline/ok/0161_labeled_block.txt b/crates/parser/test_data/parser/inline/ok/0161_labeled_block.txt new file mode 100644 index 0000000000..181251d4f4 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0161_labeled_block.txt @@ -0,0 +1,28 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + BLOCK_EXPR + LABEL + LIFETIME + LIFETIME_IDENT "'label" + COLON ":" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rast b/crates/parser/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rast rename to crates/parser/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rs b/crates/parser/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rs rename to crates/parser/test_data/parser/inline/ok/0162_default_async_unsafe_fn.rs diff --git a/crates/parser/test_data/parser/inline/ok/0162_default_async_unsafe_fn.txt b/crates/parser/test_data/parser/inline/ok/0162_default_async_unsafe_fn.txt new file mode 100644 index 0000000000..7c2f7b34c7 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0162_default_async_unsafe_fn.txt @@ -0,0 +1,43 @@ +SOURCE_FILE + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + WHITESPACE " " + FOR_KW "for" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + DEFAULT_KW "default" + WHITESPACE " " + ASYNC_KW "async" + WHITESPACE " " + UNSAFE_KW "unsafe" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0162_unsafe_block.rast b/crates/parser/test_data/parser/inline/ok/0162_unsafe_block.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0162_unsafe_block.rast rename to crates/parser/test_data/parser/inline/ok/0162_unsafe_block.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0162_unsafe_block.rs b/crates/parser/test_data/parser/inline/ok/0162_unsafe_block.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0162_unsafe_block.rs rename to crates/parser/test_data/parser/inline/ok/0162_unsafe_block.rs diff --git a/crates/parser/test_data/parser/inline/ok/0162_unsafe_block.txt b/crates/parser/test_data/parser/inline/ok/0162_unsafe_block.txt new file mode 100644 index 0000000000..2149676ded --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0162_unsafe_block.txt @@ -0,0 +1,24 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + BLOCK_EXPR + UNSAFE_KW "unsafe" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0163_default_async_fn.rast b/crates/parser/test_data/parser/inline/ok/0163_default_async_fn.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0163_default_async_fn.rast rename to crates/parser/test_data/parser/inline/ok/0163_default_async_fn.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0163_default_async_fn.rs b/crates/parser/test_data/parser/inline/ok/0163_default_async_fn.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0163_default_async_fn.rs rename to crates/parser/test_data/parser/inline/ok/0163_default_async_fn.rs diff --git a/crates/parser/test_data/parser/inline/ok/0163_default_async_fn.txt b/crates/parser/test_data/parser/inline/ok/0163_default_async_fn.txt new file mode 100644 index 0000000000..06b37e2393 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0163_default_async_fn.txt @@ -0,0 +1,41 @@ +SOURCE_FILE + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + WHITESPACE " " + FOR_KW "for" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + DEFAULT_KW "default" + WHITESPACE " " + ASYNC_KW "async" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0163_default_unsafe_item.rast b/crates/parser/test_data/parser/inline/ok/0163_default_unsafe_item.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0163_default_unsafe_item.rast rename to crates/parser/test_data/parser/inline/ok/0163_default_unsafe_item.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0163_default_unsafe_item.rs b/crates/parser/test_data/parser/inline/ok/0163_default_unsafe_item.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0163_default_unsafe_item.rs rename to crates/parser/test_data/parser/inline/ok/0163_default_unsafe_item.rs diff --git a/crates/parser/test_data/parser/inline/ok/0163_default_unsafe_item.txt b/crates/parser/test_data/parser/inline/ok/0163_default_unsafe_item.txt new file mode 100644 index 0000000000..b180d0b72c --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0163_default_unsafe_item.txt @@ -0,0 +1,45 @@ +SOURCE_FILE + IMPL + DEFAULT_KW "default" + WHITESPACE " " + UNSAFE_KW "unsafe" + WHITESPACE " " + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + WHITESPACE " " + FOR_KW "for" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + DEFAULT_KW "default" + WHITESPACE " " + UNSAFE_KW "unsafe" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0164_default_item.rast b/crates/parser/test_data/parser/inline/ok/0164_default_item.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0164_default_item.rast rename to crates/parser/test_data/parser/inline/ok/0164_default_item.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0164_default_item.rs b/crates/parser/test_data/parser/inline/ok/0164_default_item.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0164_default_item.rs rename to crates/parser/test_data/parser/inline/ok/0164_default_item.rs diff --git a/crates/parser/test_data/parser/inline/ok/0164_default_item.txt b/crates/parser/test_data/parser/inline/ok/0164_default_item.txt new file mode 100644 index 0000000000..7a8e8cf1dd --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0164_default_item.txt @@ -0,0 +1,24 @@ +SOURCE_FILE + IMPL + DEFAULT_KW "default" + WHITESPACE " " + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + WHITESPACE " " + FOR_KW "for" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast b/crates/parser/test_data/parser/inline/ok/0164_type_path_in_pattern.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast rename to crates/parser/test_data/parser/inline/ok/0164_type_path_in_pattern.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rs b/crates/parser/test_data/parser/inline/ok/0164_type_path_in_pattern.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rs rename to crates/parser/test_data/parser/inline/ok/0164_type_path_in_pattern.rs diff --git a/crates/parser/test_data/parser/inline/ok/0164_type_path_in_pattern.txt b/crates/parser/test_data/parser/inline/ok/0164_type_path_in_pattern.txt new file mode 100644 index 0000000000..297f7575ca --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0164_type_path_in_pattern.txt @@ -0,0 +1,39 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LET_STMT + LET_KW "let" + WHITESPACE " " + PATH_PAT + PATH + PATH + PATH_SEGMENT + L_ANGLE "<" + INFER_TYPE + UNDERSCORE "_" + R_ANGLE ">" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Foo" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0165_const_param_defaults.rast b/crates/parser/test_data/parser/inline/ok/0165_const_param_defaults.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0165_const_param_defaults.rast rename to crates/parser/test_data/parser/inline/ok/0165_const_param_defaults.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0165_const_param_defaults.rs b/crates/parser/test_data/parser/inline/ok/0165_const_param_defaults.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0165_const_param_defaults.rs rename to crates/parser/test_data/parser/inline/ok/0165_const_param_defaults.rs diff --git a/crates/parser/test_data/parser/inline/ok/0165_const_param_defaults.txt b/crates/parser/test_data/parser/inline/ok/0165_const_param_defaults.txt new file mode 100644 index 0000000000..6de10353bf --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0165_const_param_defaults.txt @@ -0,0 +1,31 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "A" + GENERIC_PARAM_LIST + L_ANGLE "<" + CONST_PARAM + CONST_KW "const" + WHITESPACE " " + NAME + IDENT "N" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + WHITESPACE " " + EQ "=" + WHITESPACE " " + CONST_ARG + PREFIX_EXPR + MINUS "-" + LITERAL + INT_NUMBER "1" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0166_half_open_range_pat.rast b/crates/parser/test_data/parser/inline/ok/0166_half_open_range_pat.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0166_half_open_range_pat.rast rename to crates/parser/test_data/parser/inline/ok/0166_half_open_range_pat.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0166_half_open_range_pat.rs b/crates/parser/test_data/parser/inline/ok/0166_half_open_range_pat.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0166_half_open_range_pat.rs rename to crates/parser/test_data/parser/inline/ok/0166_half_open_range_pat.rs diff --git a/crates/parser/test_data/parser/inline/ok/0166_half_open_range_pat.txt b/crates/parser/test_data/parser/inline/ok/0166_half_open_range_pat.txt new file mode 100644 index 0000000000..3d3587a706 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0166_half_open_range_pat.txt @@ -0,0 +1,32 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LET_STMT + LET_KW "let" + WHITESPACE " " + RANGE_PAT + LITERAL_PAT + LITERAL + INT_NUMBER "0" + WHITESPACE " " + DOT2 ".." + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "1u32" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0168_extern_crate_rename.rast b/crates/parser/test_data/parser/inline/ok/0168_extern_crate_rename.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0168_extern_crate_rename.rast rename to crates/parser/test_data/parser/inline/ok/0168_extern_crate_rename.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0168_extern_crate_rename.rs b/crates/parser/test_data/parser/inline/ok/0168_extern_crate_rename.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0168_extern_crate_rename.rs rename to crates/parser/test_data/parser/inline/ok/0168_extern_crate_rename.rs diff --git a/crates/parser/test_data/parser/inline/ok/0168_extern_crate_rename.txt b/crates/parser/test_data/parser/inline/ok/0168_extern_crate_rename.txt new file mode 100644 index 0000000000..5a5aca96f9 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0168_extern_crate_rename.txt @@ -0,0 +1,16 @@ +SOURCE_FILE + EXTERN_CRATE + EXTERN_KW "extern" + WHITESPACE " " + CRATE_KW "crate" + WHITESPACE " " + NAME_REF + IDENT "foo" + WHITESPACE " " + RENAME + AS_KW "as" + WHITESPACE " " + NAME + IDENT "bar" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0168_extern_crate_self.rast b/crates/parser/test_data/parser/inline/ok/0168_extern_crate_self.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0168_extern_crate_self.rast rename to crates/parser/test_data/parser/inline/ok/0168_extern_crate_self.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0168_extern_crate_self.rs b/crates/parser/test_data/parser/inline/ok/0168_extern_crate_self.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0168_extern_crate_self.rs rename to crates/parser/test_data/parser/inline/ok/0168_extern_crate_self.rs diff --git a/crates/parser/test_data/parser/inline/ok/0168_extern_crate_self.txt b/crates/parser/test_data/parser/inline/ok/0168_extern_crate_self.txt new file mode 100644 index 0000000000..edea4245f2 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0168_extern_crate_self.txt @@ -0,0 +1,10 @@ +SOURCE_FILE + EXTERN_CRATE + EXTERN_KW "extern" + WHITESPACE " " + CRATE_KW "crate" + WHITESPACE " " + NAME_REF + SELF_KW "self" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0169_mod_item.rast b/crates/parser/test_data/parser/inline/ok/0169_mod_item.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0169_mod_item.rast rename to crates/parser/test_data/parser/inline/ok/0169_mod_item.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0169_mod_item.rs b/crates/parser/test_data/parser/inline/ok/0169_mod_item.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0169_mod_item.rs rename to crates/parser/test_data/parser/inline/ok/0169_mod_item.rs diff --git a/crates/parser/test_data/parser/inline/ok/0169_mod_item.txt b/crates/parser/test_data/parser/inline/ok/0169_mod_item.txt new file mode 100644 index 0000000000..4d505916cf --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0169_mod_item.txt @@ -0,0 +1,8 @@ +SOURCE_FILE + MODULE + MOD_KW "mod" + WHITESPACE " " + NAME + IDENT "a" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0170_mod_item_curly.rast b/crates/parser/test_data/parser/inline/ok/0170_mod_item_curly.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0170_mod_item_curly.rast rename to crates/parser/test_data/parser/inline/ok/0170_mod_item_curly.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0170_mod_item_curly.rs b/crates/parser/test_data/parser/inline/ok/0170_mod_item_curly.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0170_mod_item_curly.rs rename to crates/parser/test_data/parser/inline/ok/0170_mod_item_curly.rs diff --git a/crates/parser/test_data/parser/inline/ok/0170_mod_item_curly.txt b/crates/parser/test_data/parser/inline/ok/0170_mod_item_curly.txt new file mode 100644 index 0000000000..d5e3f3493c --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0170_mod_item_curly.txt @@ -0,0 +1,12 @@ +SOURCE_FILE + MODULE + MOD_KW "mod" + WHITESPACE " " + NAME + IDENT "b" + WHITESPACE " " + ITEM_LIST + L_CURLY "{" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0170_tuple_struct.rast b/crates/parser/test_data/parser/inline/ok/0170_tuple_struct.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0170_tuple_struct.rast rename to crates/parser/test_data/parser/inline/ok/0170_tuple_struct.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0170_tuple_struct.rs b/crates/parser/test_data/parser/inline/ok/0170_tuple_struct.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0170_tuple_struct.rs rename to crates/parser/test_data/parser/inline/ok/0170_tuple_struct.rs diff --git a/crates/parser/test_data/parser/inline/ok/0170_tuple_struct.txt b/crates/parser/test_data/parser/inline/ok/0170_tuple_struct.txt new file mode 100644 index 0000000000..6e5f6c2d2b --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0170_tuple_struct.txt @@ -0,0 +1,25 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + TUPLE_FIELD_LIST + L_PAREN "(" + TUPLE_FIELD + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "String" + COMMA "," + WHITESPACE " " + TUPLE_FIELD + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "usize" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0171_struct_item.rast b/crates/parser/test_data/parser/inline/ok/0171_struct_item.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0171_struct_item.rast rename to crates/parser/test_data/parser/inline/ok/0171_struct_item.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0171_struct_item.rs b/crates/parser/test_data/parser/inline/ok/0171_struct_item.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0171_struct_item.rs rename to crates/parser/test_data/parser/inline/ok/0171_struct_item.rs diff --git a/crates/parser/test_data/parser/inline/ok/0171_struct_item.txt b/crates/parser/test_data/parser/inline/ok/0171_struct_item.txt new file mode 100644 index 0000000000..78f9682072 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0171_struct_item.txt @@ -0,0 +1,11 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0172_const_item.rast b/crates/parser/test_data/parser/inline/ok/0172_const_item.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0172_const_item.rast rename to crates/parser/test_data/parser/inline/ok/0172_const_item.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0172_const_item.rs b/crates/parser/test_data/parser/inline/ok/0172_const_item.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0172_const_item.rs rename to crates/parser/test_data/parser/inline/ok/0172_const_item.rs diff --git a/crates/parser/test_data/parser/inline/ok/0172_const_item.txt b/crates/parser/test_data/parser/inline/ok/0172_const_item.txt new file mode 100644 index 0000000000..909983c9a2 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0172_const_item.txt @@ -0,0 +1,20 @@ +SOURCE_FILE + CONST + CONST_KW "const" + WHITESPACE " " + NAME + IDENT "C" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0172_record_field_list.rast b/crates/parser/test_data/parser/inline/ok/0172_record_field_list.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0172_record_field_list.rast rename to crates/parser/test_data/parser/inline/ok/0172_record_field_list.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0172_record_field_list.rs b/crates/parser/test_data/parser/inline/ok/0172_record_field_list.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0172_record_field_list.rs rename to crates/parser/test_data/parser/inline/ok/0172_record_field_list.rs diff --git a/crates/parser/test_data/parser/inline/ok/0172_record_field_list.txt b/crates/parser/test_data/parser/inline/ok/0172_record_field_list.txt new file mode 100644 index 0000000000..065d7e7e81 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0172_record_field_list.txt @@ -0,0 +1,35 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_FIELD + NAME + IDENT "a" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + COMMA "," + WHITESPACE " " + RECORD_FIELD + NAME + IDENT "b" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "f32" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0173_anonymous_const.rast b/crates/parser/test_data/parser/inline/ok/0173_anonymous_const.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0173_anonymous_const.rast rename to crates/parser/test_data/parser/inline/ok/0173_anonymous_const.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0173_anonymous_const.rs b/crates/parser/test_data/parser/inline/ok/0173_anonymous_const.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0173_anonymous_const.rs rename to crates/parser/test_data/parser/inline/ok/0173_anonymous_const.rs diff --git a/crates/parser/test_data/parser/inline/ok/0173_anonymous_const.txt b/crates/parser/test_data/parser/inline/ok/0173_anonymous_const.txt new file mode 100644 index 0000000000..d81b4ff267 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0173_anonymous_const.txt @@ -0,0 +1,19 @@ +SOURCE_FILE + CONST + CONST_KW "const" + WHITESPACE " " + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "0" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0173_macro_def_curly.rast b/crates/parser/test_data/parser/inline/ok/0173_macro_def_curly.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0173_macro_def_curly.rast rename to crates/parser/test_data/parser/inline/ok/0173_macro_def_curly.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0173_macro_def_curly.rs b/crates/parser/test_data/parser/inline/ok/0173_macro_def_curly.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0173_macro_def_curly.rs rename to crates/parser/test_data/parser/inline/ok/0173_macro_def_curly.rs diff --git a/crates/parser/test_data/parser/inline/ok/0173_macro_def_curly.txt b/crates/parser/test_data/parser/inline/ok/0173_macro_def_curly.txt new file mode 100644 index 0000000000..5cf305d265 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0173_macro_def_curly.txt @@ -0,0 +1,27 @@ +SOURCE_FILE + MACRO_DEF + MACRO_KW "macro" + WHITESPACE " " + NAME + IDENT "m" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + WHITESPACE " " + TOKEN_TREE + L_PAREN "(" + DOLLAR "$" + IDENT "i" + COLON ":" + IDENT "ident" + R_PAREN ")" + WHITESPACE " " + EQ "=" + R_ANGLE ">" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + R_CURLY "}" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0173_union_item.rast b/crates/parser/test_data/parser/inline/ok/0173_union_item.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0173_union_item.rast rename to crates/parser/test_data/parser/inline/ok/0173_union_item.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0173_union_item.rs b/crates/parser/test_data/parser/inline/ok/0173_union_item.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0173_union_item.rs rename to crates/parser/test_data/parser/inline/ok/0173_union_item.rs diff --git a/crates/parser/test_data/parser/inline/ok/0173_union_item.txt b/crates/parser/test_data/parser/inline/ok/0173_union_item.txt new file mode 100644 index 0000000000..af608fc4ac --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0173_union_item.txt @@ -0,0 +1,35 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "U" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_FIELD + NAME + IDENT "i" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + COMMA "," + WHITESPACE " " + RECORD_FIELD + NAME + IDENT "f" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "f32" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0174_trait_item_generic_params.rast b/crates/parser/test_data/parser/inline/ok/0174_trait_item_generic_params.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0174_trait_item_generic_params.rast rename to crates/parser/test_data/parser/inline/ok/0174_trait_item_generic_params.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0174_trait_item_generic_params.rs b/crates/parser/test_data/parser/inline/ok/0174_trait_item_generic_params.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0174_trait_item_generic_params.rs rename to crates/parser/test_data/parser/inline/ok/0174_trait_item_generic_params.rs diff --git a/crates/parser/test_data/parser/inline/ok/0174_trait_item_generic_params.txt b/crates/parser/test_data/parser/inline/ok/0174_trait_item_generic_params.txt new file mode 100644 index 0000000000..01f212e718 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0174_trait_item_generic_params.txt @@ -0,0 +1,35 @@ +SOURCE_FILE + TRAIT + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "X" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "U" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Debug" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Display" + R_ANGLE ">" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0174_unit_struct.rast b/crates/parser/test_data/parser/inline/ok/0174_unit_struct.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0174_unit_struct.rast rename to crates/parser/test_data/parser/inline/ok/0174_unit_struct.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0174_unit_struct.rs b/crates/parser/test_data/parser/inline/ok/0174_unit_struct.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0174_unit_struct.rs rename to crates/parser/test_data/parser/inline/ok/0174_unit_struct.rs diff --git a/crates/parser/test_data/parser/inline/ok/0174_unit_struct.txt b/crates/parser/test_data/parser/inline/ok/0174_unit_struct.txt new file mode 100644 index 0000000000..438dea6f40 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0174_unit_struct.txt @@ -0,0 +1,8 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0174_use_tree_star.rast b/crates/parser/test_data/parser/inline/ok/0174_use_tree_star.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0174_use_tree_star.rast rename to crates/parser/test_data/parser/inline/ok/0174_use_tree_star.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0174_use_tree_star.rs b/crates/parser/test_data/parser/inline/ok/0174_use_tree_star.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0174_use_tree_star.rs rename to crates/parser/test_data/parser/inline/ok/0174_use_tree_star.rs diff --git a/crates/parser/test_data/parser/inline/ok/0174_use_tree_star.txt b/crates/parser/test_data/parser/inline/ok/0174_use_tree_star.txt new file mode 100644 index 0000000000..8662423f5d --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0174_use_tree_star.txt @@ -0,0 +1,24 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + STAR "*" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "std" + COLON2 "::" + USE_TREE_LIST + L_CURLY "{" + USE_TREE + STAR "*" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0175_trait_item_bounds.rast b/crates/parser/test_data/parser/inline/ok/0175_trait_item_bounds.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0175_trait_item_bounds.rast rename to crates/parser/test_data/parser/inline/ok/0175_trait_item_bounds.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0175_trait_item_bounds.rs b/crates/parser/test_data/parser/inline/ok/0175_trait_item_bounds.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0175_trait_item_bounds.rs rename to crates/parser/test_data/parser/inline/ok/0175_trait_item_bounds.rs diff --git a/crates/parser/test_data/parser/inline/ok/0175_trait_item_bounds.txt b/crates/parser/test_data/parser/inline/ok/0175_trait_item_bounds.txt new file mode 100644 index 0000000000..bab8314562 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0175_trait_item_bounds.txt @@ -0,0 +1,29 @@ +SOURCE_FILE + TRAIT + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Hash" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Clone" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0176_trait_item_where_clause.rast b/crates/parser/test_data/parser/inline/ok/0176_trait_item_where_clause.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0176_trait_item_where_clause.rast rename to crates/parser/test_data/parser/inline/ok/0176_trait_item_where_clause.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0176_trait_item_where_clause.rs b/crates/parser/test_data/parser/inline/ok/0176_trait_item_where_clause.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0176_trait_item_where_clause.rs rename to crates/parser/test_data/parser/inline/ok/0176_trait_item_where_clause.rs diff --git a/crates/parser/test_data/parser/inline/ok/0176_trait_item_where_clause.txt b/crates/parser/test_data/parser/inline/ok/0176_trait_item_where_clause.txt new file mode 100644 index 0000000000..ab42d81f9b --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0176_trait_item_where_clause.txt @@ -0,0 +1,30 @@ +SOURCE_FILE + TRAIT + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE " " + WHERE_PRED + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Self" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Copy" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0176_use_tree_alias.rast b/crates/parser/test_data/parser/inline/ok/0176_use_tree_alias.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0176_use_tree_alias.rast rename to crates/parser/test_data/parser/inline/ok/0176_use_tree_alias.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0176_use_tree_alias.rs b/crates/parser/test_data/parser/inline/ok/0176_use_tree_alias.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0176_use_tree_alias.rs rename to crates/parser/test_data/parser/inline/ok/0176_use_tree_alias.rs diff --git a/crates/parser/test_data/parser/inline/ok/0176_use_tree_alias.txt b/crates/parser/test_data/parser/inline/ok/0176_use_tree_alias.txt new file mode 100644 index 0000000000..ef0dd6ba11 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0176_use_tree_alias.txt @@ -0,0 +1,32 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "std" + WHITESPACE " " + RENAME + AS_KW "as" + WHITESPACE " " + NAME + IDENT "stdlib" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Trait" + WHITESPACE " " + RENAME + AS_KW "as" + WHITESPACE " " + UNDERSCORE "_" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0177_assoc_item_list_inner_attrs.rast b/crates/parser/test_data/parser/inline/ok/0177_assoc_item_list_inner_attrs.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0177_assoc_item_list_inner_attrs.rast rename to crates/parser/test_data/parser/inline/ok/0177_assoc_item_list_inner_attrs.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0177_assoc_item_list_inner_attrs.rs b/crates/parser/test_data/parser/inline/ok/0177_assoc_item_list_inner_attrs.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0177_assoc_item_list_inner_attrs.rs rename to crates/parser/test_data/parser/inline/ok/0177_assoc_item_list_inner_attrs.rs diff --git a/crates/parser/test_data/parser/inline/ok/0177_assoc_item_list_inner_attrs.txt b/crates/parser/test_data/parser/inline/ok/0177_assoc_item_list_inner_attrs.txt new file mode 100644 index 0000000000..9cb3c8a5c3 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0177_assoc_item_list_inner_attrs.txt @@ -0,0 +1,26 @@ +SOURCE_FILE + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE " " + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0177_trait_alias_where_clause.rast b/crates/parser/test_data/parser/inline/ok/0177_trait_alias_where_clause.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0177_trait_alias_where_clause.rast rename to crates/parser/test_data/parser/inline/ok/0177_trait_alias_where_clause.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0177_trait_alias_where_clause.rs b/crates/parser/test_data/parser/inline/ok/0177_trait_alias_where_clause.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0177_trait_alias_where_clause.rs rename to crates/parser/test_data/parser/inline/ok/0177_trait_alias_where_clause.rs diff --git a/crates/parser/test_data/parser/inline/ok/0177_trait_alias_where_clause.txt b/crates/parser/test_data/parser/inline/ok/0177_trait_alias_where_clause.txt new file mode 100644 index 0000000000..88b1f8c29e --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0177_trait_alias_where_clause.txt @@ -0,0 +1,96 @@ +SOURCE_FILE + TRAIT + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "Z" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "U" + R_ANGLE ">" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "U" + R_ANGLE ">" + WHITESPACE " " + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE " " + WHERE_PRED + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "U" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Copy" + SEMICOLON ";" + WHITESPACE "\n" + TRAIT + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "Z" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "U" + R_ANGLE ">" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TYPE_BOUND_LIST + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE " " + WHERE_PRED + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Self" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "U" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0177_use_tree.rast b/crates/parser/test_data/parser/inline/ok/0177_use_tree.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0177_use_tree.rast rename to crates/parser/test_data/parser/inline/ok/0177_use_tree.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0177_use_tree.rs b/crates/parser/test_data/parser/inline/ok/0177_use_tree.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0177_use_tree.rs rename to crates/parser/test_data/parser/inline/ok/0177_use_tree.rs diff --git a/crates/parser/test_data/parser/inline/ok/0177_use_tree.txt b/crates/parser/test_data/parser/inline/ok/0177_use_tree.txt new file mode 100644 index 0000000000..98231cdc21 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0177_use_tree.txt @@ -0,0 +1,30 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "outer" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "tree" + COLON2 "::" + USE_TREE_LIST + L_CURLY "{" + USE_TREE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "inner" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "tree" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0177_use_tree_path.rast b/crates/parser/test_data/parser/inline/ok/0177_use_tree_path.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0177_use_tree_path.rast rename to crates/parser/test_data/parser/inline/ok/0177_use_tree_path.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0177_use_tree_path.rs b/crates/parser/test_data/parser/inline/ok/0177_use_tree_path.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0177_use_tree_path.rs rename to crates/parser/test_data/parser/inline/ok/0177_use_tree_path.rs diff --git a/crates/parser/test_data/parser/inline/ok/0177_use_tree_path.txt b/crates/parser/test_data/parser/inline/ok/0177_use_tree_path.txt new file mode 100644 index 0000000000..ede22dbaf5 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0177_use_tree_path.txt @@ -0,0 +1,72 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "std" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "std" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "collections" + SEMICOLON ";" + WHITESPACE "\n\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH_SEGMENT + NAME_REF + SELF_KW "self" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "m" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH_SEGMENT + NAME_REF + SUPER_KW "super" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "m" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH_SEGMENT + NAME_REF + CRATE_KW "crate" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "m" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0178_use_tree_path_use_tree.rast b/crates/parser/test_data/parser/inline/ok/0178_use_tree_path_use_tree.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0178_use_tree_path_use_tree.rast rename to crates/parser/test_data/parser/inline/ok/0178_use_tree_path_use_tree.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0178_use_tree_path_use_tree.rs b/crates/parser/test_data/parser/inline/ok/0178_use_tree_path_use_tree.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0178_use_tree_path_use_tree.rs rename to crates/parser/test_data/parser/inline/ok/0178_use_tree_path_use_tree.rs diff --git a/crates/parser/test_data/parser/inline/ok/0178_use_tree_path_use_tree.txt b/crates/parser/test_data/parser/inline/ok/0178_use_tree_path_use_tree.txt new file mode 100644 index 0000000000..ed3cafae13 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0178_use_tree_path_use_tree.txt @@ -0,0 +1,20 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "std" + COLON2 "::" + USE_TREE_LIST + L_CURLY "{" + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "collections" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0179_use_tree_abs_star.rast b/crates/parser/test_data/parser/inline/ok/0179_use_tree_abs_star.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0179_use_tree_abs_star.rast rename to crates/parser/test_data/parser/inline/ok/0179_use_tree_abs_star.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0179_use_tree_abs_star.rs b/crates/parser/test_data/parser/inline/ok/0179_use_tree_abs_star.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0179_use_tree_abs_star.rs rename to crates/parser/test_data/parser/inline/ok/0179_use_tree_abs_star.rs diff --git a/crates/parser/test_data/parser/inline/ok/0179_use_tree_abs_star.txt b/crates/parser/test_data/parser/inline/ok/0179_use_tree_abs_star.txt new file mode 100644 index 0000000000..b4dc1f25d9 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0179_use_tree_abs_star.txt @@ -0,0 +1,26 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + COLON2 "::" + STAR "*" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "std" + COLON2 "::" + USE_TREE_LIST + L_CURLY "{" + USE_TREE + COLON2 "::" + STAR "*" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0180_use_tree_path_star.rast b/crates/parser/test_data/parser/inline/ok/0180_use_tree_path_star.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0180_use_tree_path_star.rast rename to crates/parser/test_data/parser/inline/ok/0180_use_tree_path_star.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0180_use_tree_path_star.rs b/crates/parser/test_data/parser/inline/ok/0180_use_tree_path_star.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0180_use_tree_path_star.rs rename to crates/parser/test_data/parser/inline/ok/0180_use_tree_path_star.rs diff --git a/crates/parser/test_data/parser/inline/ok/0180_use_tree_path_star.txt b/crates/parser/test_data/parser/inline/ok/0180_use_tree_path_star.txt new file mode 100644 index 0000000000..d255adb5a4 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0180_use_tree_path_star.txt @@ -0,0 +1,13 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "std" + COLON2 "::" + STAR "*" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0181_generic_param_attribute.rast b/crates/parser/test_data/parser/inline/ok/0181_generic_param_attribute.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0181_generic_param_attribute.rast rename to crates/parser/test_data/parser/inline/ok/0181_generic_param_attribute.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0181_generic_param_attribute.rs b/crates/parser/test_data/parser/inline/ok/0181_generic_param_attribute.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0181_generic_param_attribute.rs rename to crates/parser/test_data/parser/inline/ok/0181_generic_param_attribute.rs diff --git a/crates/parser/test_data/parser/inline/ok/0181_generic_param_attribute.txt b/crates/parser/test_data/parser/inline/ok/0181_generic_param_attribute.txt new file mode 100644 index 0000000000..28a216e873 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0181_generic_param_attribute.txt @@ -0,0 +1,46 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "lt_attr" + R_BRACK "]" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'a" + COMMA "," + WHITESPACE " " + TYPE_PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "t_attr" + R_BRACK "]" + WHITESPACE " " + NAME + IDENT "T" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0181_use_item.rast b/crates/parser/test_data/parser/inline/ok/0181_use_item.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0181_use_item.rast rename to crates/parser/test_data/parser/inline/ok/0181_use_item.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0181_use_item.rs b/crates/parser/test_data/parser/inline/ok/0181_use_item.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0181_use_item.rs rename to crates/parser/test_data/parser/inline/ok/0181_use_item.rs diff --git a/crates/parser/test_data/parser/inline/ok/0181_use_item.txt b/crates/parser/test_data/parser/inline/ok/0181_use_item.txt new file mode 100644 index 0000000000..25761ed8c7 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0181_use_item.txt @@ -0,0 +1,16 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "std" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "collections" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0182_lifetime_param.rast b/crates/parser/test_data/parser/inline/ok/0182_lifetime_param.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0182_lifetime_param.rast rename to crates/parser/test_data/parser/inline/ok/0182_lifetime_param.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0182_lifetime_param.rs b/crates/parser/test_data/parser/inline/ok/0182_lifetime_param.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0182_lifetime_param.rs rename to crates/parser/test_data/parser/inline/ok/0182_lifetime_param.rs diff --git a/crates/parser/test_data/parser/inline/ok/0182_lifetime_param.txt b/crates/parser/test_data/parser/inline/ok/0182_lifetime_param.txt new file mode 100644 index 0000000000..c595031f35 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0182_lifetime_param.txt @@ -0,0 +1,25 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + COLON ":" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'b" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0183_const_arg_block.rast b/crates/parser/test_data/parser/inline/ok/0183_const_arg_block.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0183_const_arg_block.rast rename to crates/parser/test_data/parser/inline/ok/0183_const_arg_block.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0183_const_arg_block.rs b/crates/parser/test_data/parser/inline/ok/0183_const_arg_block.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0183_const_arg_block.rs rename to crates/parser/test_data/parser/inline/ok/0183_const_arg_block.rs diff --git a/crates/parser/test_data/parser/inline/ok/0183_const_arg_block.txt b/crates/parser/test_data/parser/inline/ok/0183_const_arg_block.txt new file mode 100644 index 0000000000..ea8866da27 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0183_const_arg_block.txt @@ -0,0 +1,32 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + GENERIC_ARG_LIST + L_ANGLE "<" + CONST_ARG + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + BIN_EXPR + LITERAL + INT_NUMBER "90" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + LITERAL + INT_NUMBER "2" + R_CURLY "}" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0183_type_param.rast b/crates/parser/test_data/parser/inline/ok/0183_type_param.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0183_type_param.rast rename to crates/parser/test_data/parser/inline/ok/0183_type_param.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0183_type_param.rs b/crates/parser/test_data/parser/inline/ok/0183_type_param.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0183_type_param.rs rename to crates/parser/test_data/parser/inline/ok/0183_type_param.rs diff --git a/crates/parser/test_data/parser/inline/ok/0183_type_param.txt b/crates/parser/test_data/parser/inline/ok/0183_type_param.txt new file mode 100644 index 0000000000..becb77e042 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0183_type_param.txt @@ -0,0 +1,30 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Clone" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0184_const_arg.rast b/crates/parser/test_data/parser/inline/ok/0184_const_arg.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0184_const_arg.rast rename to crates/parser/test_data/parser/inline/ok/0184_const_arg.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0184_const_arg.rs b/crates/parser/test_data/parser/inline/ok/0184_const_arg.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0184_const_arg.rs rename to crates/parser/test_data/parser/inline/ok/0184_const_arg.rs diff --git a/crates/parser/test_data/parser/inline/ok/0184_const_arg.txt b/crates/parser/test_data/parser/inline/ok/0184_const_arg.txt new file mode 100644 index 0000000000..1e03007172 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0184_const_arg.txt @@ -0,0 +1,22 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + GENERIC_ARG_LIST + L_ANGLE "<" + CONST_ARG + LITERAL + INT_NUMBER "92" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0184_generic_param_list.rast b/crates/parser/test_data/parser/inline/ok/0184_generic_param_list.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0184_generic_param_list.rast rename to crates/parser/test_data/parser/inline/ok/0184_generic_param_list.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0184_generic_param_list.rs b/crates/parser/test_data/parser/inline/ok/0184_generic_param_list.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0184_generic_param_list.rs rename to crates/parser/test_data/parser/inline/ok/0184_generic_param_list.rs diff --git a/crates/parser/test_data/parser/inline/ok/0184_generic_param_list.txt b/crates/parser/test_data/parser/inline/ok/0184_generic_param_list.txt new file mode 100644 index 0000000000..becb77e042 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0184_generic_param_list.txt @@ -0,0 +1,30 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Clone" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0185_assoc_type_bound.rast b/crates/parser/test_data/parser/inline/ok/0185_assoc_type_bound.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0185_assoc_type_bound.rast rename to crates/parser/test_data/parser/inline/ok/0185_assoc_type_bound.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0185_assoc_type_bound.rs b/crates/parser/test_data/parser/inline/ok/0185_assoc_type_bound.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0185_assoc_type_bound.rs rename to crates/parser/test_data/parser/inline/ok/0185_assoc_type_bound.rs diff --git a/crates/parser/test_data/parser/inline/ok/0185_assoc_type_bound.txt b/crates/parser/test_data/parser/inline/ok/0185_assoc_type_bound.txt new file mode 100644 index 0000000000..f2e4e01069 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0185_assoc_type_bound.txt @@ -0,0 +1,37 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "StreamingIterator" + GENERIC_ARG_LIST + L_ANGLE "<" + ASSOC_TYPE_ARG + NAME_REF + IDENT "Item" + GENERIC_ARG_LIST + L_ANGLE "<" + LIFETIME_ARG + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Clone" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0186_lifetime_arg.rast b/crates/parser/test_data/parser/inline/ok/0186_lifetime_arg.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0186_lifetime_arg.rast rename to crates/parser/test_data/parser/inline/ok/0186_lifetime_arg.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0186_lifetime_arg.rs b/crates/parser/test_data/parser/inline/ok/0186_lifetime_arg.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0186_lifetime_arg.rs rename to crates/parser/test_data/parser/inline/ok/0186_lifetime_arg.rs diff --git a/crates/parser/test_data/parser/inline/ok/0186_lifetime_arg.txt b/crates/parser/test_data/parser/inline/ok/0186_lifetime_arg.txt new file mode 100644 index 0000000000..dbd7ff3061 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0186_lifetime_arg.txt @@ -0,0 +1,22 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + GENERIC_ARG_LIST + L_ANGLE "<" + LIFETIME_ARG + LIFETIME + LIFETIME_IDENT "'static" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0187_assoc_type_eq.rast b/crates/parser/test_data/parser/inline/ok/0187_assoc_type_eq.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0187_assoc_type_eq.rast rename to crates/parser/test_data/parser/inline/ok/0187_assoc_type_eq.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0187_assoc_type_eq.rs b/crates/parser/test_data/parser/inline/ok/0187_assoc_type_eq.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0187_assoc_type_eq.rs rename to crates/parser/test_data/parser/inline/ok/0187_assoc_type_eq.rs diff --git a/crates/parser/test_data/parser/inline/ok/0187_assoc_type_eq.txt b/crates/parser/test_data/parser/inline/ok/0187_assoc_type_eq.txt new file mode 100644 index 0000000000..9704318403 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0187_assoc_type_eq.txt @@ -0,0 +1,41 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "StreamingIterator" + GENERIC_ARG_LIST + L_ANGLE "<" + ASSOC_TYPE_ARG + NAME_REF + IDENT "Item" + GENERIC_ARG_LIST + L_ANGLE "<" + LIFETIME_ARG + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + EQ "=" + WHITESPACE " " + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0188_const_arg_path.rast b/crates/parser/test_data/parser/inline/ok/0188_const_arg_path.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0188_const_arg_path.rast rename to crates/parser/test_data/parser/inline/ok/0188_const_arg_path.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0188_const_arg_path.rs b/crates/parser/test_data/parser/inline/ok/0188_const_arg_path.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0188_const_arg_path.rs rename to crates/parser/test_data/parser/inline/ok/0188_const_arg_path.rs diff --git a/crates/parser/test_data/parser/inline/ok/0188_const_arg_path.txt b/crates/parser/test_data/parser/inline/ok/0188_const_arg_path.txt new file mode 100644 index 0000000000..440dfb06a3 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0188_const_arg_path.txt @@ -0,0 +1,37 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + GENERIC_PARAM_LIST + L_ANGLE "<" + CONST_PARAM + CONST_KW "const" + WHITESPACE " " + NAME + IDENT "N" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + WHITESPACE " " + EQ "=" + WHITESPACE " " + CONST_ARG + PATH_EXPR + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "MAX" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0189_const_arg_literal.rast b/crates/parser/test_data/parser/inline/ok/0189_const_arg_literal.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0189_const_arg_literal.rast rename to crates/parser/test_data/parser/inline/ok/0189_const_arg_literal.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0189_const_arg_literal.rs b/crates/parser/test_data/parser/inline/ok/0189_const_arg_literal.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0189_const_arg_literal.rs rename to crates/parser/test_data/parser/inline/ok/0189_const_arg_literal.rs diff --git a/crates/parser/test_data/parser/inline/ok/0189_const_arg_literal.txt b/crates/parser/test_data/parser/inline/ok/0189_const_arg_literal.txt new file mode 100644 index 0000000000..03d414e336 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0189_const_arg_literal.txt @@ -0,0 +1,27 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + GENERIC_ARG_LIST + L_ANGLE "<" + CONST_ARG + LITERAL + STRING "\"hello\"" + COMMA "," + WHITESPACE " " + CONST_ARG + LITERAL + INT_NUMBER "0xdeadbeef" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0190_generic_arg.rast b/crates/parser/test_data/parser/inline/ok/0190_generic_arg.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0190_generic_arg.rast rename to crates/parser/test_data/parser/inline/ok/0190_generic_arg.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0190_generic_arg.rs b/crates/parser/test_data/parser/inline/ok/0190_generic_arg.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0190_generic_arg.rs rename to crates/parser/test_data/parser/inline/ok/0190_generic_arg.rs diff --git a/crates/parser/test_data/parser/inline/ok/0190_generic_arg.txt b/crates/parser/test_data/parser/inline/ok/0190_generic_arg.txt new file mode 100644 index 0000000000..5a01f154ba --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0190_generic_arg.txt @@ -0,0 +1,25 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0191_const_arg_negative_number.rast b/crates/parser/test_data/parser/inline/ok/0191_const_arg_negative_number.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0191_const_arg_negative_number.rast rename to crates/parser/test_data/parser/inline/ok/0191_const_arg_negative_number.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0191_const_arg_negative_number.rs b/crates/parser/test_data/parser/inline/ok/0191_const_arg_negative_number.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0191_const_arg_negative_number.rs rename to crates/parser/test_data/parser/inline/ok/0191_const_arg_negative_number.rs diff --git a/crates/parser/test_data/parser/inline/ok/0191_const_arg_negative_number.txt b/crates/parser/test_data/parser/inline/ok/0191_const_arg_negative_number.txt new file mode 100644 index 0000000000..e504badbd3 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0191_const_arg_negative_number.txt @@ -0,0 +1,24 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + GENERIC_ARG_LIST + L_ANGLE "<" + CONST_ARG + PREFIX_EXPR + MINUS "-" + LITERAL + INT_NUMBER "92" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0192_const_arg_bool_literal.rast b/crates/parser/test_data/parser/inline/ok/0192_const_arg_bool_literal.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0192_const_arg_bool_literal.rast rename to crates/parser/test_data/parser/inline/ok/0192_const_arg_bool_literal.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0192_const_arg_bool_literal.rs b/crates/parser/test_data/parser/inline/ok/0192_const_arg_bool_literal.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0192_const_arg_bool_literal.rs rename to crates/parser/test_data/parser/inline/ok/0192_const_arg_bool_literal.rs diff --git a/crates/parser/test_data/parser/inline/ok/0192_const_arg_bool_literal.txt b/crates/parser/test_data/parser/inline/ok/0192_const_arg_bool_literal.txt new file mode 100644 index 0000000000..aea23e463d --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0192_const_arg_bool_literal.txt @@ -0,0 +1,22 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + GENERIC_ARG_LIST + L_ANGLE "<" + CONST_ARG + LITERAL + TRUE_KW "true" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0193_let_stmt_init.rast b/crates/parser/test_data/parser/inline/ok/0193_let_stmt_init.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0193_let_stmt_init.rast rename to crates/parser/test_data/parser/inline/ok/0193_let_stmt_init.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0193_let_stmt_init.rs b/crates/parser/test_data/parser/inline/ok/0193_let_stmt_init.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0193_let_stmt_init.rs rename to crates/parser/test_data/parser/inline/ok/0193_let_stmt_init.rs diff --git a/crates/parser/test_data/parser/inline/ok/0193_let_stmt_init.txt b/crates/parser/test_data/parser/inline/ok/0193_let_stmt_init.txt new file mode 100644 index 0000000000..1b63991587 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0193_let_stmt_init.txt @@ -0,0 +1,29 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "x" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0194_let_else.rast b/crates/parser/test_data/parser/inline/ok/0194_let_else.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0194_let_else.rast rename to crates/parser/test_data/parser/inline/ok/0194_let_else.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0194_let_else.rs b/crates/parser/test_data/parser/inline/ok/0194_let_else.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0194_let_else.rs rename to crates/parser/test_data/parser/inline/ok/0194_let_else.rs diff --git a/crates/parser/test_data/parser/inline/ok/0194_let_else.txt b/crates/parser/test_data/parser/inline/ok/0194_let_else.txt new file mode 100644 index 0000000000..ce7f1a35e8 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0194_let_else.txt @@ -0,0 +1,51 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + L_PAREN "(" + IDENT_PAT + NAME + IDENT "x" + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "opt" + WHITESPACE " " + LET_ELSE + ELSE_KW "else" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + RETURN_EXPR + RETURN_KW "return" + WHITESPACE " " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0194_let_stmt_ascription.rast b/crates/parser/test_data/parser/inline/ok/0194_let_stmt_ascription.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0194_let_stmt_ascription.rast rename to crates/parser/test_data/parser/inline/ok/0194_let_stmt_ascription.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0194_let_stmt_ascription.rs b/crates/parser/test_data/parser/inline/ok/0194_let_stmt_ascription.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0194_let_stmt_ascription.rs rename to crates/parser/test_data/parser/inline/ok/0194_let_stmt_ascription.rs diff --git a/crates/parser/test_data/parser/inline/ok/0194_let_stmt_ascription.txt b/crates/parser/test_data/parser/inline/ok/0194_let_stmt_ascription.txt new file mode 100644 index 0000000000..ac8e1d93cb --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0194_let_stmt_ascription.txt @@ -0,0 +1,31 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0194_macro_inside_generic_arg.rast b/crates/parser/test_data/parser/inline/ok/0194_macro_inside_generic_arg.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0194_macro_inside_generic_arg.rast rename to crates/parser/test_data/parser/inline/ok/0194_macro_inside_generic_arg.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0194_macro_inside_generic_arg.rs b/crates/parser/test_data/parser/inline/ok/0194_macro_inside_generic_arg.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0194_macro_inside_generic_arg.rs rename to crates/parser/test_data/parser/inline/ok/0194_macro_inside_generic_arg.rs diff --git a/crates/parser/test_data/parser/inline/ok/0194_macro_inside_generic_arg.txt b/crates/parser/test_data/parser/inline/ok/0194_macro_inside_generic_arg.txt new file mode 100644 index 0000000000..88f8a73450 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0194_macro_inside_generic_arg.txt @@ -0,0 +1,36 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "A" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + MACRO_TYPE + MACRO_CALL + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "syn" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Token" + BANG "!" + TOKEN_TREE + L_BRACK "[" + UNDERSCORE "_" + R_BRACK "]" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/inline/ok/0196_pub_tuple_field.rast b/crates/parser/test_data/parser/inline/ok/0196_pub_tuple_field.rast similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0196_pub_tuple_field.rast rename to crates/parser/test_data/parser/inline/ok/0196_pub_tuple_field.rast diff --git a/crates/syntax/test_data/parser/inline/ok/0196_pub_tuple_field.rs b/crates/parser/test_data/parser/inline/ok/0196_pub_tuple_field.rs similarity index 100% rename from crates/syntax/test_data/parser/inline/ok/0196_pub_tuple_field.rs rename to crates/parser/test_data/parser/inline/ok/0196_pub_tuple_field.rs diff --git a/crates/parser/test_data/parser/inline/ok/0196_pub_tuple_field.txt b/crates/parser/test_data/parser/inline/ok/0196_pub_tuple_field.txt new file mode 100644 index 0000000000..a23ddf69f2 --- /dev/null +++ b/crates/parser/test_data/parser/inline/ok/0196_pub_tuple_field.txt @@ -0,0 +1,30 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "MyStruct" + TUPLE_FIELD_LIST + L_PAREN "(" + TUPLE_FIELD + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + COMMA "," + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + R_PAREN ")" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0000_empty.rast b/crates/parser/test_data/parser/ok/0000_empty.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0000_empty.rast rename to crates/parser/test_data/parser/ok/0000_empty.rast diff --git a/crates/syntax/test_data/parser/ok/0000_empty.rs b/crates/parser/test_data/parser/ok/0000_empty.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0000_empty.rs rename to crates/parser/test_data/parser/ok/0000_empty.rs diff --git a/crates/parser/test_data/parser/ok/0000_empty.txt b/crates/parser/test_data/parser/ok/0000_empty.txt new file mode 100644 index 0000000000..40b9ef804c --- /dev/null +++ b/crates/parser/test_data/parser/ok/0000_empty.txt @@ -0,0 +1 @@ +SOURCE_FILE diff --git a/crates/syntax/test_data/parser/ok/0001_struct_item.rast b/crates/parser/test_data/parser/ok/0001_struct_item.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0001_struct_item.rast rename to crates/parser/test_data/parser/ok/0001_struct_item.rast diff --git a/crates/syntax/test_data/parser/ok/0001_struct_item.rs b/crates/parser/test_data/parser/ok/0001_struct_item.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0001_struct_item.rs rename to crates/parser/test_data/parser/ok/0001_struct_item.rs diff --git a/crates/parser/test_data/parser/ok/0001_struct_item.txt b/crates/parser/test_data/parser/ok/0001_struct_item.txt new file mode 100644 index 0000000000..0e9639f23d --- /dev/null +++ b/crates/parser/test_data/parser/ok/0001_struct_item.txt @@ -0,0 +1,39 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Copy" + R_ANGLE ">" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE "\n " + RECORD_FIELD + NAME + IDENT "f" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + COMMA "," + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0002_struct_item_field.rast b/crates/parser/test_data/parser/ok/0002_struct_item_field.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0002_struct_item_field.rast rename to crates/parser/test_data/parser/ok/0002_struct_item_field.rast diff --git a/crates/syntax/test_data/parser/ok/0002_struct_item_field.rs b/crates/parser/test_data/parser/ok/0002_struct_item_field.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0002_struct_item_field.rs rename to crates/parser/test_data/parser/ok/0002_struct_item_field.rs diff --git a/crates/parser/test_data/parser/ok/0002_struct_item_field.txt b/crates/parser/test_data/parser/ok/0002_struct_item_field.txt new file mode 100644 index 0000000000..dd52e5850e --- /dev/null +++ b/crates/parser/test_data/parser/ok/0002_struct_item_field.txt @@ -0,0 +1,22 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE "\n " + RECORD_FIELD + NAME + IDENT "foo" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + WHITESPACE "\n" + R_CURLY "}" diff --git a/crates/syntax/test_data/parser/ok/0004_file_shebang.rast b/crates/parser/test_data/parser/ok/0004_file_shebang.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0004_file_shebang.rast rename to crates/parser/test_data/parser/ok/0004_file_shebang.rast diff --git a/crates/syntax/test_data/parser/ok/0004_file_shebang.rs b/crates/parser/test_data/parser/ok/0004_file_shebang.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0004_file_shebang.rs rename to crates/parser/test_data/parser/ok/0004_file_shebang.rs diff --git a/crates/parser/test_data/parser/ok/0004_file_shebang.txt b/crates/parser/test_data/parser/ok/0004_file_shebang.txt new file mode 100644 index 0000000000..698957189f --- /dev/null +++ b/crates/parser/test_data/parser/ok/0004_file_shebang.txt @@ -0,0 +1,2 @@ +SOURCE_FILE + SHEBANG "#!/use/bin/env rusti" diff --git a/crates/syntax/test_data/parser/ok/0005_fn_item.rast b/crates/parser/test_data/parser/ok/0005_fn_item.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0005_fn_item.rast rename to crates/parser/test_data/parser/ok/0005_fn_item.rast diff --git a/crates/syntax/test_data/parser/ok/0005_fn_item.rs b/crates/parser/test_data/parser/ok/0005_fn_item.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0005_fn_item.rs rename to crates/parser/test_data/parser/ok/0005_fn_item.rs diff --git a/crates/parser/test_data/parser/ok/0005_fn_item.txt b/crates/parser/test_data/parser/ok/0005_fn_item.txt new file mode 100644 index 0000000000..756d20e4d6 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0005_fn_item.txt @@ -0,0 +1,16 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0006_inner_attributes.rast b/crates/parser/test_data/parser/ok/0006_inner_attributes.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0006_inner_attributes.rast rename to crates/parser/test_data/parser/ok/0006_inner_attributes.rast diff --git a/crates/syntax/test_data/parser/ok/0006_inner_attributes.rs b/crates/parser/test_data/parser/ok/0006_inner_attributes.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0006_inner_attributes.rs rename to crates/parser/test_data/parser/ok/0006_inner_attributes.rs diff --git a/crates/parser/test_data/parser/ok/0006_inner_attributes.txt b/crates/parser/test_data/parser/ok/0006_inner_attributes.txt new file mode 100644 index 0000000000..cb63ba80e7 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0006_inner_attributes.txt @@ -0,0 +1,194 @@ +SOURCE_FILE + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE "\n" + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + TOKEN_TREE + L_PAREN "(" + TRUE_KW "true" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n" + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + TOKEN_TREE + L_PAREN "(" + IDENT "ident" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n" + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + TOKEN_TREE + L_PAREN "(" + IDENT "ident" + COMMA "," + WHITESPACE " " + INT_NUMBER "100" + COMMA "," + WHITESPACE " " + TRUE_KW "true" + COMMA "," + WHITESPACE " " + STRING "\"true\"" + COMMA "," + WHITESPACE " " + IDENT "ident" + WHITESPACE " " + EQ "=" + WHITESPACE " " + INT_NUMBER "100" + COMMA "," + WHITESPACE " " + IDENT "ident" + WHITESPACE " " + EQ "=" + WHITESPACE " " + STRING "\"hello\"" + COMMA "," + WHITESPACE " " + IDENT "ident" + TOKEN_TREE + L_PAREN "(" + INT_NUMBER "100" + R_PAREN ")" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n" + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + TOKEN_TREE + L_PAREN "(" + INT_NUMBER "100" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n" + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + TOKEN_TREE + L_PAREN "(" + IDENT "enabled" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TRUE_KW "true" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n" + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "enabled" + TOKEN_TREE + L_PAREN "(" + TRUE_KW "true" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n" + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + TOKEN_TREE + L_PAREN "(" + STRING "\"hello\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n" + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "repr" + TOKEN_TREE + L_PAREN "(" + IDENT "C" + COMMA "," + WHITESPACE " " + IDENT "align" + WHITESPACE " " + EQ "=" + WHITESPACE " " + INT_NUMBER "4" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n" + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "repr" + TOKEN_TREE + L_PAREN "(" + IDENT "C" + COMMA "," + WHITESPACE " " + IDENT "align" + TOKEN_TREE + L_PAREN "(" + INT_NUMBER "4" + R_PAREN ")" + R_PAREN ")" + R_BRACK "]" diff --git a/crates/syntax/test_data/parser/ok/0007_extern_crate.rast b/crates/parser/test_data/parser/ok/0007_extern_crate.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0007_extern_crate.rast rename to crates/parser/test_data/parser/ok/0007_extern_crate.rast diff --git a/crates/syntax/test_data/parser/ok/0007_extern_crate.rs b/crates/parser/test_data/parser/ok/0007_extern_crate.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0007_extern_crate.rs rename to crates/parser/test_data/parser/ok/0007_extern_crate.rs diff --git a/crates/parser/test_data/parser/ok/0007_extern_crate.txt b/crates/parser/test_data/parser/ok/0007_extern_crate.txt new file mode 100644 index 0000000000..8b9259fd6b --- /dev/null +++ b/crates/parser/test_data/parser/ok/0007_extern_crate.txt @@ -0,0 +1,40 @@ +SOURCE_FILE + EXTERN_CRATE + EXTERN_KW "extern" + WHITESPACE " " + CRATE_KW "crate" + WHITESPACE " " + NAME_REF + IDENT "foo" + SEMICOLON ";" + WHITESPACE "\n" + EXTERN_CRATE + EXTERN_KW "extern" + WHITESPACE " " + CRATE_KW "crate" + WHITESPACE " " + NAME_REF + IDENT "foo" + WHITESPACE " " + RENAME + AS_KW "as" + WHITESPACE " " + NAME + IDENT "bar" + SEMICOLON ";" + WHITESPACE "\n" + EXTERN_CRATE + EXTERN_KW "extern" + WHITESPACE " " + CRATE_KW "crate" + WHITESPACE " " + NAME_REF + SELF_KW "self" + WHITESPACE " " + RENAME + AS_KW "as" + WHITESPACE " " + NAME + IDENT "baz" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0008_mod_item.rast b/crates/parser/test_data/parser/ok/0008_mod_item.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0008_mod_item.rast rename to crates/parser/test_data/parser/ok/0008_mod_item.rast diff --git a/crates/syntax/test_data/parser/ok/0008_mod_item.rs b/crates/parser/test_data/parser/ok/0008_mod_item.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0008_mod_item.rs rename to crates/parser/test_data/parser/ok/0008_mod_item.rs diff --git a/crates/parser/test_data/parser/ok/0008_mod_item.txt b/crates/parser/test_data/parser/ok/0008_mod_item.txt new file mode 100644 index 0000000000..adee67181b --- /dev/null +++ b/crates/parser/test_data/parser/ok/0008_mod_item.txt @@ -0,0 +1,77 @@ +SOURCE_FILE + MODULE + MOD_KW "mod" + WHITESPACE " " + NAME + IDENT "c" + WHITESPACE " " + ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n " + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + MODULE + MOD_KW "mod" + WHITESPACE " " + NAME + IDENT "d" + WHITESPACE " " + ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE "\n " + MODULE + MOD_KW "mod" + WHITESPACE " " + NAME + IDENT "e" + SEMICOLON ";" + WHITESPACE "\n " + MODULE + MOD_KW "mod" + WHITESPACE " " + NAME + IDENT "f" + WHITESPACE " " + ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0009_use_item.rast b/crates/parser/test_data/parser/ok/0009_use_item.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0009_use_item.rast rename to crates/parser/test_data/parser/ok/0009_use_item.rast diff --git a/crates/syntax/test_data/parser/ok/0009_use_item.rs b/crates/parser/test_data/parser/ok/0009_use_item.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0009_use_item.rs rename to crates/parser/test_data/parser/ok/0009_use_item.rs diff --git a/crates/parser/test_data/parser/ok/0009_use_item.txt b/crates/parser/test_data/parser/ok/0009_use_item.txt new file mode 100644 index 0000000000..04a44ef7e4 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0009_use_item.txt @@ -0,0 +1,21 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "bar" + SEMICOLON ";" diff --git a/crates/syntax/test_data/parser/ok/0010_use_path_segments.rast b/crates/parser/test_data/parser/ok/0010_use_path_segments.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0010_use_path_segments.rast rename to crates/parser/test_data/parser/ok/0010_use_path_segments.rast diff --git a/crates/syntax/test_data/parser/ok/0010_use_path_segments.rs b/crates/parser/test_data/parser/ok/0010_use_path_segments.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0010_use_path_segments.rs rename to crates/parser/test_data/parser/ok/0010_use_path_segments.rs diff --git a/crates/parser/test_data/parser/ok/0010_use_path_segments.txt b/crates/parser/test_data/parser/ok/0010_use_path_segments.txt new file mode 100644 index 0000000000..ddadec817b --- /dev/null +++ b/crates/parser/test_data/parser/ok/0010_use_path_segments.txt @@ -0,0 +1,42 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "foo" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "bar" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "baz" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "bar" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "baz" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0011_outer_attribute.rast b/crates/parser/test_data/parser/ok/0011_outer_attribute.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0011_outer_attribute.rast rename to crates/parser/test_data/parser/ok/0011_outer_attribute.rast diff --git a/crates/syntax/test_data/parser/ok/0011_outer_attribute.rs b/crates/parser/test_data/parser/ok/0011_outer_attribute.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0011_outer_attribute.rs rename to crates/parser/test_data/parser/ok/0011_outer_attribute.rs diff --git a/crates/parser/test_data/parser/ok/0011_outer_attribute.txt b/crates/parser/test_data/parser/ok/0011_outer_attribute.txt new file mode 100644 index 0000000000..dbb9bc54da --- /dev/null +++ b/crates/parser/test_data/parser/ok/0011_outer_attribute.txt @@ -0,0 +1,61 @@ +SOURCE_FILE + FN + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "cfg" + TOKEN_TREE + L_PAREN "(" + IDENT "test" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n" + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "Ignore" + R_BRACK "]" + WHITESPACE "\n" + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n\n" + MODULE + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "path" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + STRING "\"a.rs\"" + R_BRACK "]" + WHITESPACE "\n" + MOD_KW "mod" + WHITESPACE " " + NAME + IDENT "b" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0012_visibility.rast b/crates/parser/test_data/parser/ok/0012_visibility.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0012_visibility.rast rename to crates/parser/test_data/parser/ok/0012_visibility.rast diff --git a/crates/syntax/test_data/parser/ok/0012_visibility.rs b/crates/parser/test_data/parser/ok/0012_visibility.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0012_visibility.rs rename to crates/parser/test_data/parser/ok/0012_visibility.rs diff --git a/crates/parser/test_data/parser/ok/0012_visibility.txt b/crates/parser/test_data/parser/ok/0012_visibility.txt new file mode 100644 index 0000000000..a95bc23016 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0012_visibility.txt @@ -0,0 +1,133 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "a" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "b" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + MACRO_DEF + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + MACRO_KW "macro" + WHITESPACE " " + NAME + IDENT "m" + TOKEN_TREE + TOKEN_TREE + L_PAREN "(" + DOLLAR "$" + COLON ":" + IDENT "ident" + R_PAREN ")" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + VISIBILITY + PUB_KW "pub" + L_PAREN "(" + PATH + PATH_SEGMENT + NAME_REF + CRATE_KW "crate" + R_PAREN ")" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "c" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + VISIBILITY + PUB_KW "pub" + L_PAREN "(" + PATH + PATH_SEGMENT + NAME_REF + SUPER_KW "super" + R_PAREN ")" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "d" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + VISIBILITY + PUB_KW "pub" + L_PAREN "(" + IN_KW "in" + WHITESPACE " " + PATH + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "bar" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "baz" + R_PAREN ")" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "e" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0013_use_path_self_super.rast b/crates/parser/test_data/parser/ok/0013_use_path_self_super.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0013_use_path_self_super.rast rename to crates/parser/test_data/parser/ok/0013_use_path_self_super.rast diff --git a/crates/syntax/test_data/parser/ok/0013_use_path_self_super.rs b/crates/parser/test_data/parser/ok/0013_use_path_self_super.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0013_use_path_self_super.rs rename to crates/parser/test_data/parser/ok/0013_use_path_self_super.rs diff --git a/crates/parser/test_data/parser/ok/0013_use_path_self_super.txt b/crates/parser/test_data/parser/ok/0013_use_path_self_super.txt new file mode 100644 index 0000000000..8a0149caca --- /dev/null +++ b/crates/parser/test_data/parser/ok/0013_use_path_self_super.txt @@ -0,0 +1,36 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH_SEGMENT + NAME_REF + SELF_KW "self" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "foo" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH + PATH_SEGMENT + NAME_REF + SUPER_KW "super" + COLON2 "::" + PATH_SEGMENT + NAME_REF + SUPER_KW "super" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "bar" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0014_use_tree.rast b/crates/parser/test_data/parser/ok/0014_use_tree.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0014_use_tree.rast rename to crates/parser/test_data/parser/ok/0014_use_tree.rast diff --git a/crates/syntax/test_data/parser/ok/0014_use_tree.rs b/crates/parser/test_data/parser/ok/0014_use_tree.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0014_use_tree.rs rename to crates/parser/test_data/parser/ok/0014_use_tree.rs diff --git a/crates/parser/test_data/parser/ok/0014_use_tree.txt b/crates/parser/test_data/parser/ok/0014_use_tree.txt new file mode 100644 index 0000000000..b37edc365b --- /dev/null +++ b/crates/parser/test_data/parser/ok/0014_use_tree.txt @@ -0,0 +1,95 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + STAR "*" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + COLON2 "::" + STAR "*" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + COLON2 "::" + USE_TREE_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + USE_TREE_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + COLON2 "::" + STAR "*" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + COLON2 "::" + USE_TREE_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "foo" + COLON2 "::" + USE_TREE_LIST + L_CURLY "{" + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + COMMA "," + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "b" + COMMA "," + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "c" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0015_use_tree.rast b/crates/parser/test_data/parser/ok/0015_use_tree.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0015_use_tree.rast rename to crates/parser/test_data/parser/ok/0015_use_tree.rast diff --git a/crates/syntax/test_data/parser/ok/0015_use_tree.rs b/crates/parser/test_data/parser/ok/0015_use_tree.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0015_use_tree.rs rename to crates/parser/test_data/parser/ok/0015_use_tree.rs diff --git a/crates/parser/test_data/parser/ok/0015_use_tree.txt b/crates/parser/test_data/parser/ok/0015_use_tree.txt new file mode 100644 index 0000000000..ddf8aad6fc --- /dev/null +++ b/crates/parser/test_data/parser/ok/0015_use_tree.txt @@ -0,0 +1,65 @@ +SOURCE_FILE + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + WHITESPACE " " + RENAME + AS_KW "as" + WHITESPACE " " + NAME + IDENT "bar" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + COLON2 "::" + USE_TREE_LIST + L_CURLY "{" + USE_TREE + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + WHITESPACE " " + RENAME + AS_KW "as" + WHITESPACE " " + NAME + IDENT "b" + COMMA "," + WHITESPACE " " + USE_TREE + STAR "*" + COMMA "," + WHITESPACE " " + USE_TREE + COLON2 "::" + STAR "*" + COMMA "," + WHITESPACE " " + USE_TREE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "foo" + WHITESPACE " " + RENAME + AS_KW "as" + WHITESPACE " " + NAME + IDENT "x" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0016_struct_flavors.rast b/crates/parser/test_data/parser/ok/0016_struct_flavors.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0016_struct_flavors.rast rename to crates/parser/test_data/parser/ok/0016_struct_flavors.rast diff --git a/crates/syntax/test_data/parser/ok/0016_struct_flavors.rs b/crates/parser/test_data/parser/ok/0016_struct_flavors.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0016_struct_flavors.rs rename to crates/parser/test_data/parser/ok/0016_struct_flavors.rs diff --git a/crates/parser/test_data/parser/ok/0016_struct_flavors.txt b/crates/parser/test_data/parser/ok/0016_struct_flavors.txt new file mode 100644 index 0000000000..eb2724e2f3 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0016_struct_flavors.txt @@ -0,0 +1,93 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "A" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "B" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "C" + TUPLE_FIELD_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "D" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE "\n " + RECORD_FIELD + NAME + IDENT "a" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + COMMA "," + WHITESPACE "\n " + RECORD_FIELD + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + NAME + IDENT "b" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "E" + TUPLE_FIELD_LIST + L_PAREN "(" + TUPLE_FIELD + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + COMMA "," + WHITESPACE " " + TUPLE_FIELD + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "y" + COMMA "," + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0017_attr_trailing_comma.rast b/crates/parser/test_data/parser/ok/0017_attr_trailing_comma.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0017_attr_trailing_comma.rast rename to crates/parser/test_data/parser/ok/0017_attr_trailing_comma.rast diff --git a/crates/syntax/test_data/parser/ok/0017_attr_trailing_comma.rs b/crates/parser/test_data/parser/ok/0017_attr_trailing_comma.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0017_attr_trailing_comma.rs rename to crates/parser/test_data/parser/ok/0017_attr_trailing_comma.rs diff --git a/crates/parser/test_data/parser/ok/0017_attr_trailing_comma.txt b/crates/parser/test_data/parser/ok/0017_attr_trailing_comma.txt new file mode 100644 index 0000000000..7c914e2542 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0017_attr_trailing_comma.txt @@ -0,0 +1,30 @@ +SOURCE_FILE + FN + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + TOKEN_TREE + L_PAREN "(" + IDENT "a" + COMMA "," + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n" + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0018_struct_type_params.rast b/crates/parser/test_data/parser/ok/0018_struct_type_params.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0018_struct_type_params.rast rename to crates/parser/test_data/parser/ok/0018_struct_type_params.rast diff --git a/crates/syntax/test_data/parser/ok/0018_struct_type_params.rs b/crates/parser/test_data/parser/ok/0018_struct_type_params.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0018_struct_type_params.rs rename to crates/parser/test_data/parser/ok/0018_struct_type_params.rs diff --git a/crates/parser/test_data/parser/ok/0018_struct_type_params.txt b/crates/parser/test_data/parser/ok/0018_struct_type_params.txt new file mode 100644 index 0000000000..11ebc7efb9 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0018_struct_type_params.txt @@ -0,0 +1,274 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S1" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S2" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + R_ANGLE ">" + TUPLE_FIELD_LIST + L_PAREN "(" + TUPLE_FIELD + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S3" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + R_ANGLE ">" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_FIELD + NAME + IDENT "u" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S4" + GENERIC_PARAM_LIST + L_ANGLE "<" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S5" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S6" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + COLON ":" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S7" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + COLON ":" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'b" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S8" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + COLON ":" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'b" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S9" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + COLON ":" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'b" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'c" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S10" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + COMMA "," + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S11" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + COMMA "," + WHITESPACE " " + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'b" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S12" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + COLON ":" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'b" + PLUS "+" + COMMA "," + WHITESPACE " " + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'b" + COLON ":" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'c" + COMMA "," + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S13" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S14" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COMMA "," + WHITESPACE " " + TYPE_PARAM + NAME + IDENT "U" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S15" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + COMMA "," + WHITESPACE " " + TYPE_PARAM + NAME + IDENT "T" + COMMA "," + WHITESPACE " " + TYPE_PARAM + NAME + IDENT "U" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0019_enums.rast b/crates/parser/test_data/parser/ok/0019_enums.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0019_enums.rast rename to crates/parser/test_data/parser/ok/0019_enums.rast diff --git a/crates/syntax/test_data/parser/ok/0019_enums.rs b/crates/parser/test_data/parser/ok/0019_enums.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0019_enums.rs rename to crates/parser/test_data/parser/ok/0019_enums.rs diff --git a/crates/parser/test_data/parser/ok/0019_enums.txt b/crates/parser/test_data/parser/ok/0019_enums.txt new file mode 100644 index 0000000000..dd47e3aa47 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0019_enums.txt @@ -0,0 +1,155 @@ +SOURCE_FILE + ENUM + ENUM_KW "enum" + WHITESPACE " " + NAME + IDENT "E1" + WHITESPACE " " + VARIANT_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + ENUM + ENUM_KW "enum" + WHITESPACE " " + NAME + IDENT "E2" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + R_ANGLE ">" + WHITESPACE " " + VARIANT_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + ENUM + ENUM_KW "enum" + WHITESPACE " " + NAME + IDENT "E3" + WHITESPACE " " + VARIANT_LIST + L_CURLY "{" + WHITESPACE "\n " + VARIANT + NAME + IDENT "X" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + ENUM + ENUM_KW "enum" + WHITESPACE " " + NAME + IDENT "E4" + WHITESPACE " " + VARIANT_LIST + L_CURLY "{" + WHITESPACE "\n " + VARIANT + NAME + IDENT "X" + COMMA "," + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + ENUM + ENUM_KW "enum" + WHITESPACE " " + NAME + IDENT "E5" + WHITESPACE " " + VARIANT_LIST + L_CURLY "{" + WHITESPACE "\n " + VARIANT + NAME + IDENT "A" + COMMA "," + WHITESPACE "\n " + VARIANT + NAME + IDENT "B" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + COMMA "," + WHITESPACE "\n " + VARIANT + NAME + IDENT "C" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE "\n " + RECORD_FIELD + NAME + IDENT "a" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + COMMA "," + WHITESPACE "\n " + RECORD_FIELD + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + NAME + IDENT "b" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "f64" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + COMMA "," + WHITESPACE "\n " + VARIANT + NAME + IDENT "F" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + R_CURLY "}" + COMMA "," + WHITESPACE "\n " + VARIANT + NAME + IDENT "D" + TUPLE_FIELD_LIST + L_PAREN "(" + TUPLE_FIELD + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + COMMA "," + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + VARIANT + NAME + IDENT "E" + TUPLE_FIELD_LIST + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0020_type_param_bounds.rast b/crates/parser/test_data/parser/ok/0020_type_param_bounds.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0020_type_param_bounds.rast rename to crates/parser/test_data/parser/ok/0020_type_param_bounds.rast diff --git a/crates/syntax/test_data/parser/ok/0020_type_param_bounds.rs b/crates/parser/test_data/parser/ok/0020_type_param_bounds.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0020_type_param_bounds.rs rename to crates/parser/test_data/parser/ok/0020_type_param_bounds.rs diff --git a/crates/parser/test_data/parser/ok/0020_type_param_bounds.txt b/crates/parser/test_data/parser/ok/0020_type_param_bounds.txt new file mode 100644 index 0000000000..043a966ff9 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0020_type_param_bounds.txt @@ -0,0 +1,283 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "A" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "B" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + TYPE_BOUND_LIST + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "C" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "D" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "E" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'d" + WHITESPACE " " + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "F" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'d" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Clone" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "G" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Clone" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Copy" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "H" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "Foo" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + SELF_KW "self" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Bar" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "I" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + TYPE_BOUND_LIST + COMMA "," + WHITESPACE " " + TYPE_PARAM + NAME + IDENT "U" + COLON ":" + TYPE_BOUND_LIST + COMMA "," + R_ANGLE ">" + SEMICOLON ";" + WHITESPACE "\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "K" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + COLON ":" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'d" + COMMA "," + WHITESPACE " " + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'d" + COLON ":" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'b" + COMMA "," + WHITESPACE " " + TYPE_PARAM + NAME + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'d" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Clone" + R_ANGLE ">" + SEMICOLON ";" diff --git a/crates/syntax/test_data/parser/ok/0022_empty_extern_block.rast b/crates/parser/test_data/parser/ok/0022_empty_extern_block.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0022_empty_extern_block.rast rename to crates/parser/test_data/parser/ok/0022_empty_extern_block.rast diff --git a/crates/syntax/test_data/parser/ok/0022_empty_extern_block.rs b/crates/parser/test_data/parser/ok/0022_empty_extern_block.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0022_empty_extern_block.rs rename to crates/parser/test_data/parser/ok/0022_empty_extern_block.rs diff --git a/crates/parser/test_data/parser/ok/0022_empty_extern_block.txt b/crates/parser/test_data/parser/ok/0022_empty_extern_block.txt new file mode 100644 index 0000000000..ef2fb66dd5 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0022_empty_extern_block.txt @@ -0,0 +1,21 @@ +SOURCE_FILE + EXTERN_BLOCK + ABI + EXTERN_KW "extern" + WHITESPACE " " + EXTERN_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + EXTERN_BLOCK + ABI + EXTERN_KW "extern" + WHITESPACE " " + STRING "\"C\"" + WHITESPACE " " + EXTERN_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0023_static_items.rast b/crates/parser/test_data/parser/ok/0023_static_items.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0023_static_items.rast rename to crates/parser/test_data/parser/ok/0023_static_items.rast diff --git a/crates/syntax/test_data/parser/ok/0023_static_items.rs b/crates/parser/test_data/parser/ok/0023_static_items.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0023_static_items.rs rename to crates/parser/test_data/parser/ok/0023_static_items.rs diff --git a/crates/parser/test_data/parser/ok/0023_static_items.txt b/crates/parser/test_data/parser/ok/0023_static_items.txt new file mode 100644 index 0000000000..b164e828e3 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0023_static_items.txt @@ -0,0 +1,41 @@ +SOURCE_FILE + STATIC + STATIC_KW "static" + WHITESPACE " " + NAME + IDENT "FOO" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n" + STATIC + STATIC_KW "static" + WHITESPACE " " + MUT_KW "mut" + WHITESPACE " " + NAME + IDENT "BAR" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + SEMICOLON ";" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0024_const_item.rast b/crates/parser/test_data/parser/ok/0024_const_item.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0024_const_item.rast rename to crates/parser/test_data/parser/ok/0024_const_item.rast diff --git a/crates/syntax/test_data/parser/ok/0024_const_item.rs b/crates/parser/test_data/parser/ok/0024_const_item.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0024_const_item.rs rename to crates/parser/test_data/parser/ok/0024_const_item.rs diff --git a/crates/parser/test_data/parser/ok/0024_const_item.txt b/crates/parser/test_data/parser/ok/0024_const_item.txt new file mode 100644 index 0000000000..40b9ef804c --- /dev/null +++ b/crates/parser/test_data/parser/ok/0024_const_item.txt @@ -0,0 +1 @@ +SOURCE_FILE diff --git a/crates/syntax/test_data/parser/ok/0025_extern_fn_in_block.rast b/crates/parser/test_data/parser/ok/0025_extern_fn_in_block.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0025_extern_fn_in_block.rast rename to crates/parser/test_data/parser/ok/0025_extern_fn_in_block.rast diff --git a/crates/syntax/test_data/parser/ok/0025_extern_fn_in_block.rs b/crates/parser/test_data/parser/ok/0025_extern_fn_in_block.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0025_extern_fn_in_block.rs rename to crates/parser/test_data/parser/ok/0025_extern_fn_in_block.rs diff --git a/crates/parser/test_data/parser/ok/0025_extern_fn_in_block.txt b/crates/parser/test_data/parser/ok/0025_extern_fn_in_block.txt new file mode 100644 index 0000000000..9c5f5ac64e --- /dev/null +++ b/crates/parser/test_data/parser/ok/0025_extern_fn_in_block.txt @@ -0,0 +1,33 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + ABI + EXTERN_KW "extern" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0026_const_fn_in_block.rast b/crates/parser/test_data/parser/ok/0026_const_fn_in_block.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0026_const_fn_in_block.rast rename to crates/parser/test_data/parser/ok/0026_const_fn_in_block.rast diff --git a/crates/syntax/test_data/parser/ok/0026_const_fn_in_block.rs b/crates/parser/test_data/parser/ok/0026_const_fn_in_block.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0026_const_fn_in_block.rs rename to crates/parser/test_data/parser/ok/0026_const_fn_in_block.rs diff --git a/crates/parser/test_data/parser/ok/0026_const_fn_in_block.txt b/crates/parser/test_data/parser/ok/0026_const_fn_in_block.txt new file mode 100644 index 0000000000..ca9a3df86f --- /dev/null +++ b/crates/parser/test_data/parser/ok/0026_const_fn_in_block.txt @@ -0,0 +1,32 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + CONST_KW "const" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast b/crates/parser/test_data/parser/ok/0027_unsafe_fn_in_block.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast rename to crates/parser/test_data/parser/ok/0027_unsafe_fn_in_block.rast diff --git a/crates/syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rs b/crates/parser/test_data/parser/ok/0027_unsafe_fn_in_block.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rs rename to crates/parser/test_data/parser/ok/0027_unsafe_fn_in_block.rs diff --git a/crates/parser/test_data/parser/ok/0027_unsafe_fn_in_block.txt b/crates/parser/test_data/parser/ok/0027_unsafe_fn_in_block.txt new file mode 100644 index 0000000000..88ebd10952 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0027_unsafe_fn_in_block.txt @@ -0,0 +1,43 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + UNSAFE_KW "unsafe" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + BLOCK_EXPR + UNSAFE_KW "unsafe" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0028_operator_binding_power.rast b/crates/parser/test_data/parser/ok/0028_operator_binding_power.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0028_operator_binding_power.rast rename to crates/parser/test_data/parser/ok/0028_operator_binding_power.rast diff --git a/crates/syntax/test_data/parser/ok/0028_operator_binding_power.rs b/crates/parser/test_data/parser/ok/0028_operator_binding_power.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0028_operator_binding_power.rs rename to crates/parser/test_data/parser/ok/0028_operator_binding_power.rs diff --git a/crates/parser/test_data/parser/ok/0028_operator_binding_power.txt b/crates/parser/test_data/parser/ok/0028_operator_binding_power.txt new file mode 100644 index 0000000000..ae08c0756a --- /dev/null +++ b/crates/parser/test_data/parser/ok/0028_operator_binding_power.txt @@ -0,0 +1,186 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "binding_power" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "x" + WHITESPACE " " + EQ "=" + WHITESPACE " " + BIN_EXPR + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + BIN_EXPR + BIN_EXPR + LITERAL + INT_NUMBER "2" + WHITESPACE " " + STAR "*" + WHITESPACE " " + LITERAL + INT_NUMBER "3" + WHITESPACE " " + PERCENT "%" + WHITESPACE " " + LITERAL + INT_NUMBER "4" + WHITESPACE " " + MINUS "-" + WHITESPACE " " + BIN_EXPR + LITERAL + INT_NUMBER "5" + WHITESPACE " " + SLASH "/" + WHITESPACE " " + LITERAL + INT_NUMBER "6" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + BIN_EXPR + LITERAL + INT_NUMBER "2" + WHITESPACE " " + STAR "*" + WHITESPACE " " + LITERAL + INT_NUMBER "3" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + SHL "<<" + WHITESPACE " " + BIN_EXPR + LITERAL + INT_NUMBER "2" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + LITERAL + INT_NUMBER "3" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + AMP "&" + WHITESPACE " " + BIN_EXPR + LITERAL + INT_NUMBER "2" + WHITESPACE " " + SHR ">>" + WHITESPACE " " + LITERAL + INT_NUMBER "3" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + CARET "^" + WHITESPACE " " + BIN_EXPR + LITERAL + INT_NUMBER "2" + WHITESPACE " " + AMP "&" + WHITESPACE " " + LITERAL + INT_NUMBER "3" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + PIPE "|" + WHITESPACE " " + BIN_EXPR + LITERAL + INT_NUMBER "2" + WHITESPACE " " + CARET "^" + WHITESPACE " " + LITERAL + INT_NUMBER "3" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + EQ2 "==" + WHITESPACE " " + BIN_EXPR + LITERAL + INT_NUMBER "2" + WHITESPACE " " + PIPE "|" + WHITESPACE " " + LITERAL + INT_NUMBER "3" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + AMP2 "&&" + WHITESPACE " " + BIN_EXPR + LITERAL + INT_NUMBER "2" + WHITESPACE " " + EQ2 "==" + WHITESPACE " " + LITERAL + INT_NUMBER "3" + SEMICOLON ";" + WHITESPACE "\n " + COMMENT "//1 || 2 && 2;" + WHITESPACE "\n " + COMMENT "//1 .. 2 || 3;" + WHITESPACE "\n " + COMMENT "//1 = 2 .. 3;" + WHITESPACE "\n " + COMMENT "//---&*1 - --2 * 9;" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0029_range_forms.rast b/crates/parser/test_data/parser/ok/0029_range_forms.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0029_range_forms.rast rename to crates/parser/test_data/parser/ok/0029_range_forms.rast diff --git a/crates/syntax/test_data/parser/ok/0029_range_forms.rs b/crates/parser/test_data/parser/ok/0029_range_forms.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0029_range_forms.rs rename to crates/parser/test_data/parser/ok/0029_range_forms.rs diff --git a/crates/parser/test_data/parser/ok/0029_range_forms.txt b/crates/parser/test_data/parser/ok/0029_range_forms.txt new file mode 100644 index 0000000000..5acc54e713 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0029_range_forms.txt @@ -0,0 +1,152 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + RANGE_EXPR + DOT2 ".." + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + RANGE_EXPR + DOT2 ".." + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "z" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "2" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + WHITESPACE " " + EQ "=" + WHITESPACE " " + RANGE_EXPR + LITERAL + FALSE_KW "false" + DOT2 ".." + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + EQ2 "==" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "x" + WHITESPACE " " + EQ "=" + WHITESPACE " " + RANGE_EXPR + LITERAL + INT_NUMBER "1" + DOT2 ".." + SEMICOLON ";" + WHITESPACE "\n \n " + EXPR_STMT + RANGE_EXPR + DOT2EQ "..=" + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + RANGE_EXPR + DOT2EQ "..=" + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "z" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "2" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + WHITESPACE " " + EQ "=" + WHITESPACE " " + RANGE_EXPR + LITERAL + FALSE_KW "false" + DOT2EQ "..=" + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + EQ2 "==" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "x" + WHITESPACE " " + EQ "=" + WHITESPACE " " + RANGE_EXPR + LITERAL + INT_NUMBER "1" + DOT2 ".." + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0030_string_suffixes.rast b/crates/parser/test_data/parser/ok/0030_string_suffixes.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0030_string_suffixes.rast rename to crates/parser/test_data/parser/ok/0030_string_suffixes.rast diff --git a/crates/syntax/test_data/parser/ok/0030_string_suffixes.rs b/crates/parser/test_data/parser/ok/0030_string_suffixes.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0030_string_suffixes.rs rename to crates/parser/test_data/parser/ok/0030_string_suffixes.rs diff --git a/crates/parser/test_data/parser/ok/0030_string_suffixes.txt b/crates/parser/test_data/parser/ok/0030_string_suffixes.txt new file mode 100644 index 0000000000..44211c7c42 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0030_string_suffixes.txt @@ -0,0 +1,64 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + CHAR "'c'u32" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + STRING "\"string\"invalid" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + BYTE "b'b'_suff" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + BYTE_STRING "b\"bs\"invalid" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0030_traits.rast b/crates/parser/test_data/parser/ok/0030_traits.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0030_traits.rast rename to crates/parser/test_data/parser/ok/0030_traits.rast diff --git a/crates/syntax/test_data/parser/ok/0030_traits.rs b/crates/parser/test_data/parser/ok/0030_traits.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0030_traits.rs rename to crates/parser/test_data/parser/ok/0030_traits.rs diff --git a/crates/parser/test_data/parser/ok/0030_traits.txt b/crates/parser/test_data/parser/ok/0030_traits.txt new file mode 100644 index 0000000000..44423581e6 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0030_traits.txt @@ -0,0 +1,61 @@ +SOURCE_FILE + TRAIT + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "Runnable" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "handler" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + TRAIT + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "TraitWithExpr" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "fn_with_expr" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + ARRAY_TYPE + L_BRACK "[" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + SEMICOLON ";" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + R_BRACK "]" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0031_extern.rast b/crates/parser/test_data/parser/ok/0031_extern.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0031_extern.rast rename to crates/parser/test_data/parser/ok/0031_extern.rast diff --git a/crates/syntax/test_data/parser/ok/0031_extern.rs b/crates/parser/test_data/parser/ok/0031_extern.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0031_extern.rs rename to crates/parser/test_data/parser/ok/0031_extern.rs diff --git a/crates/parser/test_data/parser/ok/0031_extern.txt b/crates/parser/test_data/parser/ok/0031_extern.txt new file mode 100644 index 0000000000..70b5278086 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0031_extern.txt @@ -0,0 +1,973 @@ +SOURCE_FILE + EXTERN_BLOCK + ABI + EXTERN_KW "extern" + WHITESPACE " " + EXTERN_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "socket" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "domain" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "ty" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "protocol" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + SEMICOLON ";" + WHITESPACE "\n " + FN + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "bind" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "fd" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "addr" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + CONST_KW "const" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "sockaddr" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "len" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "socklen_t" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + SEMICOLON ";" + WHITESPACE "\n " + FN + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "connect" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "socket" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "address" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + CONST_KW "const" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "sockaddr" + COMMA "," + WHITESPACE "\n " + PARAM + IDENT_PAT + NAME + IDENT "len" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "socklen_t" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + SEMICOLON ";" + WHITESPACE "\n " + FN + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "listen" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "socket" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "backlog" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + SEMICOLON ";" + WHITESPACE "\n " + FN + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "getsockname" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "socket" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "address" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + MUT_KW "mut" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "sockaddr" + COMMA "," + WHITESPACE "\n " + PARAM + IDENT_PAT + NAME + IDENT "address_len" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + MUT_KW "mut" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "socklen_t" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + SEMICOLON ";" + WHITESPACE "\n " + FN + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "getsockopt" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "sockfd" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE "\n " + PARAM + IDENT_PAT + NAME + IDENT "level" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE "\n " + PARAM + IDENT_PAT + NAME + IDENT "optname" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE "\n " + PARAM + IDENT_PAT + NAME + IDENT "optval" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + MUT_KW "mut" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_void" + COMMA "," + WHITESPACE "\n " + PARAM + IDENT_PAT + NAME + IDENT "optlen" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + MUT_KW "mut" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "socklen_t" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + SEMICOLON ";" + WHITESPACE "\n " + FN + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "setsockopt" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "socket" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "level" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "name" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE "\n " + PARAM + IDENT_PAT + NAME + IDENT "value" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + CONST_KW "const" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_void" + COMMA "," + WHITESPACE "\n " + PARAM + IDENT_PAT + NAME + IDENT "option_len" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "socklen_t" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + SEMICOLON ";" + WHITESPACE "\n " + FN + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "getpeername" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "socket" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "address" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + MUT_KW "mut" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "sockaddr" + COMMA "," + WHITESPACE "\n " + PARAM + IDENT_PAT + NAME + IDENT "address_len" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + MUT_KW "mut" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "socklen_t" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + SEMICOLON ";" + WHITESPACE "\n " + FN + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "sendto" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "socket" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "buf" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + CONST_KW "const" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_void" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "len" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "size_t" + COMMA "," + WHITESPACE "\n " + PARAM + IDENT_PAT + NAME + IDENT "flags" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "addr" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + CONST_KW "const" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "sockaddr" + COMMA "," + WHITESPACE "\n " + PARAM + IDENT_PAT + NAME + IDENT "addrlen" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "socklen_t" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "ssize_t" + SEMICOLON ";" + WHITESPACE "\n " + FN + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "send" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "socket" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "buf" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + CONST_KW "const" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_void" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "len" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "size_t" + COMMA "," + WHITESPACE "\n " + PARAM + IDENT_PAT + NAME + IDENT "flags" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "ssize_t" + SEMICOLON ";" + WHITESPACE "\n " + FN + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "recvfrom" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "socket" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "buf" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + MUT_KW "mut" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_void" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "len" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "size_t" + COMMA "," + WHITESPACE "\n " + PARAM + IDENT_PAT + NAME + IDENT "flags" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "addr" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + MUT_KW "mut" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "sockaddr" + COMMA "," + WHITESPACE "\n " + PARAM + IDENT_PAT + NAME + IDENT "addrlen" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + MUT_KW "mut" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "socklen_t" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "ssize_t" + SEMICOLON ";" + WHITESPACE "\n " + FN + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "recv" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "socket" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "buf" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + MUT_KW "mut" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_void" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "len" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "size_t" + COMMA "," + WHITESPACE "\n " + PARAM + IDENT_PAT + NAME + IDENT "flags" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "c_int" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "ssize_t" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0032_where_for.rast b/crates/parser/test_data/parser/ok/0032_where_for.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0032_where_for.rast rename to crates/parser/test_data/parser/ok/0032_where_for.rast diff --git a/crates/syntax/test_data/parser/ok/0032_where_for.rs b/crates/parser/test_data/parser/ok/0032_where_for.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0032_where_for.rs rename to crates/parser/test_data/parser/ok/0032_where_for.rs diff --git a/crates/parser/test_data/parser/ok/0032_where_for.txt b/crates/parser/test_data/parser/ok/0032_where_for.txt new file mode 100644 index 0000000000..86f6af97c7 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0032_where_for.txt @@ -0,0 +1,93 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "test_serialization" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "SER" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n" + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE "\n " + WHERE_PRED + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "SER" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Serialize" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'de" + R_ANGLE ">" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Deserialize" + GENERIC_ARG_LIST + L_ANGLE "<" + LIFETIME_ARG + LIFETIME + LIFETIME_IDENT "'de" + R_ANGLE ">" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "PartialEq" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + PATH_TYPE + PATH + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "std" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "fmt" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Debug" + COMMA "," + WHITESPACE "\n" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0033_label_break.rast b/crates/parser/test_data/parser/ok/0033_label_break.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0033_label_break.rast rename to crates/parser/test_data/parser/ok/0033_label_break.rast diff --git a/crates/syntax/test_data/parser/ok/0033_label_break.rs b/crates/parser/test_data/parser/ok/0033_label_break.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0033_label_break.rs rename to crates/parser/test_data/parser/ok/0033_label_break.rs diff --git a/crates/parser/test_data/parser/ok/0033_label_break.txt b/crates/parser/test_data/parser/ok/0033_label_break.txt new file mode 100644 index 0000000000..9807bf0d9a --- /dev/null +++ b/crates/parser/test_data/parser/ok/0033_label_break.txt @@ -0,0 +1,227 @@ +SOURCE_FILE + FN + COMMENT "// format with label break value." + WHITESPACE "\n" + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + BLOCK_EXPR + LABEL + LIFETIME + LIFETIME_IDENT "'empty_block" + COLON ":" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n\n " + EXPR_STMT + BLOCK_EXPR + LABEL + LIFETIME + LIFETIME_IDENT "'block" + COLON ":" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "do_thing" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "condition_not_met" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + BREAK_EXPR + BREAK_KW "break" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'block" + SEMICOLON ";" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "do_next_thing" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "condition_not_met" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + BREAK_EXPR + BREAK_KW "break" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'block" + SEMICOLON ";" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "do_last_thing" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "result" + WHITESPACE " " + EQ "=" + WHITESPACE " " + BLOCK_EXPR + LABEL + LIFETIME + LIFETIME_IDENT "'block" + COLON ":" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + COMMENT "// comment" + WHITESPACE "\n " + EXPR_STMT + BREAK_EXPR + BREAK_KW "break" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'block" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + COMMENT "/* comment */" + WHITESPACE "\n " + EXPR_STMT + BREAK_EXPR + BREAK_KW "break" + WHITESPACE " " + LIFETIME + LIFETIME_IDENT "'block" + WHITESPACE " " + LITERAL + INT_NUMBER "2" + SEMICOLON ";" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n " + LITERAL + INT_NUMBER "3" + WHITESPACE "\n " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0034_crate_path_in_call.rast b/crates/parser/test_data/parser/ok/0034_crate_path_in_call.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0034_crate_path_in_call.rast rename to crates/parser/test_data/parser/ok/0034_crate_path_in_call.rast diff --git a/crates/syntax/test_data/parser/ok/0034_crate_path_in_call.rs b/crates/parser/test_data/parser/ok/0034_crate_path_in_call.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0034_crate_path_in_call.rs rename to crates/parser/test_data/parser/ok/0034_crate_path_in_call.rs diff --git a/crates/parser/test_data/parser/ok/0034_crate_path_in_call.txt b/crates/parser/test_data/parser/ok/0034_crate_path_in_call.txt new file mode 100644 index 0000000000..2b3b86ebf2 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0034_crate_path_in_call.txt @@ -0,0 +1,43 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "make_query" + ARG_LIST + L_PAREN "(" + PATH_EXPR + PATH + PATH + PATH + PATH_SEGMENT + NAME_REF + CRATE_KW "crate" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "module_map" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "module_tree" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0035_weird_exprs.rast b/crates/parser/test_data/parser/ok/0035_weird_exprs.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0035_weird_exprs.rast rename to crates/parser/test_data/parser/ok/0035_weird_exprs.rast diff --git a/crates/syntax/test_data/parser/ok/0035_weird_exprs.rs b/crates/parser/test_data/parser/ok/0035_weird_exprs.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0035_weird_exprs.rs rename to crates/parser/test_data/parser/ok/0035_weird_exprs.rs diff --git a/crates/parser/test_data/parser/ok/0035_weird_exprs.txt b/crates/parser/test_data/parser/ok/0035_weird_exprs.txt new file mode 100644 index 0000000000..5f62748c47 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0035_weird_exprs.txt @@ -0,0 +1,2337 @@ +SOURCE_FILE + COMMENT "//! Adapted from a `rustc` test, which can be found at " + WHITESPACE "\n" + COMMENT "//! https://github.com/rust-lang/rust/blob/6d34ec18c7d7e574553f6347ecf08e1e1c45c13d/src/test/run-pass/weird-exprs.rs." + WHITESPACE "\n" + COMMENT "//! " + WHITESPACE "\n" + COMMENT "//! Reported to rust-analyzer in https://github.com/rust-analyzer/rust-analyzer/issues/290" + WHITESPACE "\n\n" + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "allow" + TOKEN_TREE + L_PAREN "(" + IDENT "non_camel_case_types" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n" + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "allow" + TOKEN_TREE + L_PAREN "(" + IDENT "dead_code" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n" + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "allow" + TOKEN_TREE + L_PAREN "(" + IDENT "unreachable_code" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n" + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "allow" + TOKEN_TREE + L_PAREN "(" + IDENT "unused_parens" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n\n" + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "recursion_limit" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + STRING "\"128\"" + R_BRACK "]" + WHITESPACE "\n\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "std" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "cell" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Cell" + SEMICOLON ";" + WHITESPACE "\n" + USE + USE_KW "use" + WHITESPACE " " + USE_TREE + PATH + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "std" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "mem" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "swap" + SEMICOLON ";" + WHITESPACE "\n\n" + COMMENT "// Just a grab bag of stuff that you wouldn't want to actually write." + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "strange" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "bool" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "_x" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "bool" + WHITESPACE " " + EQ "=" + WHITESPACE " " + RETURN_EXPR + RETURN_KW "return" + WHITESPACE " " + LITERAL + TRUE_KW "true" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "funny" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "_x" + COLON ":" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "f" + ARG_LIST + L_PAREN "(" + RETURN_EXPR + RETURN_KW "return" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "what" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "the" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + REF_TYPE + AMP "&" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Cell" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "bool" + R_ANGLE ">" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + RETURN_EXPR + RETURN_KW "return" + WHITESPACE " " + WHILE_EXPR + WHILE_KW "while" + WHITESPACE " " + CONDITION + PREFIX_EXPR + BANG "!" + METHOD_CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + DOT "." + NAME_REF + IDENT "get" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + METHOD_CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + DOT "." + NAME_REF + IDENT "set" + ARG_LIST + L_PAREN "(" + LITERAL + TRUE_KW "true" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "i" + WHITESPACE " " + EQ "=" + WHITESPACE " " + REF_EXPR + AMP "&" + CALL_EXPR + PATH_EXPR + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "Cell" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "new" + ARG_LIST + L_PAREN "(" + LITERAL + FALSE_KW "false" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "dont" + WHITESPACE " " + EQ "=" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + CLOSURE_EXPR + PARAM_LIST + PIPE "|" + PIPE "|" + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "the" + ARG_LIST + L_PAREN "(" + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "i" + R_PAREN ")" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "dont" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "assert" + BANG "!" + TOKEN_TREE + L_PAREN "(" + TOKEN_TREE + L_PAREN "(" + IDENT "i" + DOT "." + IDENT "get" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "zombiejesus" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LOOP_EXPR + LOOP_KW "loop" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + WHILE_EXPR + WHILE_KW "while" + WHITESPACE " " + CONDITION + PAREN_EXPR + L_PAREN "(" + RETURN_EXPR + RETURN_KW "return" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + PAREN_EXPR + L_PAREN "(" + RETURN_EXPR + RETURN_KW "return" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + PAREN_EXPR + L_PAREN "(" + RETURN_EXPR + RETURN_KW "return" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + LITERAL_PAT + LITERAL + INT_NUMBER "1" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + PAREN_EXPR + L_PAREN "(" + RETURN_EXPR + RETURN_KW "return" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + RETURN_EXPR + RETURN_KW "return" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE " " + ELSE_KW "else" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + RETURN_EXPR + RETURN_KW "return" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + RETURN_EXPR + RETURN_KW "return" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE " " + ELSE_KW "else" + WHITESPACE " " + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + PAREN_EXPR + L_PAREN "(" + RETURN_EXPR + RETURN_KW "return" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + RETURN_EXPR + RETURN_KW "return" + SEMICOLON ";" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n " + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + PAREN_EXPR + L_PAREN "(" + RETURN_EXPR + RETURN_KW "return" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + BREAK_EXPR + BREAK_KW "break" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "notsure" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + MUT_KW "mut" + WHITESPACE " " + NAME + IDENT "_x" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "isize" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + MUT_KW "mut" + WHITESPACE " " + NAME + IDENT "_y" + WHITESPACE " " + EQ "=" + WHITESPACE " " + BIN_EXPR + PAREN_EXPR + L_PAREN "(" + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "_x" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "0" + R_PAREN ")" + WHITESPACE " " + EQ2 "==" + WHITESPACE " " + PAREN_EXPR + L_PAREN "(" + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "_x" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "0" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + MUT_KW "mut" + WHITESPACE " " + NAME + IDENT "_z" + WHITESPACE " " + EQ "=" + WHITESPACE " " + BIN_EXPR + PAREN_EXPR + L_PAREN "(" + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "_x" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "0" + R_PAREN ")" + WHITESPACE " " + L_ANGLE "<" + WHITESPACE " " + PAREN_EXPR + L_PAREN "(" + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "_x" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "0" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "_a" + WHITESPACE " " + EQ "=" + WHITESPACE " " + BIN_EXPR + PAREN_EXPR + L_PAREN "(" + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "_x" + WHITESPACE " " + PLUSEQ "+=" + WHITESPACE " " + LITERAL + INT_NUMBER "0" + R_PAREN ")" + WHITESPACE " " + EQ2 "==" + WHITESPACE " " + PAREN_EXPR + L_PAREN "(" + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "_x" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "0" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "_b" + WHITESPACE " " + EQ "=" + WHITESPACE " " + BIN_EXPR + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "swap" + ARG_LIST + L_PAREN "(" + REF_EXPR + AMP "&" + MUT_KW "mut" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "_y" + COMMA "," + WHITESPACE " " + REF_EXPR + AMP "&" + MUT_KW "mut" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "_z" + R_PAREN ")" + WHITESPACE " " + EQ2 "==" + WHITESPACE " " + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "swap" + ARG_LIST + L_PAREN "(" + REF_EXPR + AMP "&" + MUT_KW "mut" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "_y" + COMMA "," + WHITESPACE " " + REF_EXPR + AMP "&" + MUT_KW "mut" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "_z" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "canttouchthis" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "usize" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "p" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "bool" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LITERAL + TRUE_KW "true" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "_a" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PAREN_EXPR + L_PAREN "(" + BIN_EXPR + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "assert" + BANG "!" + TOKEN_TREE + L_PAREN "(" + TOKEN_TREE + L_PAREN "(" + TRUE_KW "true" + R_PAREN ")" + R_PAREN ")" + WHITESPACE " " + EQ2 "==" + WHITESPACE " " + PAREN_EXPR + L_PAREN "(" + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "assert" + BANG "!" + TOKEN_TREE + L_PAREN "(" + IDENT "p" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + R_PAREN ")" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "_c" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PAREN_EXPR + L_PAREN "(" + BIN_EXPR + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "assert" + BANG "!" + TOKEN_TREE + L_PAREN "(" + TOKEN_TREE + L_PAREN "(" + IDENT "p" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + R_PAREN ")" + WHITESPACE " " + EQ2 "==" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "_b" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "bool" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PAREN_EXPR + L_PAREN "(" + BIN_EXPR + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "println" + BANG "!" + TOKEN_TREE + L_PAREN "(" + STRING "\"{}\"" + COMMA "," + WHITESPACE " " + INT_NUMBER "0" + R_PAREN ")" + WHITESPACE " " + EQ2 "==" + WHITESPACE " " + PAREN_EXPR + L_PAREN "(" + RETURN_EXPR + RETURN_KW "return" + WHITESPACE " " + LITERAL + INT_NUMBER "0" + R_PAREN ")" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "angrydome" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + LOOP_EXPR + LOOP_KW "loop" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + BREAK_EXPR + BREAK_KW "break" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + MUT_KW "mut" + WHITESPACE " " + NAME + IDENT "i" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "0" + SEMICOLON ";" + WHITESPACE "\n " + LOOP_EXPR + LOOP_KW "loop" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "i" + WHITESPACE " " + PLUSEQ "+=" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE " " + EXPR_STMT + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "i" + WHITESPACE " " + EQ2 "==" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + PAREN_EXPR + L_PAREN "(" + CONTINUE_EXPR + CONTINUE_KW "continue" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE " " + MATCH_ARM + LITERAL_PAT + LITERAL + INT_NUMBER "1" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + R_CURLY "}" + COMMA "," + WHITESPACE " " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "panic" + BANG "!" + TOKEN_TREE + L_PAREN "(" + STRING "\"wat\"" + R_PAREN ")" + WHITESPACE " " + R_CURLY "}" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n " + EXPR_STMT + BREAK_EXPR + BREAK_KW "break" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "evil_lincoln" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "_evil" + WHITESPACE " " + EQ "=" + WHITESPACE " " + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "println" + BANG "!" + TOKEN_TREE + L_PAREN "(" + STRING "\"lincoln\"" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "dots" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "assert_eq" + BANG "!" + TOKEN_TREE + L_PAREN "(" + IDENT "String" + COLON ":" + COLON ":" + IDENT "from" + TOKEN_TREE + L_PAREN "(" + STRING "\"..................................................\"" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + IDENT "format" + BANG "!" + TOKEN_TREE + L_PAREN "(" + STRING "\"{:?}\"" + COMMA "," + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE "\n " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + WHITESPACE " " + DOT "." + DOT "." + R_PAREN ")" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "u8" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "u8" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + WHITESPACE " " + NEQ "!=" + WHITESPACE " " + LITERAL + INT_NUMBER "0u8" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "assert_eq" + BANG "!" + TOKEN_TREE + L_PAREN "(" + INT_NUMBER "8u8" + COMMA "," + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + WHITESPACE "\n " + IDENT "macro_rules" + BANG "!" + WHITESPACE " " + IDENT "u8" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + WHITESPACE "\n " + TOKEN_TREE + L_PAREN "(" + IDENT "u8" + R_PAREN ")" + WHITESPACE " " + EQ "=" + R_ANGLE ">" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + WHITESPACE "\n " + MOD_KW "mod" + WHITESPACE " " + IDENT "u8" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + WHITESPACE "\n " + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + IDENT "u8" + L_ANGLE "<" + LIFETIME_IDENT "'u8" + COLON ":" + WHITESPACE " " + LIFETIME_IDENT "'u8" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + LIFETIME_IDENT "'u8" + R_ANGLE ">" + TOKEN_TREE + L_PAREN "(" + IDENT "u8" + COLON ":" + WHITESPACE " " + AMP "&" + LIFETIME_IDENT "'u8" + WHITESPACE " " + IDENT "u8" + R_PAREN ")" + WHITESPACE " " + MINUS "-" + R_ANGLE ">" + WHITESPACE " " + AMP "&" + LIFETIME_IDENT "'u8" + WHITESPACE " " + IDENT "u8" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + WHITESPACE "\n " + STRING "\"u8\"" + SEMICOLON ";" + WHITESPACE "\n " + IDENT "u8" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n\n " + IDENT "u8" + BANG "!" + TOKEN_TREE + L_PAREN "(" + IDENT "u8" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + LET_KW "let" + WHITESPACE " " + AMP "&" + IDENT "u8" + COLON ":" + WHITESPACE " " + AMP "&" + IDENT "u8" + WHITESPACE " " + EQ "=" + WHITESPACE " " + IDENT "u8" + COLON ":" + COLON ":" + IDENT "u8" + TOKEN_TREE + L_PAREN "(" + AMP "&" + INT_NUMBER "8u8" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + CRATE_KW "crate" + COLON ":" + COLON ":" + IDENT "u8" + TOKEN_TREE + L_PAREN "(" + INT_NUMBER "0u8" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + IDENT "u8" + WHITESPACE "\n " + R_CURLY "}" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "fishy" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "assert_eq" + BANG "!" + TOKEN_TREE + L_PAREN "(" + IDENT "String" + COLON ":" + COLON ":" + IDENT "from" + TOKEN_TREE + L_PAREN "(" + STRING "\"><>\"" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + IDENT "String" + COLON ":" + COLON ":" + L_ANGLE "<" + R_ANGLE ">" + COLON ":" + COLON ":" + IDENT "from" + COLON ":" + COLON ":" + L_ANGLE "<" + R_ANGLE ">" + TOKEN_TREE + L_PAREN "(" + STRING "\"><>\"" + R_PAREN ")" + DOT "." + IDENT "chars" + COLON ":" + COLON ":" + L_ANGLE "<" + R_ANGLE ">" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + DOT "." + IDENT "rev" + COLON ":" + COLON ":" + L_ANGLE "<" + R_ANGLE ">" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + DOT "." + IDENT "collect" + COLON ":" + COLON ":" + L_ANGLE "<" + IDENT "String" + R_ANGLE ">" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "union" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + UNION + UNION_KW "union" + WHITESPACE " " + NAME + IDENT "union" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'union" + R_ANGLE ">" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_FIELD + NAME + IDENT "union" + COLON ":" + WHITESPACE " " + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'union" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "union" + GENERIC_ARG_LIST + L_ANGLE "<" + LIFETIME_ARG + LIFETIME + LIFETIME_IDENT "'union" + R_ANGLE ">" + COMMA "," + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "special_characters" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "val" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PREFIX_EXPR + BANG "!" + PAREN_EXPR + L_PAREN "(" + BIN_EXPR + CALL_EXPR + PAREN_EXPR + L_PAREN "(" + CLOSURE_EXPR + PARAM_LIST + PIPE "|" + PARAM + TUPLE_PAT + L_PAREN "(" + REST_PAT + DOT2 ".." + R_PAREN ")" + COLON ":" + TUPLE_TYPE + L_PAREN "(" + INFER_TYPE + UNDERSCORE "_" + COMMA "," + INFER_TYPE + UNDERSCORE "_" + R_PAREN ")" + COMMA "," + PARAM + IDENT_PAT + NAME + IDENT "__" + AT "@" + WILDCARD_PAT + UNDERSCORE "_" + PIPE "|" + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "__" + R_PAREN ")" + ARG_LIST + L_PAREN "(" + TUPLE_EXPR + L_PAREN "(" + REF_EXPR + AMP "&" + PREFIX_EXPR + STAR "*" + LITERAL + STRING "\"\\\\\"" + COMMA "," + LITERAL + CHAR "'🤔'" + R_PAREN ")" + COMMENT "/**/" + COMMA "," + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + R_PAREN ")" + EQ2 "==" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + EXPR_STMT + REF_EXPR + AMP "&" + INDEX_EXPR + ARRAY_EXPR + L_BRACK "[" + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + R_BRACK "]" + L_BRACK "[" + RANGE_EXPR + DOT2 ".." + R_BRACK "]" + SEMICOLON ";" + R_CURLY "}" + R_PAREN ")" + COMMENT "//" + WHITESPACE "\n " + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "assert" + BANG "!" + TOKEN_TREE + L_PAREN "(" + BANG "!" + IDENT "val" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "punch_card" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + IMPL_TRAIT_TYPE + IMPL_KW "impl" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "std" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "fmt" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Debug" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE "\n " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE "\n " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE "\n " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE "\n " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE "\n " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE "\n " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2EQ "..=" + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "ktulhu" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + SEMICOLON ";" + SEMICOLON ";" + SEMICOLON ";" + EXPR_STMT + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + SEMICOLON ";" + SEMICOLON ";" + SEMICOLON ";" + SEMICOLON ";" + SEMICOLON ";" + SEMICOLON ";" + SEMICOLON ";" + SEMICOLON ";" + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "strange" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "funny" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "what" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "zombiejesus" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "notsure" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "canttouchthis" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "angrydome" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "evil_lincoln" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "dots" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + ARG_LIST + L_PAREN "(" + LITERAL + INT_NUMBER "8u8" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "fishy" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "union" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "special_characters" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "punch_card" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "ktulhu" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0036_fully_qualified.rast b/crates/parser/test_data/parser/ok/0036_fully_qualified.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0036_fully_qualified.rast rename to crates/parser/test_data/parser/ok/0036_fully_qualified.rast diff --git a/crates/syntax/test_data/parser/ok/0036_fully_qualified.rs b/crates/parser/test_data/parser/ok/0036_fully_qualified.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0036_fully_qualified.rs rename to crates/parser/test_data/parser/ok/0036_fully_qualified.rs diff --git a/crates/parser/test_data/parser/ok/0036_fully_qualified.txt b/crates/parser/test_data/parser/ok/0036_fully_qualified.txt new file mode 100644 index 0000000000..6137b38aba --- /dev/null +++ b/crates/parser/test_data/parser/ok/0036_fully_qualified.txt @@ -0,0 +1,93 @@ +SOURCE_FILE + COMMENT "// https://github.com/rust-analyzer/rust-analyzer/issues/311" + WHITESPACE "\n\n" + FN + VISIBILITY + PUB_KW "pub" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "S" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Iterator" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "String" + WHITESPACE "\n" + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE "\n " + WHERE_PRED + PATH_TYPE + PATH + PATH + PATH_SEGMENT + L_ANGLE "<" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Iterator" + R_ANGLE ">" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Item" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Eq" + COMMA "," + WHITESPACE "\n" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + METHOD_CALL_EXPR + LITERAL + STRING "\"\"" + DOT "." + NAME_REF + IDENT "to_owned" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0037_mod.rast b/crates/parser/test_data/parser/ok/0037_mod.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0037_mod.rast rename to crates/parser/test_data/parser/ok/0037_mod.rast diff --git a/crates/syntax/test_data/parser/ok/0037_mod.rs b/crates/parser/test_data/parser/ok/0037_mod.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0037_mod.rs rename to crates/parser/test_data/parser/ok/0037_mod.rs diff --git a/crates/parser/test_data/parser/ok/0037_mod.txt b/crates/parser/test_data/parser/ok/0037_mod.txt new file mode 100644 index 0000000000..fb6565f3a4 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0037_mod.txt @@ -0,0 +1,16 @@ +SOURCE_FILE + COMMENT "// https://github.com/rust-analyzer/rust-analyzer/issues/357" + WHITESPACE "\n\n" + COMMENT "//! docs" + WHITESPACE "\n" + MODULE + COMMENT "// non-docs" + WHITESPACE "\n" + MOD_KW "mod" + WHITESPACE " " + NAME + IDENT "foo" + WHITESPACE " " + ITEM_LIST + L_CURLY "{" + R_CURLY "}" diff --git a/crates/syntax/test_data/parser/ok/0038_where_pred_type.rast b/crates/parser/test_data/parser/ok/0038_where_pred_type.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0038_where_pred_type.rast rename to crates/parser/test_data/parser/ok/0038_where_pred_type.rast diff --git a/crates/syntax/test_data/parser/ok/0038_where_pred_type.rs b/crates/parser/test_data/parser/ok/0038_where_pred_type.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0038_where_pred_type.rs rename to crates/parser/test_data/parser/ok/0038_where_pred_type.rs diff --git a/crates/parser/test_data/parser/ok/0038_where_pred_type.txt b/crates/parser/test_data/parser/ok/0038_where_pred_type.txt new file mode 100644 index 0000000000..e897630420 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0038_where_pred_type.txt @@ -0,0 +1,43 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "test" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE " " + WHERE_PRED + TUPLE_TYPE + L_PAREN "(" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u64" + COMMA "," + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u64" + R_PAREN ")" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" diff --git a/crates/syntax/test_data/parser/ok/0039_raw_fn_item.rast b/crates/parser/test_data/parser/ok/0039_raw_fn_item.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0039_raw_fn_item.rast rename to crates/parser/test_data/parser/ok/0039_raw_fn_item.rast diff --git a/crates/syntax/test_data/parser/ok/0039_raw_fn_item.rs b/crates/parser/test_data/parser/ok/0039_raw_fn_item.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0039_raw_fn_item.rs rename to crates/parser/test_data/parser/ok/0039_raw_fn_item.rs diff --git a/crates/parser/test_data/parser/ok/0039_raw_fn_item.txt b/crates/parser/test_data/parser/ok/0039_raw_fn_item.txt new file mode 100644 index 0000000000..2eeed781c1 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0039_raw_fn_item.txt @@ -0,0 +1,16 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "r#foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0040_raw_struct_item_field.rast b/crates/parser/test_data/parser/ok/0040_raw_struct_item_field.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0040_raw_struct_item_field.rast rename to crates/parser/test_data/parser/ok/0040_raw_struct_item_field.rast diff --git a/crates/syntax/test_data/parser/ok/0040_raw_struct_item_field.rs b/crates/parser/test_data/parser/ok/0040_raw_struct_item_field.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0040_raw_struct_item_field.rs rename to crates/parser/test_data/parser/ok/0040_raw_struct_item_field.rs diff --git a/crates/parser/test_data/parser/ok/0040_raw_struct_item_field.txt b/crates/parser/test_data/parser/ok/0040_raw_struct_item_field.txt new file mode 100644 index 0000000000..ceb918420f --- /dev/null +++ b/crates/parser/test_data/parser/ok/0040_raw_struct_item_field.txt @@ -0,0 +1,22 @@ +SOURCE_FILE + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "S" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE "\n " + RECORD_FIELD + NAME + IDENT "r#foo" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + WHITESPACE "\n" + R_CURLY "}" diff --git a/crates/syntax/test_data/parser/ok/0041_raw_keywords.rast b/crates/parser/test_data/parser/ok/0041_raw_keywords.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0041_raw_keywords.rast rename to crates/parser/test_data/parser/ok/0041_raw_keywords.rast diff --git a/crates/syntax/test_data/parser/ok/0041_raw_keywords.rs b/crates/parser/test_data/parser/ok/0041_raw_keywords.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0041_raw_keywords.rs rename to crates/parser/test_data/parser/ok/0041_raw_keywords.rs diff --git a/crates/parser/test_data/parser/ok/0041_raw_keywords.txt b/crates/parser/test_data/parser/ok/0041_raw_keywords.txt new file mode 100644 index 0000000000..dacf0ce742 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0041_raw_keywords.txt @@ -0,0 +1,50 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "r#struct" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "92" + SEMICOLON ";" + WHITESPACE " " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "r#trait" + WHITESPACE " " + EQ "=" + WHITESPACE " " + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "r#struct" + WHITESPACE " " + STAR "*" + WHITESPACE " " + LITERAL + INT_NUMBER "2" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" diff --git a/crates/syntax/test_data/parser/ok/0042_ufcs_call_list.rast b/crates/parser/test_data/parser/ok/0042_ufcs_call_list.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0042_ufcs_call_list.rast rename to crates/parser/test_data/parser/ok/0042_ufcs_call_list.rast diff --git a/crates/syntax/test_data/parser/ok/0042_ufcs_call_list.rs b/crates/parser/test_data/parser/ok/0042_ufcs_call_list.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0042_ufcs_call_list.rs rename to crates/parser/test_data/parser/ok/0042_ufcs_call_list.rs diff --git a/crates/parser/test_data/parser/ok/0042_ufcs_call_list.txt b/crates/parser/test_data/parser/ok/0042_ufcs_call_list.txt new file mode 100644 index 0000000000..ff2121a58a --- /dev/null +++ b/crates/parser/test_data/parser/ok/0042_ufcs_call_list.txt @@ -0,0 +1,126 @@ +SOURCE_FILE + COMMENT "// https://github.com/rust-analyzer/rust-analyzer/issues/596" + WHITESPACE "\n\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "Foo" + SEMICOLON ";" + WHITESPACE "\n\n" + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "bar" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "bool" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "unimplemented" + BANG "!" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "baz" + PARAM_LIST + L_PAREN "(" + PARAM + WILDCARD_PAT + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "bool" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "baz" + ARG_LIST + L_PAREN "(" + CALL_EXPR + PATH_EXPR + PATH + PATH + PATH_SEGMENT + L_ANGLE "<" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + R_ANGLE ">" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "bar" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0043_complex_assignment.rast b/crates/parser/test_data/parser/ok/0043_complex_assignment.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0043_complex_assignment.rast rename to crates/parser/test_data/parser/ok/0043_complex_assignment.rast diff --git a/crates/syntax/test_data/parser/ok/0043_complex_assignment.rs b/crates/parser/test_data/parser/ok/0043_complex_assignment.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0043_complex_assignment.rs rename to crates/parser/test_data/parser/ok/0043_complex_assignment.rs diff --git a/crates/parser/test_data/parser/ok/0043_complex_assignment.txt b/crates/parser/test_data/parser/ok/0043_complex_assignment.txt new file mode 100644 index 0000000000..f9e5a51ae2 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0043_complex_assignment.txt @@ -0,0 +1,110 @@ +SOURCE_FILE + COMMENT "// https://github.com/rust-analyzer/rust-analyzer/issues/674" + WHITESPACE "\n\n" + STRUCT + STRUCT_KW "struct" + WHITESPACE " " + NAME + IDENT "Repr" + WHITESPACE " " + RECORD_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_FIELD + NAME + IDENT "raw" + COLON ":" + WHITESPACE " " + ARRAY_TYPE + L_BRACK "[" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + SEMICOLON ";" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + R_BRACK "]" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "abc" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + INDEX_EXPR + FIELD_EXPR + RECORD_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Repr" + WHITESPACE " " + RECORD_EXPR_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_EXPR_FIELD + NAME_REF + IDENT "raw" + COLON ":" + WHITESPACE " " + ARRAY_EXPR + L_BRACK "[" + LITERAL + INT_NUMBER "0" + R_BRACK "]" + WHITESPACE " " + R_CURLY "}" + DOT "." + NAME_REF + IDENT "raw" + L_BRACK "[" + LITERAL + INT_NUMBER "0" + R_BRACK "]" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "0" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + RECORD_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Repr" + RECORD_EXPR_FIELD_LIST + L_CURLY "{" + RECORD_EXPR_FIELD + NAME_REF + IDENT "raw" + COLON ":" + ARRAY_EXPR + L_BRACK "[" + LITERAL + INT_NUMBER "0" + R_BRACK "]" + R_CURLY "}" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0044_let_attrs.rast b/crates/parser/test_data/parser/ok/0044_let_attrs.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0044_let_attrs.rast rename to crates/parser/test_data/parser/ok/0044_let_attrs.rast diff --git a/crates/syntax/test_data/parser/ok/0044_let_attrs.rs b/crates/parser/test_data/parser/ok/0044_let_attrs.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0044_let_attrs.rs rename to crates/parser/test_data/parser/ok/0044_let_attrs.rs diff --git a/crates/parser/test_data/parser/ok/0044_let_attrs.txt b/crates/parser/test_data/parser/ok/0044_let_attrs.txt new file mode 100644 index 0000000000..6c637bac42 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0044_let_attrs.txt @@ -0,0 +1,77 @@ +SOURCE_FILE + FN + COMMENT "// https://github.com/rust-analyzer/rust-analyzer/issues/677" + WHITESPACE "\n" + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "cfg" + TOKEN_TREE + L_PAREN "(" + IDENT "feature" + WHITESPACE " " + EQ "=" + WHITESPACE " " + STRING "\"backtrace\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "exit_code" + WHITESPACE " " + EQ "=" + WHITESPACE " " + CALL_EXPR + PATH_EXPR + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "panic" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "catch_unwind" + ARG_LIST + L_PAREN "(" + CLOSURE_EXPR + MOVE_KW "move" + WHITESPACE " " + PARAM_LIST + PIPE "|" + PIPE "|" + WHITESPACE " " + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "main" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0045_block_attrs.rast b/crates/parser/test_data/parser/ok/0045_block_attrs.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0045_block_attrs.rast rename to crates/parser/test_data/parser/ok/0045_block_attrs.rast diff --git a/crates/syntax/test_data/parser/ok/0045_block_attrs.rs b/crates/parser/test_data/parser/ok/0045_block_attrs.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0045_block_attrs.rs rename to crates/parser/test_data/parser/ok/0045_block_attrs.rs diff --git a/crates/parser/test_data/parser/ok/0045_block_attrs.txt b/crates/parser/test_data/parser/ok/0045_block_attrs.txt new file mode 100644 index 0000000000..6b6f3bfe3e --- /dev/null +++ b/crates/parser/test_data/parser/ok/0045_block_attrs.txt @@ -0,0 +1,230 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "inner" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "doc" + TOKEN_TREE + L_PAREN "(" + STRING "\"Inner attributes allowed here\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + COMMENT "//! As are ModuleDoc style comments" + WHITESPACE "\n " + EXPR_STMT + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "doc" + TOKEN_TREE + L_PAREN "(" + STRING "\"Inner attributes are allowed in blocks used as statements\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "doc" + TOKEN_TREE + L_PAREN "(" + STRING "\"Being validated is not affected by duplcates\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + COMMENT "//! As are ModuleDoc style comments" + WHITESPACE "\n " + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "doc" + TOKEN_TREE + L_PAREN "(" + STRING "\"Inner attributes are allowed in blocks when they are the last statement of another block\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n " + COMMENT "//! As are ModuleDoc style comments" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "outer" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + EQ "=" + WHITESPACE " " + BLOCK_EXPR + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "doc" + TOKEN_TREE + L_PAREN "(" + STRING "\"Outer attributes are always allowed\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + IMPL + COMMENT "// https://github.com/rust-analyzer/rust-analyzer/issues/689" + WHITESPACE "\n" + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Whatever" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "salsa_event" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + AMP "&" + NAME + SELF_KW "self" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + NAME + IDENT "event_fn" + COLON ":" + WHITESPACE " " + IMPL_TRAIT_TYPE + IMPL_KW "impl" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Fn" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Event" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Self" + R_ANGLE ">" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "allow" + TOKEN_TREE + L_PAREN "(" + IDENT "unused_variables" + R_PAREN ")" + R_BRACK "]" + WHITESPACE " " + COMMENT "// this is `inner_attr` of the block" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0046_extern_inner_attributes.rast b/crates/parser/test_data/parser/ok/0046_extern_inner_attributes.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0046_extern_inner_attributes.rast rename to crates/parser/test_data/parser/ok/0046_extern_inner_attributes.rast diff --git a/crates/syntax/test_data/parser/ok/0046_extern_inner_attributes.rs b/crates/parser/test_data/parser/ok/0046_extern_inner_attributes.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0046_extern_inner_attributes.rs rename to crates/parser/test_data/parser/ok/0046_extern_inner_attributes.rs diff --git a/crates/parser/test_data/parser/ok/0046_extern_inner_attributes.txt b/crates/parser/test_data/parser/ok/0046_extern_inner_attributes.txt new file mode 100644 index 0000000000..4eb51cfdf0 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0046_extern_inner_attributes.txt @@ -0,0 +1,29 @@ +SOURCE_FILE + EXTERN_BLOCK + ABI + EXTERN_KW "extern" + WHITESPACE " " + STRING "\"C\"" + WHITESPACE " " + EXTERN_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + COMMENT "//! This is a doc comment" + WHITESPACE "\n " + ATTR + POUND "#" + BANG "!" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "doc" + TOKEN_TREE + L_PAREN "(" + STRING "\"This is also a doc comment\"" + R_PAREN ")" + R_BRACK "]" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast b/crates/parser/test_data/parser/ok/0047_minus_in_inner_pattern.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast rename to crates/parser/test_data/parser/ok/0047_minus_in_inner_pattern.rast diff --git a/crates/syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rs b/crates/parser/test_data/parser/ok/0047_minus_in_inner_pattern.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rs rename to crates/parser/test_data/parser/ok/0047_minus_in_inner_pattern.rs diff --git a/crates/parser/test_data/parser/ok/0047_minus_in_inner_pattern.txt b/crates/parser/test_data/parser/ok/0047_minus_in_inner_pattern.txt new file mode 100644 index 0000000000..ac23e7d1d9 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0047_minus_in_inner_pattern.txt @@ -0,0 +1,323 @@ +SOURCE_FILE + COMMENT "// https://github.com/rust-analyzer/rust-analyzer/issues/972" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + ARG_LIST + L_PAREN "(" + PREFIX_EXPR + MINUS "-" + LITERAL + INT_NUMBER "1" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + L_PAREN "(" + LITERAL_PAT + MINUS "-" + LITERAL + INT_NUMBER "1" + R_PAREN ")" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + ARG_LIST + L_PAREN "(" + TUPLE_EXPR + L_PAREN "(" + PREFIX_EXPR + MINUS "-" + LITERAL + INT_NUMBER "1" + COMMA "," + WHITESPACE " " + PREFIX_EXPR + MINUS "-" + LITERAL + INT_NUMBER "1" + R_PAREN ")" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + L_PAREN "(" + TUPLE_PAT + L_PAREN "(" + LITERAL_PAT + MINUS "-" + LITERAL + INT_NUMBER "1" + COMMA "," + WHITESPACE " " + LITERAL_PAT + MINUS "-" + LITERAL + INT_NUMBER "1" + R_PAREN ")" + R_PAREN ")" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n\n " + EXPR_STMT + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + CALL_EXPR + PATH_EXPR + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "A" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "B" + ARG_LIST + L_PAREN "(" + PREFIX_EXPR + MINUS "-" + LITERAL + INT_NUMBER "1" + COMMA "," + WHITESPACE " " + PREFIX_EXPR + MINUS "-" + LITERAL + INT_NUMBER "1" + R_PAREN ")" + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_ARM + TUPLE_STRUCT_PAT + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "A" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "B" + L_PAREN "(" + LITERAL_PAT + MINUS "-" + LITERAL + INT_NUMBER "1" + COMMA "," + WHITESPACE " " + LITERAL_PAT + MINUS "-" + LITERAL + INT_NUMBER "1" + R_PAREN ")" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + MATCH_ARM + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + FAT_ARROW "=>" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n\n " + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + LET_KW "let" + WHITESPACE " " + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + L_PAREN "(" + LITERAL_PAT + MINUS "-" + LITERAL + INT_NUMBER "1" + R_PAREN ")" + WHITESPACE " " + EQ "=" + WHITESPACE " " + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + ARG_LIST + L_PAREN "(" + PREFIX_EXPR + MINUS "-" + LITERAL + INT_NUMBER "1" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + ENUM + ENUM_KW "enum" + WHITESPACE " " + NAME + IDENT "A" + WHITESPACE " " + VARIANT_LIST + L_CURLY "{" + WHITESPACE "\n " + VARIANT + NAME + IDENT "B" + TUPLE_FIELD_LIST + L_PAREN "(" + TUPLE_FIELD + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i8" + COMMA "," + WHITESPACE " " + TUPLE_FIELD + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i8" + R_PAREN ")" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + PARAM + RANGE_PAT + LITERAL_PAT + MINUS "-" + LITERAL + INT_NUMBER "128" + DOT2EQ "..=" + LITERAL_PAT + LITERAL + INT_NUMBER "127" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i8" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0048_compound_assignment.rast b/crates/parser/test_data/parser/ok/0048_compound_assignment.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0048_compound_assignment.rast rename to crates/parser/test_data/parser/ok/0048_compound_assignment.rast diff --git a/crates/syntax/test_data/parser/ok/0048_compound_assignment.rs b/crates/parser/test_data/parser/ok/0048_compound_assignment.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0048_compound_assignment.rs rename to crates/parser/test_data/parser/ok/0048_compound_assignment.rs diff --git a/crates/parser/test_data/parser/ok/0048_compound_assignment.txt b/crates/parser/test_data/parser/ok/0048_compound_assignment.txt new file mode 100644 index 0000000000..eca5e7aa81 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0048_compound_assignment.txt @@ -0,0 +1,201 @@ +SOURCE_FILE + COMMENT "// https://github.com/rust-analyzer/rust-analyzer/pull/983" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "compound_assignment" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + MUT_KW "mut" + WHITESPACE " " + NAME + IDENT "a" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "0" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + WHITESPACE " " + PLUSEQ "+=" + WHITESPACE " " + LITERAL + INT_NUMBER "1" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + WHITESPACE " " + MINUSEQ "-=" + WHITESPACE " " + LITERAL + INT_NUMBER "2" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + WHITESPACE " " + STAREQ "*=" + WHITESPACE " " + LITERAL + INT_NUMBER "3" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + WHITESPACE " " + PERCENTEQ "%=" + WHITESPACE " " + LITERAL + INT_NUMBER "4" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + WHITESPACE " " + SLASHEQ "/=" + WHITESPACE " " + LITERAL + INT_NUMBER "5" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + WHITESPACE " " + PIPEEQ "|=" + WHITESPACE " " + LITERAL + INT_NUMBER "6" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + WHITESPACE " " + AMPEQ "&=" + WHITESPACE " " + LITERAL + INT_NUMBER "7" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + WHITESPACE " " + CARETEQ "^=" + WHITESPACE " " + LITERAL + INT_NUMBER "8" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + WHITESPACE " " + LTEQ "<=" + WHITESPACE " " + LITERAL + INT_NUMBER "9" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + WHITESPACE " " + GTEQ ">=" + WHITESPACE " " + LITERAL + INT_NUMBER "10" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + WHITESPACE " " + SHREQ ">>=" + WHITESPACE " " + LITERAL + INT_NUMBER "11" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + WHITESPACE " " + SHLEQ "<<=" + WHITESPACE " " + LITERAL + INT_NUMBER "12" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0049_async_block.rast b/crates/parser/test_data/parser/ok/0049_async_block.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0049_async_block.rast rename to crates/parser/test_data/parser/ok/0049_async_block.rast diff --git a/crates/syntax/test_data/parser/ok/0049_async_block.rs b/crates/parser/test_data/parser/ok/0049_async_block.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0049_async_block.rs rename to crates/parser/test_data/parser/ok/0049_async_block.rs diff --git a/crates/parser/test_data/parser/ok/0049_async_block.txt b/crates/parser/test_data/parser/ok/0049_async_block.txt new file mode 100644 index 0000000000..f376821e28 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0049_async_block.txt @@ -0,0 +1,36 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + BLOCK_EXPR + ASYNC_KW "async" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + BLOCK_EXPR + ASYNC_KW "async" + WHITESPACE " " + MOVE_KW "move" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" diff --git a/crates/syntax/test_data/parser/ok/0050_async_block_as_argument.rast b/crates/parser/test_data/parser/ok/0050_async_block_as_argument.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0050_async_block_as_argument.rast rename to crates/parser/test_data/parser/ok/0050_async_block_as_argument.rast diff --git a/crates/syntax/test_data/parser/ok/0050_async_block_as_argument.rs b/crates/parser/test_data/parser/ok/0050_async_block_as_argument.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0050_async_block_as_argument.rs rename to crates/parser/test_data/parser/ok/0050_async_block_as_argument.rs diff --git a/crates/parser/test_data/parser/ok/0050_async_block_as_argument.txt b/crates/parser/test_data/parser/ok/0050_async_block_as_argument.txt new file mode 100644 index 0000000000..53ddf35ccb --- /dev/null +++ b/crates/parser/test_data/parser/ok/0050_async_block_as_argument.txt @@ -0,0 +1,92 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + IMPL_TRAIT_TYPE + IMPL_KW "impl" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "std" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "future" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Future" + GENERIC_ARG_LIST + L_ANGLE "<" + ASSOC_TYPE_ARG + NAME_REF + IDENT "Output" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_ANGLE ">" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + ARG_LIST + L_PAREN "(" + BLOCK_EXPR + ASYNC_KW "async" + WHITESPACE " " + MOVE_KW "move" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + WHITESPACE " " + LITERAL + INT_NUMBER "12" + WHITESPACE " " + R_CURLY "}" + R_PAREN ")" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0051_parameter_attrs.rast b/crates/parser/test_data/parser/ok/0051_parameter_attrs.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0051_parameter_attrs.rast rename to crates/parser/test_data/parser/ok/0051_parameter_attrs.rast diff --git a/crates/syntax/test_data/parser/ok/0051_parameter_attrs.rs b/crates/parser/test_data/parser/ok/0051_parameter_attrs.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0051_parameter_attrs.rs rename to crates/parser/test_data/parser/ok/0051_parameter_attrs.rs diff --git a/crates/parser/test_data/parser/ok/0051_parameter_attrs.txt b/crates/parser/test_data/parser/ok/0051_parameter_attrs.txt new file mode 100644 index 0000000000..e1ebf5a38c --- /dev/null +++ b/crates/parser/test_data/parser/ok/0051_parameter_attrs.txt @@ -0,0 +1,548 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "g1" + PARAM_LIST + L_PAREN "(" + PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr1" + R_BRACK "]" + WHITESPACE " " + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr2" + R_BRACK "]" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "pat" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Type" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "g2" + PARAM_LIST + L_PAREN "(" + PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr1" + R_BRACK "]" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n\n" + EXTERN_BLOCK + ABI + EXTERN_KW "extern" + WHITESPACE " " + STRING "\"C\"" + WHITESPACE " " + EXTERN_ITEM_LIST + L_CURLY "{" + WHITESPACE " " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "printf" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "format" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + CONST_KW "const" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i8" + COMMA "," + WHITESPACE " " + PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE " " + DOT3 "..." + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "F" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "FnMut" + PARAM_LIST + L_PAREN "(" + PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE " " + REF_TYPE + AMP "&" + MUT_KW "mut" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + GENERIC_ARG_LIST + L_ANGLE "<" + LIFETIME_ARG + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + R_PAREN ")" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n\n" + TRAIT + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "Foo" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "bar" + PARAM_LIST + L_PAREN "(" + PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u64" + COMMA "," + WHITESPACE " " + PARAM + ATTR + POUND "#" + WHITESPACE " " + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE " " + IDENT_PAT + MUT_KW "mut" + WHITESPACE " " + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "must_use" + R_BRACK "]" + WHITESPACE " " + NAME + SELF_KW "self" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "g1" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE " " + NAME + SELF_KW "self" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "g2" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE " " + AMP "&" + NAME + SELF_KW "self" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "g3" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE " " + AMP "&" + MUT_KW "mut" + WHITESPACE " " + NAME + SELF_KW "self" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "g4" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE " " + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + NAME + SELF_KW "self" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "g5" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE " " + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + MUT_KW "mut" + WHITESPACE " " + NAME + SELF_KW "self" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "c" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE " " + NAME + SELF_KW "self" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Self" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "d" + PARAM_LIST + L_PAREN "(" + SELF_PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "attr" + R_BRACK "]" + WHITESPACE " " + NAME + SELF_KW "self" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Rc" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Self" + R_ANGLE ">" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" diff --git a/crates/syntax/test_data/parser/ok/0052_for_range_block.rast b/crates/parser/test_data/parser/ok/0052_for_range_block.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0052_for_range_block.rast rename to crates/parser/test_data/parser/ok/0052_for_range_block.rast diff --git a/crates/syntax/test_data/parser/ok/0052_for_range_block.rs b/crates/parser/test_data/parser/ok/0052_for_range_block.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0052_for_range_block.rs rename to crates/parser/test_data/parser/ok/0052_for_range_block.rs diff --git a/crates/parser/test_data/parser/ok/0052_for_range_block.txt b/crates/parser/test_data/parser/ok/0052_for_range_block.txt new file mode 100644 index 0000000000..0c9dd432fb --- /dev/null +++ b/crates/parser/test_data/parser/ok/0052_for_range_block.txt @@ -0,0 +1,81 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + FOR_EXPR + FOR_KW "for" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "_x" + WHITESPACE " " + IN_KW "in" + WHITESPACE " " + RANGE_EXPR + LITERAL + INT_NUMBER "0" + WHITESPACE " " + DOT2 ".." + WHITESPACE " " + METHOD_CALL_EXPR + PAREN_EXPR + L_PAREN "(" + RANGE_EXPR + LITERAL + INT_NUMBER "0" + WHITESPACE " " + DOT2 ".." + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + LITERAL + INT_NUMBER "2" + R_CURLY "}" + R_PAREN ")" + DOT "." + NAME_REF + IDENT "sum" + GENERIC_ARG_LIST + COLON2 "::" + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u32" + R_ANGLE ">" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + BREAK_EXPR + BREAK_KW "break" + SEMICOLON ";" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rast b/crates/parser/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rast rename to crates/parser/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rast diff --git a/crates/syntax/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rs b/crates/parser/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rs rename to crates/parser/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rs diff --git a/crates/parser/test_data/parser/ok/0053_outer_attribute_on_macro_rules.txt b/crates/parser/test_data/parser/ok/0053_outer_attribute_on_macro_rules.txt new file mode 100644 index 0000000000..b94d43beb3 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0053_outer_attribute_on_macro_rules.txt @@ -0,0 +1,37 @@ +SOURCE_FILE + MACRO_RULES + COMMENT "/// Some docs" + WHITESPACE "\n" + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "macro_export" + R_BRACK "]" + WHITESPACE "\n" + MACRO_RULES_KW "macro_rules" + BANG "!" + WHITESPACE " " + NAME + IDENT "foo" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + WHITESPACE "\n " + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + EQ "=" + R_ANGLE ">" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + R_CURLY "}" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast b/crates/parser/test_data/parser/ok/0054_qual_path_in_type_arg.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast rename to crates/parser/test_data/parser/ok/0054_qual_path_in_type_arg.rast diff --git a/crates/syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rs b/crates/parser/test_data/parser/ok/0054_qual_path_in_type_arg.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rs rename to crates/parser/test_data/parser/ok/0054_qual_path_in_type_arg.rs diff --git a/crates/parser/test_data/parser/ok/0054_qual_path_in_type_arg.txt b/crates/parser/test_data/parser/ok/0054_qual_path_in_type_arg.txt new file mode 100644 index 0000000000..4e1e31f376 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0054_qual_path_in_type_arg.txt @@ -0,0 +1,126 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "a" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Baz" + R_ANGLE ">" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "b" + PARAM_LIST + L_PAREN "(" + PARAM + WILDCARD_PAT + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + IMPL_TRAIT_TYPE + IMPL_KW "impl" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "FnMut" + PARAM_LIST + L_PAREN "(" + PARAM + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Y" + R_PAREN ")" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "c" + PARAM_LIST + L_PAREN "(" + PARAM + WILDCARD_PAT + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + IMPL_TRAIT_TYPE + IMPL_KW "impl" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "FnMut" + PARAM_LIST + L_PAREN "(" + PARAM + REF_TYPE + AMP "&" + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Y" + R_PAREN ")" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0055_dot_dot_dot.rast b/crates/parser/test_data/parser/ok/0055_dot_dot_dot.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0055_dot_dot_dot.rast rename to crates/parser/test_data/parser/ok/0055_dot_dot_dot.rast diff --git a/crates/syntax/test_data/parser/ok/0055_dot_dot_dot.rs b/crates/parser/test_data/parser/ok/0055_dot_dot_dot.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0055_dot_dot_dot.rs rename to crates/parser/test_data/parser/ok/0055_dot_dot_dot.rs diff --git a/crates/parser/test_data/parser/ok/0055_dot_dot_dot.txt b/crates/parser/test_data/parser/ok/0055_dot_dot_dot.txt new file mode 100644 index 0000000000..684f499df5 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0055_dot_dot_dot.txt @@ -0,0 +1,50 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "X" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + TUPLE_PAT + L_PAREN "(" + R_PAREN ")" + COLON ":" + PATH_TYPE + PATH + PATH_SEGMENT + COLON2 "::" + NAME_REF + IDENT "X" + WHITESPACE " " + EQ "=" + WHITESPACE " " + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0056_neq_in_type.rast b/crates/parser/test_data/parser/ok/0056_neq_in_type.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0056_neq_in_type.rast rename to crates/parser/test_data/parser/ok/0056_neq_in_type.rast diff --git a/crates/syntax/test_data/parser/ok/0056_neq_in_type.rs b/crates/parser/test_data/parser/ok/0056_neq_in_type.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0056_neq_in_type.rs rename to crates/parser/test_data/parser/ok/0056_neq_in_type.rs diff --git a/crates/parser/test_data/parser/ok/0056_neq_in_type.txt b/crates/parser/test_data/parser/ok/0056_neq_in_type.txt new file mode 100644 index 0000000000..2d78eaffc5 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0056_neq_in_type.txt @@ -0,0 +1,66 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + IF_EXPR + IF_KW "if" + WHITESPACE " " + CONDITION + BIN_EXPR + CAST_EXPR + METHOD_CALL_EXPR + LITERAL + FLOAT_NUMBER "1.0f32" + DOT "." + NAME_REF + IDENT "floor" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i64" + WHITESPACE " " + NEQ "!=" + WHITESPACE " " + CAST_EXPR + METHOD_CALL_EXPR + LITERAL + FLOAT_NUMBER "1.0f32" + DOT "." + NAME_REF + IDENT "floor" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i64" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0057_loop_in_call.rast b/crates/parser/test_data/parser/ok/0057_loop_in_call.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0057_loop_in_call.rast rename to crates/parser/test_data/parser/ok/0057_loop_in_call.rast diff --git a/crates/syntax/test_data/parser/ok/0057_loop_in_call.rs b/crates/parser/test_data/parser/ok/0057_loop_in_call.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0057_loop_in_call.rs rename to crates/parser/test_data/parser/ok/0057_loop_in_call.rs diff --git a/crates/parser/test_data/parser/ok/0057_loop_in_call.txt b/crates/parser/test_data/parser/ok/0057_loop_in_call.txt new file mode 100644 index 0000000000..67837e4750 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0057_loop_in_call.txt @@ -0,0 +1,59 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + ARG_LIST + L_PAREN "(" + LOOP_EXPR + LOOP_KW "loop" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" diff --git a/crates/syntax/test_data/parser/ok/0058_unary_expr_precedence.rast b/crates/parser/test_data/parser/ok/0058_unary_expr_precedence.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0058_unary_expr_precedence.rast rename to crates/parser/test_data/parser/ok/0058_unary_expr_precedence.rast diff --git a/crates/syntax/test_data/parser/ok/0058_unary_expr_precedence.rs b/crates/parser/test_data/parser/ok/0058_unary_expr_precedence.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0058_unary_expr_precedence.rs rename to crates/parser/test_data/parser/ok/0058_unary_expr_precedence.rs diff --git a/crates/parser/test_data/parser/ok/0058_unary_expr_precedence.txt b/crates/parser/test_data/parser/ok/0058_unary_expr_precedence.txt new file mode 100644 index 0000000000..683d5070ae --- /dev/null +++ b/crates/parser/test_data/parser/ok/0058_unary_expr_precedence.txt @@ -0,0 +1,97 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + BIN_EXPR + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + PREFIX_EXPR + STAR "*" + REF_EXPR + AMP "&" + LITERAL + INT_NUMBER "2" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + LITERAL + INT_NUMBER "3" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CAST_EXPR + PREFIX_EXPR + STAR "*" + REF_EXPR + AMP "&" + LITERAL + INT_NUMBER "1" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u64" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + PREFIX_EXPR + STAR "*" + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + ARG_LIST + L_PAREN "(" + LITERAL + INT_NUMBER "1" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + REF_EXPR + AMP "&" + INDEX_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" + L_BRACK "[" + LITERAL + INT_NUMBER "1" + R_BRACK "]" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + RANGE_EXPR + PREFIX_EXPR + MINUS "-" + LITERAL + INT_NUMBER "1" + DOT2 ".." + LITERAL + INT_NUMBER "2" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0059_loops_in_parens.rast b/crates/parser/test_data/parser/ok/0059_loops_in_parens.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0059_loops_in_parens.rast rename to crates/parser/test_data/parser/ok/0059_loops_in_parens.rast diff --git a/crates/syntax/test_data/parser/ok/0059_loops_in_parens.rs b/crates/parser/test_data/parser/ok/0059_loops_in_parens.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0059_loops_in_parens.rs rename to crates/parser/test_data/parser/ok/0059_loops_in_parens.rs diff --git a/crates/parser/test_data/parser/ok/0059_loops_in_parens.txt b/crates/parser/test_data/parser/ok/0059_loops_in_parens.txt new file mode 100644 index 0000000000..1eeb6c957f --- /dev/null +++ b/crates/parser/test_data/parser/ok/0059_loops_in_parens.txt @@ -0,0 +1,101 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + ARG_LIST + L_PAREN "(" + FOR_EXPR + FOR_KW "for" + WHITESPACE " " + WILDCARD_PAT + UNDERSCORE "_" + WHITESPACE " " + IN_KW "in" + WHITESPACE " " + METHOD_CALL_EXPR + ARRAY_EXPR + L_BRACK "[" + LITERAL + INT_NUMBER "1" + R_BRACK "]" + DOT "." + NAME_REF + IDENT "into_iter" + ARG_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + ARG_LIST + L_PAREN "(" + LOOP_EXPR + LOOP_KW "loop" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE " " + EXPR_STMT + BREAK_EXPR + BREAK_KW "break" + SEMICOLON ";" + WHITESPACE " " + R_CURLY "}" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + CALL_EXPR + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "Some" + ARG_LIST + L_PAREN "(" + WHILE_EXPR + WHILE_KW "while" + WHITESPACE " " + CONDITION + LITERAL + TRUE_KW "true" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0060_as_range.rast b/crates/parser/test_data/parser/ok/0060_as_range.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0060_as_range.rast rename to crates/parser/test_data/parser/ok/0060_as_range.rast diff --git a/crates/syntax/test_data/parser/ok/0060_as_range.rs b/crates/parser/test_data/parser/ok/0060_as_range.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0060_as_range.rs rename to crates/parser/test_data/parser/ok/0060_as_range.rs diff --git a/crates/parser/test_data/parser/ok/0060_as_range.txt b/crates/parser/test_data/parser/ok/0060_as_range.txt new file mode 100644 index 0000000000..81fc02b6f4 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0060_as_range.txt @@ -0,0 +1,56 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + RANGE_EXPR + CAST_EXPR + LITERAL + INT_NUMBER "0" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "usize" + WHITESPACE " " + DOT2 ".." + SEMICOLON ";" + WHITESPACE "\n " + EXPR_STMT + RANGE_EXPR + BIN_EXPR + LITERAL + INT_NUMBER "1" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + CAST_EXPR + LITERAL + INT_NUMBER "2" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "usize" + WHITESPACE " " + DOT2 ".." + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0061_match_full_range.rast b/crates/parser/test_data/parser/ok/0061_match_full_range.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0061_match_full_range.rast rename to crates/parser/test_data/parser/ok/0061_match_full_range.rast diff --git a/crates/syntax/test_data/parser/ok/0061_match_full_range.rs b/crates/parser/test_data/parser/ok/0061_match_full_range.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0061_match_full_range.rs rename to crates/parser/test_data/parser/ok/0061_match_full_range.rs diff --git a/crates/parser/test_data/parser/ok/0061_match_full_range.txt b/crates/parser/test_data/parser/ok/0061_match_full_range.txt new file mode 100644 index 0000000000..2f56e9041e --- /dev/null +++ b/crates/parser/test_data/parser/ok/0061_match_full_range.txt @@ -0,0 +1,27 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + MATCH_EXPR + MATCH_KW "match" + WHITESPACE " " + RANGE_EXPR + DOT2 ".." + WHITESPACE " " + MATCH_ARM_LIST + L_CURLY "{" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0062_macro_2.0.rast b/crates/parser/test_data/parser/ok/0062_macro_2.0.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0062_macro_2.0.rast rename to crates/parser/test_data/parser/ok/0062_macro_2.0.rast diff --git a/crates/syntax/test_data/parser/ok/0062_macro_2.0.rs b/crates/parser/test_data/parser/ok/0062_macro_2.0.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0062_macro_2.0.rs rename to crates/parser/test_data/parser/ok/0062_macro_2.0.rs diff --git a/crates/parser/test_data/parser/ok/0062_macro_2.0.txt b/crates/parser/test_data/parser/ok/0062_macro_2.0.txt new file mode 100644 index 0000000000..3915ed7506 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0062_macro_2.0.txt @@ -0,0 +1,177 @@ +SOURCE_FILE + MACRO_DEF + MACRO_KW "macro" + WHITESPACE " " + NAME + IDENT "parse_use_trees" + TOKEN_TREE + TOKEN_TREE + L_PAREN "(" + DOLLAR "$" + TOKEN_TREE + L_PAREN "(" + DOLLAR "$" + IDENT "s" + COLON ":" + IDENT "expr" + R_PAREN ")" + COMMA "," + STAR "*" + WHITESPACE " " + DOLLAR "$" + TOKEN_TREE + L_PAREN "(" + COMMA "," + R_PAREN ")" + STAR "*" + R_PAREN ")" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + WHITESPACE "\n " + IDENT "vec" + BANG "!" + TOKEN_TREE + L_BRACK "[" + WHITESPACE "\n " + DOLLAR "$" + TOKEN_TREE + L_PAREN "(" + IDENT "parse_use_tree" + TOKEN_TREE + L_PAREN "(" + DOLLAR "$" + IDENT "s" + R_PAREN ")" + COMMA "," + R_PAREN ")" + STAR "*" + WHITESPACE "\n " + R_BRACK "]" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + FN + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "test" + R_BRACK "]" + WHITESPACE "\n" + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "test_use_tree_merge" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + MACRO_DEF + MACRO_KW "macro" + WHITESPACE " " + NAME + IDENT "test_merge" + TOKEN_TREE + TOKEN_TREE + L_PAREN "(" + TOKEN_TREE + L_BRACK "[" + DOLLAR "$" + TOKEN_TREE + L_PAREN "(" + DOLLAR "$" + IDENT "input" + COLON ":" + IDENT "expr" + R_PAREN ")" + COMMA "," + STAR "*" + WHITESPACE " " + DOLLAR "$" + TOKEN_TREE + L_PAREN "(" + COMMA "," + R_PAREN ")" + STAR "*" + R_BRACK "]" + COMMA "," + WHITESPACE " " + TOKEN_TREE + L_BRACK "[" + DOLLAR "$" + TOKEN_TREE + L_PAREN "(" + DOLLAR "$" + IDENT "output" + COLON ":" + IDENT "expr" + R_PAREN ")" + COMMA "," + STAR "*" + WHITESPACE " " + DOLLAR "$" + TOKEN_TREE + L_PAREN "(" + COMMA "," + R_PAREN ")" + STAR "*" + R_BRACK "]" + R_PAREN ")" + WHITESPACE " " + TOKEN_TREE + L_CURLY "{" + WHITESPACE "\n " + IDENT "assert_eq" + BANG "!" + TOKEN_TREE + L_PAREN "(" + WHITESPACE "\n " + IDENT "merge_use_trees" + TOKEN_TREE + L_PAREN "(" + IDENT "parse_use_trees" + BANG "!" + TOKEN_TREE + L_PAREN "(" + DOLLAR "$" + TOKEN_TREE + L_PAREN "(" + DOLLAR "$" + IDENT "input" + COMMA "," + R_PAREN ")" + STAR "*" + R_PAREN ")" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + IDENT "parse_use_trees" + BANG "!" + TOKEN_TREE + L_PAREN "(" + DOLLAR "$" + TOKEN_TREE + L_PAREN "(" + DOLLAR "$" + IDENT "output" + COMMA "," + R_PAREN ")" + STAR "*" + R_PAREN ")" + COMMA "," + WHITESPACE "\n " + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0063_trait_fn_patterns.rast b/crates/parser/test_data/parser/ok/0063_trait_fn_patterns.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0063_trait_fn_patterns.rast rename to crates/parser/test_data/parser/ok/0063_trait_fn_patterns.rast diff --git a/crates/syntax/test_data/parser/ok/0063_trait_fn_patterns.rs b/crates/parser/test_data/parser/ok/0063_trait_fn_patterns.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0063_trait_fn_patterns.rs rename to crates/parser/test_data/parser/ok/0063_trait_fn_patterns.rs diff --git a/crates/parser/test_data/parser/ok/0063_trait_fn_patterns.txt b/crates/parser/test_data/parser/ok/0063_trait_fn_patterns.txt new file mode 100644 index 0000000000..a86b21d27c --- /dev/null +++ b/crates/parser/test_data/parser/ok/0063_trait_fn_patterns.txt @@ -0,0 +1,198 @@ +SOURCE_FILE + TRAIT + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f1" + PARAM_LIST + L_PAREN "(" + PARAM + TUPLE_PAT + L_PAREN "(" + IDENT_PAT + NAME + IDENT "a" + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "b" + R_PAREN ")" + COLON ":" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "usize" + COMMA "," + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "usize" + R_PAREN ")" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f2" + PARAM_LIST + L_PAREN "(" + PARAM + RECORD_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_PAT_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_PAT_FIELD + IDENT_PAT + NAME + IDENT "a" + COMMA "," + WHITESPACE " " + RECORD_PAT_FIELD + IDENT_PAT + NAME + IDENT "b" + WHITESPACE " " + R_CURLY "}" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f3" + PARAM_LIST + L_PAREN "(" + PARAM + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "NewType" + L_PAREN "(" + IDENT_PAT + NAME + IDENT "a" + R_PAREN ")" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "NewType" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f4" + PARAM_LIST + L_PAREN "(" + PARAM + REF_PAT + AMP "&" + REF_PAT + AMP "&" + IDENT_PAT + NAME + IDENT "a" + COLON ":" + WHITESPACE " " + REF_TYPE + AMP "&" + REF_TYPE + AMP "&" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "usize" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "bar" + PARAM_LIST + L_PAREN "(" + PARAM + WILDCARD_PAT + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u64" + COMMA "," + WHITESPACE " " + PARAM + IDENT_PAT + MUT_KW "mut" + WHITESPACE " " + NAME + IDENT "x" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "i32" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0063_variadic_fun.rast b/crates/parser/test_data/parser/ok/0063_variadic_fun.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0063_variadic_fun.rast rename to crates/parser/test_data/parser/ok/0063_variadic_fun.rast diff --git a/crates/syntax/test_data/parser/ok/0063_variadic_fun.rs b/crates/parser/test_data/parser/ok/0063_variadic_fun.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0063_variadic_fun.rs rename to crates/parser/test_data/parser/ok/0063_variadic_fun.rs diff --git a/crates/parser/test_data/parser/ok/0063_variadic_fun.txt b/crates/parser/test_data/parser/ok/0063_variadic_fun.txt new file mode 100644 index 0000000000..e36399123b --- /dev/null +++ b/crates/parser/test_data/parser/ok/0063_variadic_fun.txt @@ -0,0 +1,134 @@ +SOURCE_FILE + EXTERN_BLOCK + ABI + EXTERN_KW "extern" + WHITESPACE " " + STRING "\"C\"" + WHITESPACE " " + EXTERN_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "a" + PARAM_LIST + L_PAREN "(" + PARAM + WILDCARD_PAT + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + MUT_KW "mut" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + COMMA "," + WHITESPACE " " + PARAM + DOT3 "..." + COMMA "," + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "b" + PARAM_LIST + L_PAREN "(" + PARAM + WILDCARD_PAT + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + MUT_KW "mut" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + COMMA "," + WHITESPACE " " + PARAM + WILDCARD_PAT + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + DOT3 "..." + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "c" + PARAM_LIST + L_PAREN "(" + PARAM + WILDCARD_PAT + UNDERSCORE "_" + COLON ":" + WHITESPACE " " + PTR_TYPE + STAR "*" + MUT_KW "mut" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + COMMA "," + WHITESPACE " " + PARAM + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "cfg" + TOKEN_TREE + L_PAREN "(" + IDENT "never" + R_PAREN ")" + R_BRACK "]" + WHITESPACE " " + SLICE_PAT + L_BRACK "[" + IDENT_PAT + NAME + IDENT "w" + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "t" + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "f" + R_BRACK "]" + COLON ":" + WHITESPACE " " + DOT3 "..." + COMMA "," + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0064_impl_fn_params.rast b/crates/parser/test_data/parser/ok/0064_impl_fn_params.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0064_impl_fn_params.rast rename to crates/parser/test_data/parser/ok/0064_impl_fn_params.rast diff --git a/crates/syntax/test_data/parser/ok/0064_impl_fn_params.rs b/crates/parser/test_data/parser/ok/0064_impl_fn_params.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0064_impl_fn_params.rs rename to crates/parser/test_data/parser/ok/0064_impl_fn_params.rs diff --git a/crates/parser/test_data/parser/ok/0064_impl_fn_params.txt b/crates/parser/test_data/parser/ok/0064_impl_fn_params.txt new file mode 100644 index 0000000000..18cecc8108 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0064_impl_fn_params.txt @@ -0,0 +1,166 @@ +SOURCE_FILE + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "U" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f1" + PARAM_LIST + L_PAREN "(" + PARAM + TUPLE_PAT + L_PAREN "(" + IDENT_PAT + NAME + IDENT "a" + COMMA "," + WHITESPACE " " + IDENT_PAT + NAME + IDENT "b" + R_PAREN ")" + COLON ":" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "usize" + COMMA "," + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "usize" + R_PAREN ")" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f2" + PARAM_LIST + L_PAREN "(" + PARAM + RECORD_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + WHITESPACE " " + RECORD_PAT_FIELD_LIST + L_CURLY "{" + WHITESPACE " " + RECORD_PAT_FIELD + IDENT_PAT + NAME + IDENT "a" + COMMA "," + WHITESPACE " " + RECORD_PAT_FIELD + IDENT_PAT + NAME + IDENT "b" + WHITESPACE " " + R_CURLY "}" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "S" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f3" + PARAM_LIST + L_PAREN "(" + PARAM + TUPLE_STRUCT_PAT + PATH + PATH_SEGMENT + NAME_REF + IDENT "NewType" + L_PAREN "(" + IDENT_PAT + NAME + IDENT "a" + R_PAREN ")" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "NewType" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f4" + PARAM_LIST + L_PAREN "(" + PARAM + REF_PAT + AMP "&" + REF_PAT + AMP "&" + IDENT_PAT + NAME + IDENT "a" + COLON ":" + WHITESPACE " " + REF_TYPE + AMP "&" + REF_TYPE + AMP "&" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "usize" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0065_comment_newline.rast b/crates/parser/test_data/parser/ok/0065_comment_newline.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0065_comment_newline.rast rename to crates/parser/test_data/parser/ok/0065_comment_newline.rast diff --git a/crates/syntax/test_data/parser/ok/0065_comment_newline.rs b/crates/parser/test_data/parser/ok/0065_comment_newline.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0065_comment_newline.rs rename to crates/parser/test_data/parser/ok/0065_comment_newline.rs diff --git a/crates/parser/test_data/parser/ok/0065_comment_newline.txt b/crates/parser/test_data/parser/ok/0065_comment_newline.txt new file mode 100644 index 0000000000..3ffcb48f5e --- /dev/null +++ b/crates/parser/test_data/parser/ok/0065_comment_newline.txt @@ -0,0 +1,17 @@ +SOURCE_FILE + FN + COMMENT "/// Example" + WHITESPACE "\n\n" + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "test" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast b/crates/parser/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast rename to crates/parser/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast diff --git a/crates/syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rs b/crates/parser/test_data/parser/ok/0065_plus_after_fn_trait_bound.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rs rename to crates/parser/test_data/parser/ok/0065_plus_after_fn_trait_bound.rs diff --git a/crates/parser/test_data/parser/ok/0065_plus_after_fn_trait_bound.txt b/crates/parser/test_data/parser/ok/0065_plus_after_fn_trait_bound.txt new file mode 100644 index 0000000000..ba7b6042a9 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0065_plus_after_fn_trait_bound.txt @@ -0,0 +1,61 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE " " + WHERE_PRED + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Fn" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Send" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0066_default_modifier.rast b/crates/parser/test_data/parser/ok/0066_default_modifier.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0066_default_modifier.rast rename to crates/parser/test_data/parser/ok/0066_default_modifier.rast diff --git a/crates/syntax/test_data/parser/ok/0066_default_modifier.rs b/crates/parser/test_data/parser/ok/0066_default_modifier.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0066_default_modifier.rs rename to crates/parser/test_data/parser/ok/0066_default_modifier.rs diff --git a/crates/parser/test_data/parser/ok/0066_default_modifier.txt b/crates/parser/test_data/parser/ok/0066_default_modifier.txt new file mode 100644 index 0000000000..a4303098a2 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0066_default_modifier.txt @@ -0,0 +1,222 @@ +SOURCE_FILE + TRAIT + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + TYPE_ALIAS + DEFAULT_KW "default" + WHITESPACE " " + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Bar" + SEMICOLON ";" + WHITESPACE "\n " + CONST + DEFAULT_KW "default" + WHITESPACE " " + CONST_KW "const" + WHITESPACE " " + NAME + IDENT "f" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "0" + SEMICOLON ";" + WHITESPACE "\n " + FN + DEFAULT_KW "default" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + DEFAULT_KW "default" + WHITESPACE " " + UNSAFE_KW "unsafe" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "bar" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + IMPL + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + WHITESPACE " " + FOR_KW "for" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + WHITESPACE "\n " + TYPE_ALIAS + DEFAULT_KW "default" + WHITESPACE " " + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Bar" + SEMICOLON ";" + WHITESPACE "\n " + CONST + DEFAULT_KW "default" + WHITESPACE " " + CONST_KW "const" + WHITESPACE " " + NAME + IDENT "f" + COLON ":" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "u8" + WHITESPACE " " + EQ "=" + WHITESPACE " " + LITERAL + INT_NUMBER "0" + SEMICOLON ";" + WHITESPACE "\n " + FN + DEFAULT_KW "default" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n " + FN + DEFAULT_KW "default" + WHITESPACE " " + UNSAFE_KW "unsafe" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "bar" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n\n" + IMPL + DEFAULT_KW "default" + WHITESPACE " " + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + WHITESPACE " " + FOR_KW "for" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + IMPL + DEFAULT_KW "default" + WHITESPACE " " + UNSAFE_KW "unsafe" + WHITESPACE " " + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + WHITESPACE " " + FOR_KW "for" + WHITESPACE " " + TUPLE_TYPE + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0067_where_for_pred.rast b/crates/parser/test_data/parser/ok/0067_where_for_pred.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0067_where_for_pred.rast rename to crates/parser/test_data/parser/ok/0067_where_for_pred.rast diff --git a/crates/syntax/test_data/parser/ok/0067_where_for_pred.rs b/crates/parser/test_data/parser/ok/0067_where_for_pred.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0067_where_for_pred.rs rename to crates/parser/test_data/parser/ok/0067_where_for_pred.rs diff --git a/crates/parser/test_data/parser/ok/0067_where_for_pred.txt b/crates/parser/test_data/parser/ok/0067_where_for_pred.txt new file mode 100644 index 0000000000..136fce93d7 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0067_where_for_pred.txt @@ -0,0 +1,413 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "for_trait" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "F" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n" + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE "\n " + WHERE_PRED + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "F" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Fn" + PARAM_LIST + L_PAREN "(" + PARAM + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "str" + R_PAREN ")" + COMMA "," + WHITESPACE "\n" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "for_ref" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "F" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n" + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE "\n " + WHERE_PRED + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "F" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Debug" + COMMA "," + WHITESPACE "\n" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "for_parens" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "F" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n" + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE "\n " + WHERE_PRED + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + PAREN_TYPE + L_PAREN "(" + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "F" + R_PAREN ")" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Fn" + PARAM_LIST + L_PAREN "(" + PARAM + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "str" + R_PAREN ")" + COMMA "," + WHITESPACE "\n" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "for_slice" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "F" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n" + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE "\n " + WHERE_PRED + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + SLICE_TYPE + L_BRACK "[" + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "F" + R_BRACK "]" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Eq" + COMMA "," + WHITESPACE "\n" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "for_qpath" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + PARAM + IDENT_PAT + NAME + IDENT "_t" + COLON ":" + WHITESPACE " " + REF_TYPE + AMP "&" + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + R_PAREN ")" + WHITESPACE "\n" + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE "\n " + WHERE_PRED + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + PATH_TYPE + PATH + PATH + PATH_SEGMENT + L_ANGLE "<" + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Baz" + R_ANGLE ">" + COLON2 "::" + PATH_SEGMENT + NAME_REF + IDENT "Foo" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Iterator" + COMMA "," + WHITESPACE "\n" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "for_for_fn" + GENERIC_PARAM_LIST + L_ANGLE "<" + TYPE_PARAM + NAME + IDENT "T" + R_ANGLE ">" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n" + WHERE_CLAUSE + WHERE_KW "where" + WHITESPACE "\n " + WHERE_PRED + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + FOR_TYPE + FOR_KW "for" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'b" + R_ANGLE ">" + WHITESPACE " " + FN_PTR_TYPE + FN_KW "fn" + PARAM_LIST + L_PAREN "(" + PARAM + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + COMMA "," + WHITESPACE " " + PARAM + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'b" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "T" + R_PAREN ")" + COLON ":" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Copy" + COMMA "," + WHITESPACE "\n" + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0068_item_modifiers.rast b/crates/parser/test_data/parser/ok/0068_item_modifiers.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0068_item_modifiers.rast rename to crates/parser/test_data/parser/ok/0068_item_modifiers.rast diff --git a/crates/syntax/test_data/parser/ok/0068_item_modifiers.rs b/crates/parser/test_data/parser/ok/0068_item_modifiers.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0068_item_modifiers.rs rename to crates/parser/test_data/parser/ok/0068_item_modifiers.rs diff --git a/crates/parser/test_data/parser/ok/0068_item_modifiers.txt b/crates/parser/test_data/parser/ok/0068_item_modifiers.txt new file mode 100644 index 0000000000..41fc5691ad --- /dev/null +++ b/crates/parser/test_data/parser/ok/0068_item_modifiers.txt @@ -0,0 +1,238 @@ +SOURCE_FILE + FN + ASYNC_KW "async" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + ABI + EXTERN_KW "extern" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + CONST_KW "const" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + CONST_KW "const" + WHITESPACE " " + UNSAFE_KW "unsafe" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + UNSAFE_KW "unsafe" + WHITESPACE " " + ABI + EXTERN_KW "extern" + WHITESPACE " " + STRING "\"C\"" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + UNSAFE_KW "unsafe" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + ASYNC_KW "async" + WHITESPACE " " + UNSAFE_KW "unsafe" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + FN + CONST_KW "const" + WHITESPACE " " + UNSAFE_KW "unsafe" + WHITESPACE " " + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "bar" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n\n" + TRAIT + UNSAFE_KW "unsafe" + WHITESPACE " " + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + TRAIT + AUTO_KW "auto" + WHITESPACE " " + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + TRAIT + UNSAFE_KW "unsafe" + WHITESPACE " " + AUTO_KW "auto" + WHITESPACE " " + TRAIT_KW "trait" + WHITESPACE " " + NAME + IDENT "T" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n\n" + IMPL + UNSAFE_KW "unsafe" + WHITESPACE " " + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + IMPL + DEFAULT_KW "default" + WHITESPACE " " + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" + IMPL + UNSAFE_KW "unsafe" + WHITESPACE " " + DEFAULT_KW "default" + WHITESPACE " " + IMPL_KW "impl" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Foo" + WHITESPACE " " + ASSOC_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n\n" + EXTERN_BLOCK + UNSAFE_KW "unsafe" + WHITESPACE " " + ABI + EXTERN_KW "extern" + WHITESPACE " " + STRING "\"C++\"" + WHITESPACE " " + EXTERN_ITEM_LIST + L_CURLY "{" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0069_multi_trait_object.rast b/crates/parser/test_data/parser/ok/0069_multi_trait_object.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0069_multi_trait_object.rast rename to crates/parser/test_data/parser/ok/0069_multi_trait_object.rast diff --git a/crates/syntax/test_data/parser/ok/0069_multi_trait_object.rs b/crates/parser/test_data/parser/ok/0069_multi_trait_object.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0069_multi_trait_object.rs rename to crates/parser/test_data/parser/ok/0069_multi_trait_object.rs diff --git a/crates/parser/test_data/parser/ok/0069_multi_trait_object.txt b/crates/parser/test_data/parser/ok/0069_multi_trait_object.txt new file mode 100644 index 0000000000..9e8f4e1974 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0069_multi_trait_object.txt @@ -0,0 +1,204 @@ +SOURCE_FILE + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "Foo" + GENERIC_PARAM_LIST + L_ANGLE "<" + LIFETIME_PARAM + LIFETIME + LIFETIME_IDENT "'a" + R_ANGLE ">" + WHITESPACE " " + EQ "=" + WHITESPACE " " + REF_TYPE + AMP "&" + LIFETIME + LIFETIME_IDENT "'a" + WHITESPACE " " + PAREN_TYPE + L_PAREN "(" + DYN_TRAIT_TYPE + DYN_KW "dyn" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Send" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Sync" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "Foo" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PTR_TYPE + STAR "*" + CONST_KW "const" + WHITESPACE " " + PAREN_TYPE + L_PAREN "(" + DYN_TRAIT_TYPE + DYN_KW "dyn" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Send" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Sync" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + TYPE_ALIAS + TYPE_KW "type" + WHITESPACE " " + NAME + IDENT "Foo" + WHITESPACE " " + EQ "=" + WHITESPACE " " + FN_PTR_TYPE + FN_KW "fn" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + RET_TYPE + THIN_ARROW "->" + WHITESPACE " " + PAREN_TYPE + L_PAREN "(" + DYN_TRAIT_TYPE + DYN_KW "dyn" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Send" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + LIFETIME + LIFETIME_IDENT "'static" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "main" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + LET_STMT + LET_KW "let" + WHITESPACE " " + IDENT_PAT + NAME + IDENT "b" + WHITESPACE " " + EQ "=" + WHITESPACE " " + CAST_EXPR + PAREN_EXPR + L_PAREN "(" + REF_EXPR + AMP "&" + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + R_PAREN ")" + WHITESPACE " " + AS_KW "as" + WHITESPACE " " + REF_TYPE + AMP "&" + PAREN_TYPE + L_PAREN "(" + DYN_TRAIT_TYPE + DYN_KW "dyn" + WHITESPACE " " + TYPE_BOUND_LIST + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Add" + GENERIC_ARG_LIST + L_ANGLE "<" + TYPE_ARG + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Other" + COMMA "," + WHITESPACE " " + ASSOC_TYPE_ARG + NAME_REF + IDENT "Output" + WHITESPACE " " + EQ "=" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Addable" + R_ANGLE ">" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + TYPE_BOUND + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "Other" + R_PAREN ")" + SEMICOLON ";" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0070_expr_attr_placement.rast b/crates/parser/test_data/parser/ok/0070_expr_attr_placement.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0070_expr_attr_placement.rast rename to crates/parser/test_data/parser/ok/0070_expr_attr_placement.rast diff --git a/crates/syntax/test_data/parser/ok/0070_expr_attr_placement.rs b/crates/parser/test_data/parser/ok/0070_expr_attr_placement.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0070_expr_attr_placement.rs rename to crates/parser/test_data/parser/ok/0070_expr_attr_placement.rs diff --git a/crates/parser/test_data/parser/ok/0070_expr_attr_placement.txt b/crates/parser/test_data/parser/ok/0070_expr_attr_placement.txt new file mode 100644 index 0000000000..3d00b27ab8 --- /dev/null +++ b/crates/parser/test_data/parser/ok/0070_expr_attr_placement.txt @@ -0,0 +1,59 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "f" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + PAREN_EXPR + L_PAREN "(" + BIN_EXPR + TRY_EXPR + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" + R_BRACK "]" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "lhs" + QUESTION "?" + WHITESPACE " " + PLUS "+" + WHITESPACE " " + AWAIT_EXPR + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "b" + R_BRACK "]" + WHITESPACE " " + PATH_EXPR + PATH + PATH_SEGMENT + NAME_REF + IDENT "rhs" + DOT "." + AWAIT_KW "await" + R_PAREN ")" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/test_data/parser/ok/0071_stmt_attr_placement.rast b/crates/parser/test_data/parser/ok/0071_stmt_attr_placement.rast similarity index 100% rename from crates/syntax/test_data/parser/ok/0071_stmt_attr_placement.rast rename to crates/parser/test_data/parser/ok/0071_stmt_attr_placement.rast diff --git a/crates/syntax/test_data/parser/ok/0071_stmt_attr_placement.rs b/crates/parser/test_data/parser/ok/0071_stmt_attr_placement.rs similarity index 100% rename from crates/syntax/test_data/parser/ok/0071_stmt_attr_placement.rs rename to crates/parser/test_data/parser/ok/0071_stmt_attr_placement.rs diff --git a/crates/parser/test_data/parser/ok/0071_stmt_attr_placement.txt b/crates/parser/test_data/parser/ok/0071_stmt_attr_placement.txt new file mode 100644 index 0000000000..81797c35ba --- /dev/null +++ b/crates/parser/test_data/parser/ok/0071_stmt_attr_placement.txt @@ -0,0 +1,71 @@ +SOURCE_FILE + FN + FN_KW "fn" + WHITESPACE " " + NAME + IDENT "foo" + PARAM_LIST + L_PAREN "(" + R_PAREN ")" + WHITESPACE " " + BLOCK_EXPR + STMT_LIST + L_CURLY "{" + WHITESPACE "\n " + EXPR_STMT + BLOCK_EXPR + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "A" + R_BRACK "]" + WHITESPACE " " + STMT_LIST + L_CURLY "{" + WHITESPACE " " + TRY_EXPR + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "B" + R_BRACK "]" + WHITESPACE " " + MACRO_CALL + PATH + PATH_SEGMENT + NAME_REF + IDENT "bar" + BANG "!" + TOKEN_TREE + L_PAREN "(" + R_PAREN ")" + QUESTION "?" + WHITESPACE " " + R_CURLY "}" + WHITESPACE "\n " + REF_EXPR + ATTR + POUND "#" + L_BRACK "[" + META + PATH + PATH_SEGMENT + NAME_REF + IDENT "C" + R_BRACK "]" + WHITESPACE " " + AMP "&" + TUPLE_EXPR + L_PAREN "(" + R_PAREN ")" + WHITESPACE "\n" + R_CURLY "}" + WHITESPACE "\n" diff --git a/crates/syntax/src/tests.rs b/crates/syntax/src/tests.rs index 69c5b1cd35..04105dedc9 100644 --- a/crates/syntax/src/tests.rs +++ b/crates/syntax/src/tests.rs @@ -1,4 +1,3 @@ -mod sourcegen_tests; mod sourcegen_ast; mod ast_src; @@ -51,14 +50,8 @@ fn benchmark_parser() { } #[test] -fn parser_tests() { - dir_tests(&test_data_dir(), &["parser/inline/ok", "parser/ok"], "rast", |text, path| { - let parse = SourceFile::parse(text); - let errors = parse.errors(); - assert_errors_are_absent(errors, path); - parse.debug_dump() - }); - dir_tests(&test_data_dir(), &["parser/err", "parser/inline/err"], "rast", |text, path| { +fn validation_tests() { + dir_tests(&test_data_dir(), &["parser/validation"], "rast", |text, path| { let parse = SourceFile::parse(text); let errors = parse.errors(); assert_errors_are_present(errors, path); @@ -178,14 +171,6 @@ fn test_data_dir() -> PathBuf { fn assert_errors_are_present(errors: &[SyntaxError], path: &Path) { assert!(!errors.is_empty(), "There should be errors in the file {:?}", path.display()); } -fn assert_errors_are_absent(errors: &[SyntaxError], path: &Path) { - assert_eq!( - errors, - &[] as &[SyntaxError], - "There should be no errors in the file {:?}", - path.display(), - ); -} fn fragment_parser_dir_test(ok_paths: &[&str], err_paths: &[&str], f: F) where diff --git a/crates/syntax/src/tests/sourcegen_tests.rs b/crates/syntax/src/tests/sourcegen_tests.rs deleted file mode 100644 index 7f56807947..0000000000 --- a/crates/syntax/src/tests/sourcegen_tests.rs +++ /dev/null @@ -1,124 +0,0 @@ -//! This module greps parser's code for specially formatted comments and turns -//! them into tests. - -use std::{ - fs, iter, - path::{Path, PathBuf}, -}; - -use rustc_hash::FxHashMap; - -#[test] -fn sourcegen_parser_tests() { - let grammar_dir = sourcegen::project_root().join(Path::new("crates/parser/src/grammar")); - let tests = tests_from_dir(&grammar_dir); - - install_tests(&tests.ok, "crates/syntax/test_data/parser/inline/ok"); - install_tests(&tests.err, "crates/syntax/test_data/parser/inline/err"); - - fn install_tests(tests: &FxHashMap, into: &str) { - let tests_dir = sourcegen::project_root().join(into); - if !tests_dir.is_dir() { - fs::create_dir_all(&tests_dir).unwrap(); - } - // ok is never actually read, but it needs to be specified to create a Test in existing_tests - let existing = existing_tests(&tests_dir, true); - for t in existing.keys().filter(|&t| !tests.contains_key(t)) { - panic!("Test is deleted: {}", t); - } - - let mut new_idx = existing.len() + 1; - for (name, test) in tests { - let path = match existing.get(name) { - Some((path, _test)) => path.clone(), - None => { - let file_name = format!("{:04}_{}.rs", new_idx, name); - new_idx += 1; - tests_dir.join(file_name) - } - }; - sourcegen::ensure_file_contents(&path, &test.text); - } - } -} - -#[derive(Debug)] -struct Test { - name: String, - text: String, - ok: bool, -} - -#[derive(Default, Debug)] -struct Tests { - ok: FxHashMap, - err: FxHashMap, -} - -fn collect_tests(s: &str) -> Vec { - let mut res = Vec::new(); - for comment_block in sourcegen::CommentBlock::extract_untagged(s) { - let first_line = &comment_block.contents[0]; - let (name, ok) = if let Some(name) = first_line.strip_prefix("test ") { - (name.to_string(), true) - } else if let Some(name) = first_line.strip_prefix("test_err ") { - (name.to_string(), false) - } else { - continue; - }; - let text: String = comment_block.contents[1..] - .iter() - .cloned() - .chain(iter::once(String::new())) - .collect::>() - .join("\n"); - assert!(!text.trim().is_empty() && text.ends_with('\n')); - res.push(Test { name, text, ok }) - } - res -} - -fn tests_from_dir(dir: &Path) -> Tests { - let mut res = Tests::default(); - for entry in sourcegen::list_rust_files(dir) { - process_file(&mut res, entry.as_path()); - } - let grammar_rs = dir.parent().unwrap().join("grammar.rs"); - process_file(&mut res, &grammar_rs); - return res; - - fn process_file(res: &mut Tests, path: &Path) { - let text = fs::read_to_string(path).unwrap(); - - for test in collect_tests(&text) { - if test.ok { - if let Some(old_test) = res.ok.insert(test.name.clone(), test) { - panic!("Duplicate test: {}", old_test.name); - } - } else if let Some(old_test) = res.err.insert(test.name.clone(), test) { - panic!("Duplicate test: {}", old_test.name); - } - } - } -} - -fn existing_tests(dir: &Path, ok: bool) -> FxHashMap { - let mut res = FxHashMap::default(); - for file in fs::read_dir(dir).unwrap() { - let file = file.unwrap(); - let path = file.path(); - if path.extension().unwrap_or_default() != "rs" { - continue; - } - let name = { - let file_name = path.file_name().unwrap().to_str().unwrap(); - file_name[5..file_name.len() - 3].to_string() - }; - let text = fs::read_to_string(&path).unwrap(); - let test = Test { name: name.clone(), text, ok }; - if let Some(old) = res.insert(name, (path, test)) { - println!("Duplicate test: {:?}", old); - } - } - res -} diff --git a/crates/syntax/test_data/parser/err/0047_repated_extern_modifier.rs b/crates/syntax/test_data/parser/err/0047_repated_extern_modifier.rs deleted file mode 100644 index 1fb18eaf1b..0000000000 --- a/crates/syntax/test_data/parser/err/0047_repated_extern_modifier.rs +++ /dev/null @@ -1 +0,0 @@ -extern "C" extern "C" diff --git a/crates/syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast b/crates/syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast deleted file mode 100644 index 005f6db3c5..0000000000 --- a/crates/syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast +++ /dev/null @@ -1,53 +0,0 @@ -SOURCE_FILE@0..47 - FN@0..46 - FN_KW@0..2 "fn" - WHITESPACE@2..3 " " - NAME@3..6 - IDENT@3..6 "foo" - PARAM_LIST@6..8 - L_PAREN@6..7 "(" - R_PAREN@7..8 ")" - WHITESPACE@8..9 " " - BLOCK_EXPR@9..46 - STMT_LIST@9..46 - L_CURLY@9..10 "{" - WHITESPACE@10..15 "\n " - EXPR_STMT@15..20 - FIELD_EXPR@15..19 - PATH_EXPR@15..16 - PATH@15..16 - PATH_SEGMENT@15..16 - NAME_REF@15..16 - IDENT@15..16 "x" - DOT@16..17 "." - FLOAT_NUMBER@17..19 "0." - SEMICOLON@19..20 ";" - WHITESPACE@20..25 "\n " - EXPR_STMT@25..32 - FIELD_EXPR@25..31 - PATH_EXPR@25..26 - PATH@25..26 - PATH_SEGMENT@25..26 - NAME_REF@25..26 - IDENT@25..26 "x" - DOT@26..27 "." - NAME_REF@27..31 - INT_NUMBER@27..31 "1i32" - SEMICOLON@31..32 ";" - WHITESPACE@32..37 "\n " - EXPR_STMT@37..44 - FIELD_EXPR@37..43 - PATH_EXPR@37..38 - PATH@37..38 - PATH_SEGMENT@37..38 - NAME_REF@37..38 - IDENT@37..38 "x" - DOT@38..39 "." - NAME_REF@39..43 - INT_NUMBER@39..43 "0x01" - SEMICOLON@43..44 ";" - WHITESPACE@44..45 "\n" - R_CURLY@45..46 "}" - WHITESPACE@46..47 "\n" -error 27..31: Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix -error 39..43: Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix diff --git a/crates/syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rs b/crates/syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rs deleted file mode 100644 index 30cc491389..0000000000 --- a/crates/syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rs +++ /dev/null @@ -1,5 +0,0 @@ -fn foo() { - x.0.; - x.1i32; - x.0x01; -} diff --git a/crates/syntax/test_data/parser/err/0031_block_inner_attrs.rast b/crates/syntax/test_data/parser/validation/0031_block_inner_attrs.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0031_block_inner_attrs.rast rename to crates/syntax/test_data/parser/validation/0031_block_inner_attrs.rast diff --git a/crates/syntax/test_data/parser/err/0031_block_inner_attrs.rs b/crates/syntax/test_data/parser/validation/0031_block_inner_attrs.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0031_block_inner_attrs.rs rename to crates/syntax/test_data/parser/validation/0031_block_inner_attrs.rs diff --git a/crates/syntax/test_data/parser/err/0037_visibility_in_traits.rast b/crates/syntax/test_data/parser/validation/0037_visibility_in_traits.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0037_visibility_in_traits.rast rename to crates/syntax/test_data/parser/validation/0037_visibility_in_traits.rast diff --git a/crates/syntax/test_data/parser/err/0037_visibility_in_traits.rs b/crates/syntax/test_data/parser/validation/0037_visibility_in_traits.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0037_visibility_in_traits.rs rename to crates/syntax/test_data/parser/validation/0037_visibility_in_traits.rs diff --git a/crates/syntax/test_data/parser/err/0038_endless_inclusive_range.rast b/crates/syntax/test_data/parser/validation/0038_endless_inclusive_range.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0038_endless_inclusive_range.rast rename to crates/syntax/test_data/parser/validation/0038_endless_inclusive_range.rast diff --git a/crates/syntax/test_data/parser/err/0038_endless_inclusive_range.rs b/crates/syntax/test_data/parser/validation/0038_endless_inclusive_range.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0038_endless_inclusive_range.rs rename to crates/syntax/test_data/parser/validation/0038_endless_inclusive_range.rs diff --git a/crates/syntax/test_data/parser/err/0040_illegal_crate_kw_location.rast b/crates/syntax/test_data/parser/validation/0040_illegal_crate_kw_location.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0040_illegal_crate_kw_location.rast rename to crates/syntax/test_data/parser/validation/0040_illegal_crate_kw_location.rast diff --git a/crates/syntax/test_data/parser/err/0040_illegal_crate_kw_location.rs b/crates/syntax/test_data/parser/validation/0040_illegal_crate_kw_location.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0040_illegal_crate_kw_location.rs rename to crates/syntax/test_data/parser/validation/0040_illegal_crate_kw_location.rs diff --git a/crates/syntax/test_data/parser/err/0041_illegal_self_keyword_location.rast b/crates/syntax/test_data/parser/validation/0041_illegal_self_keyword_location.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0041_illegal_self_keyword_location.rast rename to crates/syntax/test_data/parser/validation/0041_illegal_self_keyword_location.rast diff --git a/crates/syntax/test_data/parser/err/0041_illegal_self_keyword_location.rs b/crates/syntax/test_data/parser/validation/0041_illegal_self_keyword_location.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0041_illegal_self_keyword_location.rs rename to crates/syntax/test_data/parser/validation/0041_illegal_self_keyword_location.rs diff --git a/crates/syntax/test_data/parser/err/0045_ambiguous_trait_object.rast b/crates/syntax/test_data/parser/validation/0045_ambiguous_trait_object.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0045_ambiguous_trait_object.rast rename to crates/syntax/test_data/parser/validation/0045_ambiguous_trait_object.rast diff --git a/crates/syntax/test_data/parser/err/0045_ambiguous_trait_object.rs b/crates/syntax/test_data/parser/validation/0045_ambiguous_trait_object.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0045_ambiguous_trait_object.rs rename to crates/syntax/test_data/parser/validation/0045_ambiguous_trait_object.rs diff --git a/crates/syntax/test_data/parser/err/0046_mutable_const_item.rast b/crates/syntax/test_data/parser/validation/0046_mutable_const_item.rast similarity index 100% rename from crates/syntax/test_data/parser/err/0046_mutable_const_item.rast rename to crates/syntax/test_data/parser/validation/0046_mutable_const_item.rast diff --git a/crates/syntax/test_data/parser/err/0046_mutable_const_item.rs b/crates/syntax/test_data/parser/validation/0046_mutable_const_item.rs similarity index 100% rename from crates/syntax/test_data/parser/err/0046_mutable_const_item.rs rename to crates/syntax/test_data/parser/validation/0046_mutable_const_item.rs