summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorihiro Tanaka <noritnk@kcn.ne.jp>2019-12-19 19:31:35 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2019-12-19 19:37:16 -0800
commitc1c1774fa44421051a52b1fce86565061d9f1ebe (patch)
tree269df981efdf6056840ae101426d05f083502833
parent2adf15c362c5541719f9c1a826e89a76a9f07cf1 (diff)
downloadgrep-c1c1774fa44421051a52b1fce86565061d9f1ebe.tar.gz
dfa: separate parse and compile phase
DFAMUST() must be called after parse and before tokens re-order which is introduced in commit 5c7a0371823876cca7a1347fa09ca26bbbff0c98, but both are executed in compilation phase. * lib/dfa.c (dfaparse): Change it to global function. (dfacomp): If first argument is NULL, skip parse. * lib/dfa.h: (dfaparse): Add a prototype.
-rw-r--r--src/dfasearch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dfasearch.c b/src/dfasearch.c
index 153281df..518c385f 100644
--- a/src/dfasearch.c
+++ b/src/dfasearch.c
@@ -202,8 +202,9 @@ GEAcompile (char *pattern, size_t size, reg_syntax_t syntax_bits)
else
motif = NULL;
- dfacomp (pattern, size, dc->dfa, 1);
+ dfaparse (pattern, size, dc->dfa);
kwsmusts (dc);
+ dfacomp (NULL, 0, dc->dfa, 1);
free (motif);