From fabeab1ee160819616ed4b98fcc39a29aa0eb293 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 4 Oct 2017 23:00:19 +0800 Subject: [PATCH] Regex: reorder lookaround ops, group by direction --- src/regex_impl.cc | 10 +++++----- src/regex_impl.hh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/regex_impl.cc b/src/regex_impl.cc index 9ede5989..3e6cd832 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -30,8 +30,8 @@ struct ParsedRegex SubjectEnd, ResetStart, LookAhead, - LookBehind, NegativeLookAhead, + LookBehind, NegativeLookBehind, }; @@ -572,14 +572,14 @@ private: push_op(CompiledRegex::LookAhead); push_string(node->children); break; - case ParsedRegex::LookBehind: - push_op(CompiledRegex::LookBehind); - push_string(node->children, true); - break; case ParsedRegex::NegativeLookAhead: push_op(CompiledRegex::NegativeLookAhead); push_string(node->children); break; + case ParsedRegex::LookBehind: + push_op(CompiledRegex::LookBehind); + push_string(node->children, true); + break; case ParsedRegex::NegativeLookBehind: push_op(CompiledRegex::NegativeLookBehind); push_string(node->children, true); diff --git a/src/regex_impl.hh b/src/regex_impl.hh index f6f79baf..0c15b57a 100644 --- a/src/regex_impl.hh +++ b/src/regex_impl.hh @@ -30,8 +30,8 @@ struct CompiledRegex SubjectBegin, SubjectEnd, LookAhead, - LookBehind, NegativeLookAhead, + LookBehind, NegativeLookBehind, };