diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-12-22 18:32:21 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-12-22 18:32:21 +0200 |
commit | 6402c9480ffcd8610b1322a381f0c14a42d95083 (patch) | |
tree | bbf1f2c00923c562b1ff346b5a6b759d58920902 /node.c | |
parent | 2af62b50e5b9574c0e169fb4d99c4912e56eef1f (diff) | |
parent | af31a6de1bd15d4d5f5520ebfcb1d24239b9a683 (diff) | |
download | egawk-6402c9480ffcd8610b1322a381f0c14a42d95083.tar.gz egawk-6402c9480ffcd8610b1322a381f0c14a42d95083.tar.bz2 egawk-6402c9480ffcd8610b1322a381f0c14a42d95083.zip |
Merge branch 'master' into feature/fix-comments
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -444,6 +444,27 @@ make_str_node(const char *s, size_t len, int flags) return r; } +/* make_typed_regex --- make a typed regex node */ + +NODE * +make_typed_regex(const char *re, size_t len) +{ + NODE *n, *exp, *n2; + + exp = make_str_node(re, len, ALREADY_MALLOCED); + n = make_regnode(Node_regex, exp); + if (n == NULL) + fatal(_("could not make typed regex")); + + n2 = make_string(re, len); + n2->typed_re = n; + n2->numbr = 0; + n2->flags |= NUMCUR|STRCUR|REGEX; + n2->flags &= ~(STRING|NUMBER); + + return n2; +} + /* unref --- remove reference to a particular node */ |