diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-09-01 20:46:12 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-09-01 20:46:12 +0300 |
commit | b02f580f06996bd88f741f9c7330aff79216a169 (patch) | |
tree | 7bf557815e612b7bc1f9ea9cbc2dfc66781e175e /re.c | |
parent | af43bad53b2f05ba0d4403a59433f587a1e32b22 (diff) | |
download | egawk-b02f580f06996bd88f741f9c7330aff79216a169.tar.gz egawk-b02f580f06996bd88f741f9c7330aff79216a169.tar.bz2 egawk-b02f580f06996bd88f741f9c7330aff79216a169.zip |
Merge multithreaded dfa into gawk.
Diffstat (limited to 're.c')
-rw-r--r-- | re.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -25,10 +25,14 @@ #include "awk.h" +#include "localeinfo.h" + static reg_syntax_t syn; static void check_bracket_exp(char *s, size_t len); const char *regexflags2str(int flags); +static struct localeinfo localeinfo; + /* make_regexp --- generate compiled regular expressions */ Regexp * @@ -223,7 +227,7 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal) rp->pat.newline_anchor = false; /* don't get \n in middle of string */ if (dfa && ! no_dfa) { rp->dfareg = dfaalloc(); - dfasyntax(rp->dfareg, dfa_syn, ignorecase, '\n'); + dfasyntax(rp->dfareg, & localeinfo, dfa_syn, ignorecase, '\n'); dfacomp(buf, len, rp->dfareg, true); } else rp->dfareg = NULL; @@ -395,6 +399,9 @@ re_update(NODE *t) void resetup() { + // init localeinfo for dfa + init_localeinfo(& localeinfo); + /* * Syntax bits: _that_ is yet another mind trip. Recreational drugs * are helpful for recovering from the experience. @@ -418,8 +425,14 @@ resetup() syn |= RE_INTERVALS | RE_INVALID_INTERVAL_ORD | RE_NO_BK_BRACES; (void) re_set_syntax(syn); +} + +/* using_utf8 --- are we using utf8 */ - dfa_init(); +bool +using_utf8(void) +{ + return localeinfo.using_utf8; } /* reisstring --- return true if the RE match is a simple string match */ |