Start implementing NFA simulation #44
Annotations
31 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#L35
warning: multiple associated items are never used
--> src/regex/parser.rs:35:19
|
34 | impl<'a> Parser<'a> {
| ------------------- associated items in this implementation
35 | pub(crate) fn new(input: &'a str) -> Self {
| ^^^
...
42 | pub(crate) fn parse(&mut self) -> ParseResult<ast::Ast> {
| ^^^^^
...
57 | fn expression(&mut self) -> ParseResult<ast::ExprKind> {
| ^^^^^^^^^^
...
81 | fn sub_expression(&mut self) -> ParseResult<Vec<ast::ExprKind>> {
| ^^^^^^^^^^^^^^
...
105 | fn sub_expression_item(&mut self) -> ParseResult<ast::ExprKind> {
| ^^^^^^^^^^^^^^^^^^^
...
117 | fn group(&mut self) -> ParseResult<ast::ExprKind> {
| ^^^^^
...
165 | fn match_(&mut self) -> ParseResult<ast::ExprKind> {
| ^^^^^^
...
183 | fn match_item(&mut self) -> ParseResult<ast::LiteralKind> {
| ^^^^^^^^^^
...
216 | fn character_group(&mut self) -> ParseResult<ast::LiteralKind> {
| ^^^^^^^^^^^^^^^
...
270 | fn character_group_item(&mut self) -> ParseResult<ast::GroupedLiteralKind> {
| ^^^^^^^^^^^^^^^^^^^^
...
320 | fn get_current_token_position(&mut self) -> (usize, usize) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
type alias `ParseResult` is never used:
src/regex/parser.rs#L16
warning: type alias `ParseResult` is never used
--> src/regex/parser.rs:16:17
|
16 | pub(crate) type ParseResult<T> = core::result::Result<T, Vec<ParseError>>;
| ^^^^^^^^^^^
|
struct `Parser` is never constructed:
src/regex/parser.rs#L10
warning: struct `Parser` is never constructed
--> src/regex/parser.rs:10:19
|
10 | pub(crate) struct Parser<'a> {
| ^^^^^^
|
variants `Match`, `Class`, and `Range` are never constructed:
src/regex/ast.rs#L53
warning: variants `Match`, `Class`, and `Range` are never constructed
--> src/regex/ast.rs:53:5
|
51 | pub(crate) enum GroupedLiteralKind {
| ------------------ variants in this enum
52 | /// A single token (unicode character constructs can consist multiple characters).
53 | Match(char),
| ^^^^^
54 | /// A shorthand for character groups (e.g., `\w`, `\D`, `.`).
55 | Class(tokenizer::ClassKind),
| ^^^^^
56 | /// A character range (e.g., `0-1`, `a-z`).
57 | 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#L39
warning: variants `Match`, `Class`, and `Group` are never constructed
--> src/regex/ast.rs:39:5
|
37 | pub(crate) enum LiteralKind {
| ----------- variants in this enum
38 | /// A single token (unicode character constructs can consist multiple characters).
39 | Match(char),
| ^^^^^
40 | /// A shorthand for character groups (e.g., `\w`, `\D`, `.`).
41 | Class(tokenizer::ClassKind),
| ^^^^^
42 | /// A group of characters (e.g. `[^a-cl47i]`).
43 | 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#L24
warning: variants `Concat`, `Empty`, `Alt`, `Lit`, and `Group` are never constructed
--> src/regex/ast.rs:24:5
|
22 | pub(crate) enum ExprKind {
| -------- variants in this enum
23 | /// Concatenation of regular expressions.
24 | Concat(Vec<ExprKind>),
| ^^^^^^
25 | /// An empty regex expresion.
26 | Empty,
| ^^^^^
27 | /// An alternative expression (e.g., `<expression> | <expression>`).
28 | Alt(Box<ExprKind>, Box<ExprKind>),
| ^^^
29 | /// A literal (e.g., `a`, `[^ca]`, `[a-z]`, `[0-1]*`).
30 | Lit(LiteralKind, Option<tokenizer::QuantifierKind>),
| ^^^
31 | /// A grouped expression (e.g., `([a-z] | foo)`, `(ab[ac]){3,}`).
32 | 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#L8
warning: associated function `new` is never used
--> src/fsm/nfa/sim.rs:8:8
|
7 | impl<'a> NfaSimulator<'a> {
| ------------------------- associated function in this implementation
8 | fn new(nfa: &'a Nfa) -> Self {
| ^^^
|
field `nfa` is never read:
src/fsm/nfa/sim.rs#L4
warning: field `nfa` is never read
--> src/fsm/nfa/sim.rs:4:5
|
3 | struct NfaSimulator<'a> {
| ------------ field in this struct
4 | nfa: &'a Nfa,
| ^^^
|
method `with_transition` is never used:
src/fsm/nfa/model.rs#L165
warning: method `with_transition` is never used
--> src/fsm/nfa/model.rs:165:8
|
121 | impl NfaBuilder {
| --------------- method in this implementation
...
165 | fn with_transition(mut self, start: StateId, end: StateId, input: Input) -> Self {
| ^^^^^^^^^^^^^^^
|
methods `get_final_states` and `to_dot` are never used:
src/fsm/nfa/model.rs#L38
warning: methods `get_final_states` and `to_dot` are never used
--> src/fsm/nfa/model.rs:38:8
|
33 | impl Nfa {
| -------- methods in this implementation
...
38 | fn get_final_states(&self) -> impl Iterator<Item = &State> + '_ {
| ^^^^^^^^^^^^^^^^
...
43 | fn to_dot(&self) -> String {
| ^^^^^^
|
field `quantifier` is never read:
src/fsm/nfa/model.rs#L18
warning: field `quantifier` is never read
--> src/fsm/nfa/model.rs:18:5
|
14 | struct State {
| ----- field in this struct
...
18 | quantifier: Option<QuantifierKind>,
| ^^^^^^^^^^
|
fields `start_state` and `states` are never read:
src/fsm/nfa/model.rs#L10
warning: fields `start_state` and `states` are never read
--> src/fsm/nfa/model.rs:10:5
|
9 | pub(super) struct Nfa {
| --- fields in this struct
10 | start_state: StateId,
| ^^^^^^^^^^^
11 | states: Vec<State>,
| ^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
unused variable: `input`:
src/fsm/nfa/sim.rs#L22
warning: unused variable: `input`
--> src/fsm/nfa/sim.rs:22:28
|
22 | fn feed_str(&mut self, input: &str) -> bool {
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_input`
|
unused variable: `input`:
src/fsm/nfa/sim.rs#L18
warning: unused variable: `input`
--> src/fsm/nfa/sim.rs:18:24
|
18 | fn feed(&mut self, input: char) -> bool {
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_input`
|
= note: `#[warn(unused_variables)]` on 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#L35
warning: multiple associated items are never used
--> src/regex/parser.rs:35:19
|
34 | impl<'a> Parser<'a> {
| ------------------- associated items in this implementation
35 | pub(crate) fn new(input: &'a str) -> Self {
| ^^^
...
42 | pub(crate) fn parse(&mut self) -> ParseResult<ast::Ast> {
| ^^^^^
...
57 | fn expression(&mut self) -> ParseResult<ast::ExprKind> {
| ^^^^^^^^^^
...
81 | fn sub_expression(&mut self) -> ParseResult<Vec<ast::ExprKind>> {
| ^^^^^^^^^^^^^^
...
105 | fn sub_expression_item(&mut self) -> ParseResult<ast::ExprKind> {
| ^^^^^^^^^^^^^^^^^^^
...
117 | fn group(&mut self) -> ParseResult<ast::ExprKind> {
| ^^^^^
...
165 | fn match_(&mut self) -> ParseResult<ast::ExprKind> {
| ^^^^^^
...
183 | fn match_item(&mut self) -> ParseResult<ast::LiteralKind> {
| ^^^^^^^^^^
...
216 | fn character_group(&mut self) -> ParseResult<ast::LiteralKind> {
| ^^^^^^^^^^^^^^^
...
270 | fn character_group_item(&mut self) -> ParseResult<ast::GroupedLiteralKind> {
| ^^^^^^^^^^^^^^^^^^^^
...
320 | fn get_current_token_position(&mut self) -> (usize, usize) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
type alias `ParseResult` is never used:
src/regex/parser.rs#L16
warning: type alias `ParseResult` is never used
--> src/regex/parser.rs:16:17
|
16 | pub(crate) type ParseResult<T> = core::result::Result<T, Vec<ParseError>>;
| ^^^^^^^^^^^
|
struct `Parser` is never constructed:
src/regex/parser.rs#L10
warning: struct `Parser` is never constructed
--> src/regex/parser.rs:10:19
|
10 | pub(crate) struct Parser<'a> {
| ^^^^^^
|
variants `Match`, `Class`, and `Range` are never constructed:
src/regex/ast.rs#L53
warning: variants `Match`, `Class`, and `Range` are never constructed
--> src/regex/ast.rs:53:5
|
51 | pub(crate) enum GroupedLiteralKind {
| ------------------ variants in this enum
52 | /// A single token (unicode character constructs can consist multiple characters).
53 | Match(char),
| ^^^^^
54 | /// A shorthand for character groups (e.g., `\w`, `\D`, `.`).
55 | Class(tokenizer::ClassKind),
| ^^^^^
56 | /// A character range (e.g., `0-1`, `a-z`).
57 | 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#L39
warning: variants `Match`, `Class`, and `Group` are never constructed
--> src/regex/ast.rs:39:5
|
37 | pub(crate) enum LiteralKind {
| ----------- variants in this enum
38 | /// A single token (unicode character constructs can consist multiple characters).
39 | Match(char),
| ^^^^^
40 | /// A shorthand for character groups (e.g., `\w`, `\D`, `.`).
41 | Class(tokenizer::ClassKind),
| ^^^^^
42 | /// A group of characters (e.g. `[^a-cl47i]`).
43 | 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#L24
warning: variants `Concat`, `Empty`, `Alt`, `Lit`, and `Group` are never constructed
--> src/regex/ast.rs:24:5
|
22 | pub(crate) enum ExprKind {
| -------- variants in this enum
23 | /// Concatenation of regular expressions.
24 | Concat(Vec<ExprKind>),
| ^^^^^^
25 | /// An empty regex expresion.
26 | Empty,
| ^^^^^
27 | /// An alternative expression (e.g., `<expression> | <expression>`).
28 | Alt(Box<ExprKind>, Box<ExprKind>),
| ^^^
29 | /// A literal (e.g., `a`, `[^ca]`, `[a-z]`, `[0-1]*`).
30 | Lit(LiteralKind, Option<tokenizer::QuantifierKind>),
| ^^^
31 | /// A grouped expression (e.g., `([a-z] | foo)`, `(ab[ac]){3,}`).
32 | 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#L8
warning: associated function `new` is never used
--> src/fsm/nfa/sim.rs:8:8
|
7 | impl<'a> NfaSimulator<'a> {
| ------------------------- associated function in this implementation
8 | fn new(nfa: &'a Nfa) -> Self {
| ^^^
|
field `nfa` is never read:
src/fsm/nfa/sim.rs#L4
warning: field `nfa` is never read
--> src/fsm/nfa/sim.rs:4:5
|
3 | struct NfaSimulator<'a> {
| ------------ field in this struct
4 | nfa: &'a Nfa,
| ^^^
|
method `with_transition` is never used:
src/fsm/nfa/model.rs#L165
warning: method `with_transition` is never used
--> src/fsm/nfa/model.rs:165:8
|
121 | impl NfaBuilder {
| --------------- method in this implementation
...
165 | fn with_transition(mut self, start: StateId, end: StateId, input: Input) -> Self {
| ^^^^^^^^^^^^^^^
|
methods `get_final_states` and `to_dot` are never used:
src/fsm/nfa/model.rs#L38
warning: methods `get_final_states` and `to_dot` are never used
--> src/fsm/nfa/model.rs:38:8
|
33 | impl Nfa {
| -------- methods in this implementation
...
38 | fn get_final_states(&self) -> impl Iterator<Item = &State> + '_ {
| ^^^^^^^^^^^^^^^^
...
43 | fn to_dot(&self) -> String {
| ^^^^^^
|
field `quantifier` is never read:
src/fsm/nfa/model.rs#L18
warning: field `quantifier` is never read
--> src/fsm/nfa/model.rs:18:5
|
14 | struct State {
| ----- field in this struct
...
18 | quantifier: Option<QuantifierKind>,
| ^^^^^^^^^^
|
fields `start_state` and `states` are never read:
src/fsm/nfa/model.rs#L10
warning: fields `start_state` and `states` are never read
--> src/fsm/nfa/model.rs:10:5
|
9 | pub(super) struct Nfa {
| --- fields in this struct
10 | start_state: StateId,
| ^^^^^^^^^^^
11 | states: Vec<State>,
| ^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
unused variable: `input`:
src/fsm/nfa/sim.rs#L22
warning: unused variable: `input`
--> src/fsm/nfa/sim.rs:22:28
|
22 | fn feed_str(&mut self, input: &str) -> bool {
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_input`
|
unused variable: `input`:
src/fsm/nfa/sim.rs#L18
warning: unused variable: `input`
--> src/fsm/nfa/sim.rs:18:24
|
18 | fn feed(&mut self, input: char) -> bool {
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_input`
|
= note: `#[warn(unused_variables)]` 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/
|