diff --git a/src/re.cpp b/src/re.cpp index 550f7f3..e78cc80 100644 --- a/src/re.cpp +++ b/src/re.cpp @@ -80,7 +80,7 @@ namespace lxs { string PlusRE::toRe() { - return "(" + e->toRe() + "+" + f->toRe() + ")"; + return "(" + e->toRe() + "|" + f->toRe() + ")"; } State PlusRE::toENFA(ENFA& enfa, State attach) @@ -242,7 +242,6 @@ namespace lxs { if (idx >= input.size()) throw SyntaxError("Unclosed character class"); - idx++; //Eat the ] for (int i = 0; i < 256; i++) {