|
From: | Paul Eggert |
Subject: | Re: [Grep-devel] proposed new function for dfa |
Date: | Tue, 22 Nov 2016 23:12:23 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
address@hidden wrote:
Why check whether TO and FROM are non-null?Why not? Or is a core dump better? (Serious question.)
Yes, a core dump is better if the philosophy is to fail hard rather than sweep software errors under the rug, which is the approach used elsewhere in dfa.c. For example, on my platform dfasyntax crashes reliably if its first argument is a null pointer.
$1 ~ $2 { .... } The second field on each line is compiled as a regexp, for every line. There's no reason to recompute all the syntax settings every time since the syntax bits don't change over any given invocation of gawk.
Isn't the cost of recomputing syntax settings dwarfed by the cost of compiling the regexp?
[Prev in Thread] | Current Thread | [Next in Thread] |