32 Commits

Author SHA1 Message Date
Justin Viiret
1ef87c43ee noncopyable: switch over from boost 2017-04-26 15:18:26 +10:00
Justin Viiret
5dfae12a62 ng: split NGWrapper into NGHolder, ExpressionInfo
We now use NGHolder for all graph information, while other expression
properties (report, flag information, etc) go in new class
ExpressionInfo.
2017-04-26 15:18:09 +10:00
Anatoly Burakov
2de6706df2 Adding support for compiling approximate matching patterns
Adds new "edit_distance" extparam
2017-04-26 15:11:39 +10:00
Justin Viiret
1245156f44 parser: handle "control verbs" without close paren 2017-04-26 14:59:02 +10:00
Justin Viiret
084596bb5e parser: check for std::out_of_range from stoul 2017-04-26 14:58:46 +10:00
Justin Viiret
bef6889844 parser: use control_verb parser inline 2017-04-26 14:58:43 +10:00
Justin Viiret
bfc8be5675 parser: use stoul(), not strtol() 2017-04-26 14:57:53 +10:00
Justin Viiret
4def0c8a52 parser: switch to using char* pointers 2017-04-26 14:57:53 +10:00
Justin Viiret
1875d55cf1 parser: add initial parser for control verbs
This more reliably handles control verbs like (*UTF8) that can only
happen at the start of the pattern, and allows them in any ordering.
2017-04-26 14:57:46 +10:00
Justin Viiret
cacf07fe9b prefilter: workaround for \b in UCP and !UTF8 mode
For now, just drop the assertion (which will still return a superset of
matches, as per prefiltering semantics).
2017-01-20 09:19:51 +11:00
Justin Viiret
67e450115a parser: ignore \E that is not preceded by \Q
This conforms to PCRE's behaviour, where an isolated \E that is not
preceded by \Q is ignored.
2016-08-10 15:08:01 +10:00
Matthew Barr
cbd115f7fe Don't shadow names 2016-08-10 15:06:57 +10:00
Alex Coyte
5c5ec905cc violet: initial implementation 2016-08-10 15:01:08 +10:00
Justin Viiret
97eaea043e ucp_table: clean up make_caseless 2016-05-18 16:28:22 +10:00
Justin Viiret
f48b8c937b ucp_table: don't always deref rv of lower_bound
Fixes a warning from asan.
2016-05-18 16:28:17 +10:00
Justin Viiret
1bc12139a2 ComponentCondReference: mark ctors explicit 2016-04-20 13:34:53 +10:00
Justin Viiret
4e80d22d79 Use using directives to silence hiding warning 2016-04-20 13:34:53 +10:00
Justin Viiret
e92a20e5fa ComponentRepeat: remove firsts_cache, precalc code
Firsts are easy to compute in ComponentRepeat::first() now.
2016-03-01 11:22:45 +11:00
Justin Viiret
3d049d6de3 ComponentRepeat: wire X{0,N} and (X?){N} the same 2016-03-01 11:22:45 +11:00
Justin Viiret
997c0c9efd ComponentRepeat: wire R{0,N} as (R{1,N})?
Change the way that we wire up the edges in a bounded repeat to avoid
large fan-out from predecessors.
2016-03-01 11:22:45 +11:00
Justin Viiret
205bc1af7f PCRE includes U+180E in /[:print:]/8W 2015-12-07 09:10:12 +11:00
Justin Viiret
f9b7e806b1 Update defn of class [:punct:] for PCRE 8.38 2015-12-07 09:08:46 +11:00
Justin Viiret
25a01e1c3c Unify handling of caseless flag in class parser
Apply caselessness to each element added to a class, rather than all at
finalize time (which required separated ucp dnf and-ucp working data).

Unifies the behaviour of AsciiComponentClass and Utf8ComponentClass in
this respect.
2015-12-07 09:07:37 +11:00
Justin Viiret
bdb7a10034 Fix defn of POSIX graph, print, punct classes
The POSIX classes [:graph:], [:print:] and [:punct:] are handled
specially in UCP mode by PCRE. This change matches that behaviour.
2015-12-07 09:06:23 +11:00
Justin Viiret
fd19168025 Restore \Q..\E support in character classes 2015-11-18 15:27:05 +11:00
Justin Viiret
9cffa7666f Refine ComponentClass::class_empty
ComponentClass::class_empty should only be used on finalized classes to
determine whether a given class contains any elements; it should not
take the cr_ucp or cps_ucp into account, as they have been folden in by
the finalize call.

Fixes our failure to identify that the pattern /[^\D\d]/8W can never
match.
2015-11-10 14:36:39 +11:00
Justin Viiret
c68bfe05d8 Don't use class_empty in early class parsing
Instead, explicitly track whether we're still in the early class parsing
machine.
2015-11-10 14:36:39 +11:00
Justin Viiret
b1f6a539c7 Remove dead ComponentClass::{get,set}FirstChar 2015-11-10 14:36:39 +11:00
Justin Viiret
9a7b912a5d Rework parser rejection for POSIX collating elems
Implement rejection of POSIX collating elements ("[.ch.]" and "[=ch=]"
entirely in the Ragel parser, using the same approach both inside and
ouside character classes.

Fix buggy rejection of [^.ch.], which we should accept as a character
class.
2015-11-10 14:36:39 +11:00
Justin Viiret
4c53bd4641 parser: use 'override' keyword in subclasses 2015-11-10 14:36:38 +11:00
Justin Viiret
1afc591c30 Check for (and throw on) large min repeat
We were only checking for large maximum bounds, which meant that we
would attempt to compile A{N,} where N is huge.
2015-10-30 11:28:37 +11:00
Matthew Barr
904e436f11 Initial commit of Hyperscan 2015-10-20 09:13:35 +11:00