mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-13 00:56:14 +00:00
add in-comment test case for use_tree_list_err_recovery
This commit is contained in:
parent
afe05fe1d8
commit
45eea57115
@ -86,6 +86,11 @@ pub(crate) fn use_tree_list(p: &mut Parser<'_>) {
|
||||
assert!(p.at(T!['{']));
|
||||
let m = p.start();
|
||||
|
||||
// test_err use_tree_list_err_recovery
|
||||
// use {a;
|
||||
// use b;
|
||||
// struct T;
|
||||
// fn test() {}
|
||||
delimited(p, T!['{'], T!['}'], T![,], USE_TREE_LIST_RECOVERY_SET, |p: &mut Parser<'_>| {
|
||||
use_tree(p, false) || p.at_ts(USE_TREE_LIST_RECOVERY_SET)
|
||||
});
|
||||
|
@ -0,0 +1,50 @@
|
||||
SOURCE_FILE
|
||||
USE
|
||||
USE_KW "use"
|
||||
WHITESPACE " "
|
||||
USE_TREE
|
||||
USE_TREE_LIST
|
||||
L_CURLY "{"
|
||||
USE_TREE
|
||||
PATH
|
||||
PATH_SEGMENT
|
||||
NAME_REF
|
||||
IDENT "a"
|
||||
ERROR
|
||||
SEMICOLON ";"
|
||||
WHITESPACE "\n"
|
||||
USE
|
||||
USE_KW "use"
|
||||
WHITESPACE " "
|
||||
USE_TREE
|
||||
PATH
|
||||
PATH_SEGMENT
|
||||
NAME_REF
|
||||
IDENT "b"
|
||||
SEMICOLON ";"
|
||||
WHITESPACE "\n"
|
||||
STRUCT
|
||||
STRUCT_KW "struct"
|
||||
WHITESPACE " "
|
||||
NAME
|
||||
IDENT "T"
|
||||
SEMICOLON ";"
|
||||
WHITESPACE "\n"
|
||||
FN
|
||||
FN_KW "fn"
|
||||
WHITESPACE " "
|
||||
NAME
|
||||
IDENT "test"
|
||||
PARAM_LIST
|
||||
L_PAREN "("
|
||||
R_PAREN ")"
|
||||
WHITESPACE " "
|
||||
BLOCK_EXPR
|
||||
STMT_LIST
|
||||
L_CURLY "{"
|
||||
R_CURLY "}"
|
||||
WHITESPACE "\n"
|
||||
error 6: expected COMMA
|
||||
error 6: expected one of `*`, `::`, `{`, `self`, `super` or an identifier
|
||||
error 7: expected R_CURLY
|
||||
error 7: expected SEMICOLON
|
@ -0,0 +1,4 @@
|
||||
use {a;
|
||||
use b;
|
||||
struct T;
|
||||
fn test() {}
|
Loading…
Reference in New Issue
Block a user