Skip to content

Split the regex to NFA compiler into a module #52

Split the regex to NFA compiler into a module

Split the regex to NFA compiler into a module #52

Triggered via push July 23, 2023 08:36
Status Success
Total duration 1m 13s
Artifacts

ci.yml

on: push
Matrix: test
Fit to window
Zoom out
Zoom in

Annotations

23 warnings
associated function `new` is never used: src/regex/tokenizer.rs#L110
warning: associated function `new` is never used --> src/regex/tokenizer.rs:110:19 | 109 | impl<'a> Tokenizer<'a> { | ---------------------- associated function in this implementation 110 | pub(super) fn new(input: &'a str) -> Self { | ^^^
multiple associated items are never used: src/regex/parser.rs#L38
warning: multiple associated items are never used --> src/regex/parser.rs:38:19 | 37 | impl<'a> Parser<'a> { | ------------------- associated items in this implementation 38 | pub(crate) fn new(input: &'a str) -> Self { | ^^^ ... 45 | pub(crate) fn parse(&mut self) -> ParseResult<ast::Ast> { | ^^^^^ ... 60 | fn expression(&mut self) -> ParseResult<ast::ExprKind> { | ^^^^^^^^^^ ... 84 | fn sub_expression(&mut self) -> ParseResult<Vec<ast::ExprKind>> { | ^^^^^^^^^^^^^^ ... 108 | fn sub_expression_item(&mut self) -> ParseResult<ast::ExprKind> { | ^^^^^^^^^^^^^^^^^^^ ... 120 | fn group(&mut self) -> ParseResult<ast::ExprKind> { | ^^^^^ ... 168 | fn match_(&mut self) -> ParseResult<ast::ExprKind> { | ^^^^^^ ... 186 | fn match_item(&mut self) -> ParseResult<ast::LiteralKind> { | ^^^^^^^^^^ ... 219 | fn character_group(&mut self) -> ParseResult<ast::LiteralKind> { | ^^^^^^^^^^^^^^^ ... 276 | fn character_group_item(&mut self) -> ParseResult<ast::GroupedLiteralKind> { | ^^^^^^^^^^^^^^^^^^^^ ... 326 | fn get_current_token_position(&mut self) -> (usize, usize) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^
type alias `ParseResult` is never used: src/regex/parser.rs#L19
warning: type alias `ParseResult` is never used --> src/regex/parser.rs:19:17 | 19 | pub(crate) type ParseResult<T> = core::result::Result<T, Vec<ParseError>>; | ^^^^^^^^^^^
struct `Parser` is never constructed: src/regex/parser.rs#L13
warning: struct `Parser` is never constructed --> src/regex/parser.rs:13:19 | 13 | pub(crate) struct Parser<'a> { | ^^^^^^
variants `Match`, `Class`, and `Range` are never constructed: src/regex/ast.rs#L54
warning: variants `Match`, `Class`, and `Range` are never constructed --> src/regex/ast.rs:54:5 | 52 | pub(crate) enum GroupedLiteralKind { | ------------------ variants in this enum 53 | /// A single token (unicode character constructs can consist multiple characters). 54 | Match(char), | ^^^^^ 55 | /// A shorthand for character groups (e.g., `\w`, `\D`, `.`). 56 | Class(tokenizer::ClassKind), | ^^^^^ 57 | /// A character range (e.g., `0-1`, `a-z`). 58 | Range(char, char), | ^^^^^ | = note: `GroupedLiteralKind` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
variants `Match`, `Class`, and `Group` are never constructed: src/regex/ast.rs#L40
warning: variants `Match`, `Class`, and `Group` are never constructed --> src/regex/ast.rs:40:5 | 38 | pub(crate) enum LiteralKind { | ----------- variants in this enum 39 | /// A single token (unicode character constructs can consist multiple characters). 40 | Match(char), | ^^^^^ 41 | /// A shorthand for character groups (e.g., `\w`, `\D`, `.`). 42 | Class(tokenizer::ClassKind), | ^^^^^ 43 | /// A group of characters (e.g. `[^a-cl47i]`). 44 | Group { | ^^^^^ | = note: `LiteralKind` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
variants `Concat`, `Empty`, `Alt`, `Lit`, and `Group` are never constructed: src/regex/ast.rs#L25
warning: variants `Concat`, `Empty`, `Alt`, `Lit`, and `Group` are never constructed --> src/regex/ast.rs:25:5 | 23 | pub(crate) enum ExprKind { | -------- variants in this enum 24 | /// Concatenation of regular expressions. 25 | Concat(Vec<ExprKind>), | ^^^^^^ 26 | /// An empty regex expresion. 27 | Empty, | ^^^^^ 28 | /// An alternative expression (e.g., `<expression> | <expression>`). 29 | Alt(Box<ExprKind>, Box<ExprKind>), | ^^^ 30 | /// A literal (e.g., `a`, `[^ca]`, `[a-z]`, `[0-1]*`). 31 | Lit(LiteralKind, Option<tokenizer::QuantifierKind>), | ^^^ 32 | /// A grouped expression (e.g., `([a-z] | foo)`, `(ab[ac]){3,}`). 33 | Group(Box<ExprKind>, Option<tokenizer::QuantifierKind>), | ^^^^^ | = note: `ExprKind` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
associated function `new` is never used: src/fsm/nfa/sim.rs#L43
warning: associated function `new` is never used --> src/fsm/nfa/sim.rs:43:8 | 42 | impl<'a> NfaSimulator<'a> { | ------------------------- associated function in this implementation 43 | fn new(nfa: &'a Nfa) -> Self { | ^^^
associated function `new` is never used: src/fsm/nfa/sim.rs#L25
warning: associated function `new` is never used --> src/fsm/nfa/sim.rs:25:8 | 24 | impl<'a> Run<'a> { | ---------------- associated function in this implementation 25 | fn new(state: &'a State) -> Self { | ^^^
method `with_transition` is never used: src/fsm/nfa/model.rs#L281
warning: method `with_transition` is never used --> src/fsm/nfa/model.rs:281:19 | 222 | impl NfaBuilder { | --------------- method in this implementation ... 281 | pub(super) fn with_transition(mut self, start: StateId, end: StateId, input: Input) -> Self { | ^^^^^^^^^^^^^^^
field `start_state` is never read: src/fsm/nfa/model.rs#L21
warning: field `start_state` is never read --> src/fsm/nfa/model.rs:21:16 | 20 | pub(super) struct Nfa { | --- field in this struct 21 | pub(super) start_state: StateId, | ^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
clippy
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
associated function `new` is never used: src/regex/tokenizer.rs#L110
warning: associated function `new` is never used --> src/regex/tokenizer.rs:110:19 | 109 | impl<'a> Tokenizer<'a> { | ---------------------- associated function in this implementation 110 | pub(super) fn new(input: &'a str) -> Self { | ^^^
multiple associated items are never used: src/regex/parser.rs#L38
warning: multiple associated items are never used --> src/regex/parser.rs:38:19 | 37 | impl<'a> Parser<'a> { | ------------------- associated items in this implementation 38 | pub(crate) fn new(input: &'a str) -> Self { | ^^^ ... 45 | pub(crate) fn parse(&mut self) -> ParseResult<ast::Ast> { | ^^^^^ ... 60 | fn expression(&mut self) -> ParseResult<ast::ExprKind> { | ^^^^^^^^^^ ... 84 | fn sub_expression(&mut self) -> ParseResult<Vec<ast::ExprKind>> { | ^^^^^^^^^^^^^^ ... 108 | fn sub_expression_item(&mut self) -> ParseResult<ast::ExprKind> { | ^^^^^^^^^^^^^^^^^^^ ... 120 | fn group(&mut self) -> ParseResult<ast::ExprKind> { | ^^^^^ ... 168 | fn match_(&mut self) -> ParseResult<ast::ExprKind> { | ^^^^^^ ... 186 | fn match_item(&mut self) -> ParseResult<ast::LiteralKind> { | ^^^^^^^^^^ ... 219 | fn character_group(&mut self) -> ParseResult<ast::LiteralKind> { | ^^^^^^^^^^^^^^^ ... 276 | fn character_group_item(&mut self) -> ParseResult<ast::GroupedLiteralKind> { | ^^^^^^^^^^^^^^^^^^^^ ... 326 | fn get_current_token_position(&mut self) -> (usize, usize) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^
type alias `ParseResult` is never used: src/regex/parser.rs#L19
warning: type alias `ParseResult` is never used --> src/regex/parser.rs:19:17 | 19 | pub(crate) type ParseResult<T> = core::result::Result<T, Vec<ParseError>>; | ^^^^^^^^^^^
struct `Parser` is never constructed: src/regex/parser.rs#L13
warning: struct `Parser` is never constructed --> src/regex/parser.rs:13:19 | 13 | pub(crate) struct Parser<'a> { | ^^^^^^
variants `Match`, `Class`, and `Range` are never constructed: src/regex/ast.rs#L54
warning: variants `Match`, `Class`, and `Range` are never constructed --> src/regex/ast.rs:54:5 | 52 | pub(crate) enum GroupedLiteralKind { | ------------------ variants in this enum 53 | /// A single token (unicode character constructs can consist multiple characters). 54 | Match(char), | ^^^^^ 55 | /// A shorthand for character groups (e.g., `\w`, `\D`, `.`). 56 | Class(tokenizer::ClassKind), | ^^^^^ 57 | /// A character range (e.g., `0-1`, `a-z`). 58 | Range(char, char), | ^^^^^ | = note: `GroupedLiteralKind` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
variants `Match`, `Class`, and `Group` are never constructed: src/regex/ast.rs#L40
warning: variants `Match`, `Class`, and `Group` are never constructed --> src/regex/ast.rs:40:5 | 38 | pub(crate) enum LiteralKind { | ----------- variants in this enum 39 | /// A single token (unicode character constructs can consist multiple characters). 40 | Match(char), | ^^^^^ 41 | /// A shorthand for character groups (e.g., `\w`, `\D`, `.`). 42 | Class(tokenizer::ClassKind), | ^^^^^ 43 | /// A group of characters (e.g. `[^a-cl47i]`). 44 | Group { | ^^^^^ | = note: `LiteralKind` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
variants `Concat`, `Empty`, `Alt`, `Lit`, and `Group` are never constructed: src/regex/ast.rs#L25
warning: variants `Concat`, `Empty`, `Alt`, `Lit`, and `Group` are never constructed --> src/regex/ast.rs:25:5 | 23 | pub(crate) enum ExprKind { | -------- variants in this enum 24 | /// Concatenation of regular expressions. 25 | Concat(Vec<ExprKind>), | ^^^^^^ 26 | /// An empty regex expresion. 27 | Empty, | ^^^^^ 28 | /// An alternative expression (e.g., `<expression> | <expression>`). 29 | Alt(Box<ExprKind>, Box<ExprKind>), | ^^^ 30 | /// A literal (e.g., `a`, `[^ca]`, `[a-z]`, `[0-1]*`). 31 | Lit(LiteralKind, Option<tokenizer::QuantifierKind>), | ^^^ 32 | /// A grouped expression (e.g., `([a-z] | foo)`, `(ab[ac]){3,}`). 33 | Group(Box<ExprKind>, Option<tokenizer::QuantifierKind>), | ^^^^^ | = note: `ExprKind` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
associated function `new` is never used: src/fsm/nfa/sim.rs#L43
warning: associated function `new` is never used --> src/fsm/nfa/sim.rs:43:8 | 42 | impl<'a> NfaSimulator<'a> { | ------------------------- associated function in this implementation 43 | fn new(nfa: &'a Nfa) -> Self { | ^^^
associated function `new` is never used: src/fsm/nfa/sim.rs#L25
warning: associated function `new` is never used --> src/fsm/nfa/sim.rs:25:8 | 24 | impl<'a> Run<'a> { | ---------------- associated function in this implementation 25 | fn new(state: &'a State) -> Self { | ^^^
method `with_transition` is never used: src/fsm/nfa/model.rs#L281
warning: method `with_transition` is never used --> src/fsm/nfa/model.rs:281:19 | 222 | impl NfaBuilder { | --------------- method in this implementation ... 281 | pub(super) fn with_transition(mut self, start: StateId, end: StateId, input: Input) -> Self { | ^^^^^^^^^^^^^^^
field `start_state` is never read: src/fsm/nfa/model.rs#L21
warning: field `start_state` is never read --> src/fsm/nfa/model.rs:21:16 | 20 | pub(super) struct Nfa { | --- field in this struct 21 | pub(super) start_state: StateId, | ^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default