From 8ed2fd41e13d548b82c40c58a3af8174a822a543 Mon Sep 17 00:00:00 2001 From: Robin Jadoul Date: Tue, 24 May 2016 18:09:21 +0200 Subject: [PATCH] Small bugfix for re character class parsing + update to the printing of regexes --- src/re.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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++) {