drop dead code

This commit is contained in:
Aleksey Kladov 2021-12-27 21:26:02 +03:00
parent 2cbfcf431e
commit 7e9c74d20b
35 changed files with 0 additions and 249 deletions

View file

@ -81,7 +81,6 @@ impl ParsedRule {
}
builder.try_add2(fragments::ty(&raw_pattern), raw_template.map(fragments::ty));
builder.try_add2(fragments::item(&raw_pattern), raw_template.map(fragments::item));
builder.try_add(ast::Path::parse(&raw_pattern), raw_template.map(ast::Path::parse));
builder.try_add(ast::Pat::parse(&raw_pattern), raw_template.map(ast::Pat::parse));
builder.try_add2(fragments::stmt(&raw_pattern), raw_template_stmt);
builder.build()

View file

@ -201,13 +201,6 @@ impl ast::Attr {
}
}
impl ast::Stmt {
/// Returns `text`, parsed as statement, but only if it has no errors.
pub fn parse(text: &str) -> Result<Self, ()> {
parsing::parse_text_as(text, parser::ParserEntryPoint::StatementOptionalSemi)
}
}
/// Matches a `SyntaxNode` against an `ast` type.
///
/// # Example:

View file

@ -59,15 +59,6 @@ fn validation_tests() {
});
}
#[test]
fn expr_parser_tests() {
fragment_parser_dir_test(
&["parser/fragments/expr/ok"],
&["parser/fragments/expr/err"],
crate::ast::Expr::parse,
);
}
#[test]
fn path_parser_tests() {
fragment_parser_dir_test(
@ -86,15 +77,6 @@ fn pattern_parser_tests() {
);
}
#[test]
fn stmt_parser_tests() {
fragment_parser_dir_test(
&["parser/fragments/stmt/ok"],
&["parser/fragments/stmt/err"],
crate::ast::Stmt::parse,
);
}
#[test]
fn parser_fuzz_tests() {
for (_, text) in collect_rust_files(&test_data_dir(), &["parser/fuzz-failures"]) {

View file

@ -1,8 +0,0 @@
BIN_EXPR@0..5
LITERAL@0..1
INT_NUMBER@0..1 "1"
WHITESPACE@1..2 " "
PLUS@2..3 "+"
WHITESPACE@3..4 " "
LITERAL@4..5
INT_NUMBER@4..5 "2"

View file

@ -1,9 +0,0 @@
EXPR_STMT@0..5
BIN_EXPR@0..5
LITERAL@0..1
INT_NUMBER@0..1 "1"
WHITESPACE@1..2 " "
PLUS@2..3 "+"
WHITESPACE@3..4 " "
LITERAL@4..5
INT_NUMBER@4..5 "1"

View file

@ -1,70 +0,0 @@
EXPR_STMT@0..55
BLOCK_EXPR@0..55
STMT_LIST@0..55
L_CURLY@0..1 "{"
WHITESPACE@1..6 "\n "
LET_STMT@6..20
LET_KW@6..9 "let"
WHITESPACE@9..10 " "
IDENT_PAT@10..11
NAME@10..11
IDENT@10..11 "x"
WHITESPACE@11..12 " "
EQ@12..13 "="
WHITESPACE@13..14 " "
CALL_EXPR@14..19
PATH_EXPR@14..17
PATH@14..17
PATH_SEGMENT@14..17
NAME_REF@14..17
IDENT@14..17 "foo"
ARG_LIST@17..19
L_PAREN@17..18 "("
R_PAREN@18..19 ")"
SEMICOLON@19..20 ";"
WHITESPACE@20..25 "\n "
LET_STMT@25..39
LET_KW@25..28 "let"
WHITESPACE@28..29 " "
IDENT_PAT@29..30
NAME@29..30
IDENT@29..30 "y"
WHITESPACE@30..31 " "
EQ@31..32 "="
WHITESPACE@32..33 " "
CALL_EXPR@33..38
PATH_EXPR@33..36
PATH@33..36
PATH_SEGMENT@33..36
NAME_REF@33..36
IDENT@33..36 "bar"
ARG_LIST@36..38
L_PAREN@36..37 "("
R_PAREN@37..38 ")"
SEMICOLON@38..39 ";"
WHITESPACE@39..44 "\n "
CALL_EXPR@44..53
PATH_EXPR@44..46
PATH@44..46
PATH_SEGMENT@44..46
NAME_REF@44..46
IDENT@44..46 "Ok"
ARG_LIST@46..53
L_PAREN@46..47 "("
BIN_EXPR@47..52
PATH_EXPR@47..48
PATH@47..48
PATH_SEGMENT@47..48
NAME_REF@47..48
IDENT@47..48 "x"
WHITESPACE@48..49 " "
PLUS@49..50 "+"
WHITESPACE@50..51 " "
PATH_EXPR@51..52
PATH@51..52
PATH_SEGMENT@51..52
NAME_REF@51..52
IDENT@51..52 "y"
R_PAREN@52..53 ")"
WHITESPACE@53..54 "\n"
R_CURLY@54..55 "}"

View file

@ -1,5 +0,0 @@
{
let x = foo();
let y = bar();
Ok(x + y)
}

View file

@ -1,11 +0,0 @@
EXPR_STMT@0..6
CALL_EXPR@0..5
PATH_EXPR@0..3
PATH@0..3
PATH_SEGMENT@0..3
NAME_REF@0..3
IDENT@0..3 "foo"
ARG_LIST@3..5
L_PAREN@3..4 "("
R_PAREN@4..5 ")"
SEMICOLON@5..6 ";"

View file

@ -1,12 +0,0 @@
LET_STMT@0..11
LET_KW@0..3 "let"
WHITESPACE@3..4 " "
IDENT_PAT@4..5
NAME@4..5
IDENT@4..5 "x"
WHITESPACE@5..6 " "
EQ@6..7 "="
WHITESPACE@7..8 " "
LITERAL@8..10
INT_NUMBER@8..10 "10"
SEMICOLON@10..11 ";"

View file

@ -1,21 +0,0 @@
EXPR_STMT@0..18
MACRO_CALL@0..17
PATH@0..2
PATH_SEGMENT@0..2
NAME_REF@0..2
IDENT@0..2 "m1"
BANG@2..3 "!"
TOKEN_TREE@3..17
L_CURLY@3..4 "{"
WHITESPACE@4..5 " "
LET_KW@5..8 "let"
WHITESPACE@8..9 " "
IDENT@9..10 "a"
WHITESPACE@10..11 " "
EQ@11..12 "="
WHITESPACE@12..13 " "
INT_NUMBER@13..14 "0"
SEMICOLON@14..15 ";"
WHITESPACE@15..16 " "
R_CURLY@16..17 "}"
SEMICOLON@17..18 ";"

View file

@ -1,21 +0,0 @@
EXPR_STMT@0..18
MACRO_CALL@0..17
PATH@0..2
PATH_SEGMENT@0..2
NAME_REF@0..2
IDENT@0..2 "m1"
BANG@2..3 "!"
TOKEN_TREE@3..17
L_CURLY@3..4 "{"
WHITESPACE@4..5 " "
LET_KW@5..8 "let"
WHITESPACE@8..9 " "
IDENT@9..10 "a"
WHITESPACE@10..11 " "
EQ@11..12 "="
WHITESPACE@12..13 " "
INT_NUMBER@13..14 "0"
SEMICOLON@14..15 ";"
WHITESPACE@15..16 " "
R_CURLY@16..17 "}"
SEMICOLON@17..18 ";"

View file

@ -1,22 +0,0 @@
STRUCT@0..28
STRUCT_KW@0..6 "struct"
WHITESPACE@6..7 " "
NAME@7..10
IDENT@7..10 "Foo"
WHITESPACE@10..11 " "
RECORD_FIELD_LIST@11..28
L_CURLY@11..12 "{"
WHITESPACE@12..17 "\n "
RECORD_FIELD@17..25
NAME@17..20
IDENT@17..20 "bar"
COLON@20..21 ":"
WHITESPACE@21..22 " "
PATH_TYPE@22..25
PATH@22..25
PATH_SEGMENT@22..25
NAME_REF@22..25
IDENT@22..25 "u32"
COMMA@25..26 ","
WHITESPACE@26..27 "\n"
R_CURLY@27..28 "}"

View file

@ -1,3 +0,0 @@
struct Foo {
bar: u32,
}

View file

@ -1,10 +0,0 @@
EXPR_STMT@0..5
CALL_EXPR@0..5
PATH_EXPR@0..3
PATH@0..3
PATH_SEGMENT@0..3
NAME_REF@0..3
IDENT@0..3 "foo"
ARG_LIST@3..5
L_PAREN@3..4 "("
R_PAREN@4..5 ")"

View file

@ -1,11 +0,0 @@
LET_STMT@0..10
LET_KW@0..3 "let"
WHITESPACE@3..4 " "
IDENT_PAT@4..5
NAME@4..5
IDENT@4..5 "x"
WHITESPACE@5..6 " "
EQ@6..7 "="
WHITESPACE@7..8 " "
LITERAL@8..10
INT_NUMBER@8..10 "10"