summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-09-19 11:57:02 +0900
committerMaxime Coste <mawww@kakoune.org>2017-11-01 14:05:14 +0800
commitad546e516af06eb5cc624af13abb8bd2fac499f5 (patch)
tree19585244a5c605d4f8af0e7fc19632b5059c6622 /src
parent46a113e10a3a2ea151dba70c31b9f8fa2dad66d0 (diff)
Regex: Small comment tweaks
Diffstat (limited to 'src')
-rw-r--r--src/regex_impl.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/regex_impl.cc b/src/regex_impl.cc
index caeec8b5..db180a15 100644
--- a/src/regex_impl.cc
+++ b/src/regex_impl.cc
@@ -89,6 +89,8 @@ AstNodePtr make_ast_node(Op op, char value = 0,
return AstNodePtr{new AstNode{op, value, quantifier, {}}};
}
+// Recursive descent parser based on naming using in the ECMAScript
+// standard, although the syntax is not fully compatible.
template<typename Iterator>
struct Parser
{
@@ -147,7 +149,7 @@ private:
case '\'': pos += 2; return make_ast_node(Op::SubjectEnd);
}
break;
- /* TODO: \`, \', look ahead, look behind */
+ /* TODO: look ahead, look behind */
}
return nullptr;
}
@@ -559,8 +561,8 @@ auto test_regex = UnitTest{[]{
auto program = RegexCompiler::compile(re.begin(), re.end());
RegexProgram::dump(program);
Exec exec{program};
- kak_assert(exec.match(program, "tchou foo baz"));
- kak_assert(not exec.match(program, "tchoufoobaz"));
+ kak_assert(exec.match(program, "qux foo baz"));
+ kak_assert(not exec.match(program, "quxfoobaz"));
kak_assert(exec.match(program, "bar"));
kak_assert(not exec.match(program, "foobar"));
}