Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit111cda0

Browse files
backout option propogation
1 parent8cfd76f commit111cda0

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

‎src/compile.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,6 @@ impl Compiler {
106106
}
107107
}
108108

109-
fnnew_with_options(max_group:usize,options:&RegexOptions) ->Compiler{
110-
Compiler{
111-
b:VMBuilder::new(max_group),
112-
options: options.clone(),
113-
}
114-
}
115-
116109
fnvisit(&mutself,info:&Info<'_>,hard:bool) ->Result<()>{
117110
if !hard && !info.hard{
118111
// easy case, delegate entire subexpr
@@ -532,16 +525,7 @@ pub(crate) fn compile_inner(inner_re: &str, options: &RegexOptions) -> Result<Ra
532525

533526
/// Compile the analyzed expressions into a program.
534527
pubfncompile(info:&Info<'_>) ->Result<Prog>{
535-
compile_with_options(info,None)
536-
}
537-
538-
/// Compile the analyzed expressions into a program.
539-
pubfncompile_with_options(info:&Info<'_>,options:Option<&RegexOptions>) ->Result<Prog>{
540-
letmut c =ifletSome(opts) = options{
541-
Compiler::new_with_options(info.end_group, opts)
542-
}else{
543-
Compiler::new(info.end_group)
544-
};
528+
letmut c =Compiler::new(info.end_group);
545529
c.visit(info,false)?;
546530
c.b.add(Insn::End);
547531
Ok(c.b.build())

‎src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ mod replacer;
209209
mod vm;
210210

211211
usecrate::analyze::analyze;
212-
usecrate::compile::compile_with_options;
212+
usecrate::compile::compile;
213213
usecrate::parse::{ExprTree,NamedGroups,Parser};
214214
usecrate::regexflags::*;
215215
usecrate::vm::{Prog,OPTION_SKIPPED_EMPTY_MATCH};
@@ -724,7 +724,7 @@ impl Regex {
724724
});
725725
}
726726

727-
let prog =compile_with_options(&info,Some(&options))?;
727+
let prog =compile(&info)?;
728728
Ok(Regex{
729729
inner:RegexImpl::Fancy{
730730
prog,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp