Small bugfix for re character class parsing
+ update to the printing of regexes
This commit is contained in:
parent
4ae4e2b12f
commit
8ed2fd41e1
|
@ -80,7 +80,7 @@ namespace lxs {
|
||||||
|
|
||||||
string PlusRE::toRe()
|
string PlusRE::toRe()
|
||||||
{
|
{
|
||||||
return "(" + e->toRe() + "+" + f->toRe() + ")";
|
return "(" + e->toRe() + "|" + f->toRe() + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
State PlusRE::toENFA(ENFA& enfa, State attach)
|
State PlusRE::toENFA(ENFA& enfa, State attach)
|
||||||
|
@ -242,7 +242,6 @@ namespace lxs {
|
||||||
|
|
||||||
if (idx >= input.size())
|
if (idx >= input.size())
|
||||||
throw SyntaxError("Unclosed character class");
|
throw SyntaxError("Unclosed character class");
|
||||||
idx++; //Eat the ]
|
|
||||||
|
|
||||||
for (int i = 0; i < 256; i++)
|
for (int i = 0; i < 256; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue