Small bugfix for re character class parsing

+ update to the printing of regexes
This commit is contained in:
Robin Jadoul 2016-05-24 18:09:21 +02:00
parent 4ae4e2b12f
commit 8ed2fd41e1
1 changed files with 1 additions and 2 deletions

View File

@ -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++)
{