Skip to content

Fix escaping of { and } #68

Fix escaping of { and }

Fix escaping of { and } #68

Triggered via push July 26, 2023 12:46
Status Success
Total duration 1m 17s
Billable time 6m
Artifacts

ci.yml

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

Annotations

27 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
method `simulate` is never used: src/fsm/nfa/sim.rs#L145
warning: method `simulate` is never used --> src/fsm/nfa/sim.rs:145:19 | 144 | impl Nfa { | -------- method in this implementation 145 | pub(super) fn simulate(&self, input: &str) -> bool { | ^^^^^^^^
associated function `new` is never used: src/fsm/nfa/sim.rs#L41
warning: associated function `new` is never used --> src/fsm/nfa/sim.rs:41:8 | 40 | impl<'a> NfaSimulator<'a> { | ------------------------- associated function in this implementation 41 | 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 Run { | -------- associated function in this implementation 25 | fn new(state_id: StateId) -> Self { | ^^^
methods `with_transition` and `get_state` are never used: src/fsm/nfa/model.rs#L181
warning: methods `with_transition` and `get_state` are never used --> src/fsm/nfa/model.rs:181:19 | 133 | impl NfaBuilder { | --------------- methods in this implementation ... 181 | pub(super) fn with_transition(mut self, start: StateId, end: StateId, input: Input) -> Self { | ^^^^^^^^^^^^^^^ ... 217 | pub(super) fn get_state(&self, state_id: StateId) -> &State { | ^^^^^^^^^
method `eps_closure` is never used: src/fsm/nfa/model.rs#L69
warning: method `eps_closure` is never used --> src/fsm/nfa/model.rs:69:19 | 49 | impl Nfa { | -------- method in this implementation ... 69 | pub(super) fn eps_closure(&self, state_id: StateId) -> impl Iterator<Item = StateId> { | ^^^^^^^^^^^
field `start_state` is never read: src/fsm/nfa/model.rs#L12
warning: field `start_state` is never read --> src/fsm/nfa/model.rs:12:16 | 11 | pub(super) struct Nfa { | --- field in this struct 12 | 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
method `simulate` is never used: src/fsm/nfa/sim.rs#L145
warning: method `simulate` is never used --> src/fsm/nfa/sim.rs:145:19 | 144 | impl Nfa { | -------- method in this implementation 145 | pub(super) fn simulate(&self, input: &str) -> bool { | ^^^^^^^^
associated function `new` is never used: src/fsm/nfa/sim.rs#L41
warning: associated function `new` is never used --> src/fsm/nfa/sim.rs:41:8 | 40 | impl<'a> NfaSimulator<'a> { | ------------------------- associated function in this implementation 41 | 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 Run { | -------- associated function in this implementation 25 | fn new(state_id: StateId) -> Self { | ^^^
methods `with_transition` and `get_state` are never used: src/fsm/nfa/model.rs#L181
warning: methods `with_transition` and `get_state` are never used --> src/fsm/nfa/model.rs:181:19 | 133 | impl NfaBuilder { | --------------- methods in this implementation ... 181 | pub(super) fn with_transition(mut self, start: StateId, end: StateId, input: Input) -> Self { | ^^^^^^^^^^^^^^^ ... 217 | pub(super) fn get_state(&self, state_id: StateId) -> &State { | ^^^^^^^^^
method `eps_closure` is never used: src/fsm/nfa/model.rs#L69
warning: method `eps_closure` is never used --> src/fsm/nfa/model.rs:69:19 | 49 | impl Nfa { | -------- method in this implementation ... 69 | pub(super) fn eps_closure(&self, state_id: StateId) -> impl Iterator<Item = StateId> { | ^^^^^^^^^^^
field `start_state` is never read: src/fsm/nfa/model.rs#L12
warning: field `start_state` is never read --> src/fsm/nfa/model.rs:12:16 | 11 | pub(super) struct Nfa { | --- field in this struct 12 | pub(super) start_state: StateId, | ^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default