Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

modify regex printing routine

  • Loading branch information...
commit 4df3f3f74fb216f653a32337f7729f22e6c8e728 1 parent 25a26c4
@sinya8282 authored
Showing with 9 additions and 6 deletions.
  1. +8 −5 src/recon.cc
  2. +1 −1  src/regex.cc
View
13 src/recon.cc
@@ -43,8 +43,13 @@ int main(int argc, char *argv[]) {
}
regen::Regex r = regen::Regex(regex, Regen::Options::Extended);
- r.Compile(Regen::Options::O0);
- if (minimize) r.MinimizeDFA();
+ if (generate == REGEN && !minimize) {
+ r.PrintRegex();
+ return 0;
+ } else {
+ r.Compile(Regen::Options::O0);
+ if (minimize) r.MinimizeDFA();
+ }
switch (generate) {
case CGEN:
@@ -54,9 +59,7 @@ int main(int argc, char *argv[]) {
r.MinimizeDFA();
regen::Generator::DotGenerate(r);
break;
- case REGEN:
- r.PrintRegex();
- break;
+ case REGEN: break; // Unreachable
}
return 0;
}
View
2  src/regex.cc
@@ -676,7 +676,7 @@ bool Regex::Compile(Regen::Options::CompileFlag olevel) {
if (!dfa_failure_ && !dfa_.Complete()) {
/* try create DFA. */
std::size_t limit = state_exprs_.size();
- limit = 1000; // default limitation is 1000 (it's may finish within a second).
+ limit = 10000; // default limitation is 10000 (it's may finish within a second).
dfa_failure_ = !dfa_.Construct(expr_root_, limit);
}
if (dfa_failure_) {
Please sign in to comment.
Something went wrong with that request. Please try again.