Disable parser debug output
This commit is contained in:
parent
48704295bb
commit
a4c5546876
@ -432,14 +432,14 @@ class <%= @classname %>
|
|||||||
{
|
{
|
||||||
if (shifts[i].symbol == symbol)
|
if (shifts[i].symbol == symbol)
|
||||||
{
|
{
|
||||||
if (symbol < _TOKEN_COUNT)
|
// if (symbol < _TOKEN_COUNT)
|
||||||
{
|
// {
|
||||||
writeln("Shifting ", token_names[symbol]);
|
// writeln("Shifting ", token_names[symbol]);
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
writeln("Shifting rule set ", symbol);
|
// writeln("Shifting rule set ", symbol);
|
||||||
}
|
// }
|
||||||
return shifts[i].state;
|
return shifts[i].state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -455,19 +455,19 @@ class <%= @classname %>
|
|||||||
if ((reduces[i].token == token) ||
|
if ((reduces[i].token == token) ||
|
||||||
(reduces[i].token == _TOKEN_NONE))
|
(reduces[i].token == _TOKEN_NONE))
|
||||||
{
|
{
|
||||||
write("Reducing rule ", reduces[i].rule, ", rule set ", reduces[i].rule_set, " lookahead ");
|
// write("Reducing rule ", reduces[i].rule, ", rule set ", reduces[i].rule_set, " lookahead ");
|
||||||
if (token < _TOKEN_COUNT)
|
// if (token < _TOKEN_COUNT)
|
||||||
{
|
// {
|
||||||
writeln(token_names[token]);
|
// writeln(token_names[token]);
|
||||||
}
|
// }
|
||||||
else if (token == _TOKEN_EOF)
|
// else if (token == _TOKEN_EOF)
|
||||||
{
|
// {
|
||||||
writeln("{EOF}");
|
// writeln("{EOF}");
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
writeln("{other}");
|
// writeln("{other}");
|
||||||
}
|
// }
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,8 @@ unittest
|
|||||||
string input = "abcdef";
|
string input = "abcdef";
|
||||||
auto parser = new Testparser.Parser(cast(const(ubyte) *)input.ptr, input.length);
|
auto parser = new Testparser.Parser(cast(const(ubyte) *)input.ptr, input.length);
|
||||||
assert(parser.parse() == true);
|
assert(parser.parse() == true);
|
||||||
writeln("pass1");
|
|
||||||
|
|
||||||
input = "abcabcdef";
|
input = "abcabcdef";
|
||||||
parser = new Testparser.Parser(cast(const(ubyte) *)input.ptr, input.length);
|
parser = new Testparser.Parser(cast(const(ubyte) *)input.ptr, input.length);
|
||||||
assert(parser.parse() == true);
|
assert(parser.parse() == true);
|
||||||
writeln("pass2");
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user