mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
clear
clear lines, and dont try to print lines when there is no file.
This commit is contained in:
parent
eeb002ce6b
commit
8140ed9b64
4 changed files with 20 additions and 12 deletions
|
|
@ -645,15 +645,18 @@ yyreport_syntax_error (const yypcontext_t *ctx)
|
||||||
output += String::ToString("%s %s", i == 0 ? ": expected" : "or", yysymbol_name(expected[i]));
|
output += String::ToString("%s %s", i == 0 ? ": expected" : "or", yysymbol_name(expected[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lines.size() > 0)
|
if(CMDGetCurrentFile())
|
||||||
{
|
{
|
||||||
output += "\n";
|
if (lines.size() > 0)
|
||||||
for (int i = 0; i < lines.size(); i++)
|
|
||||||
{
|
{
|
||||||
int line = lines.size() - i;
|
output += "\n";
|
||||||
output += String::ToString("%5d | ", loc->first_line - (line-1)) + lines[i] + "\n";
|
for (int i = 0; i < lines.size(); i++)
|
||||||
|
{
|
||||||
|
int line = lines.size() - i;
|
||||||
|
output += String::ToString("%5d | ", loc->first_line - (line-1)) + lines[i] + "\n";
|
||||||
|
}
|
||||||
|
output += String::ToString("%5s | %*s", "", loc->first_column, "^");
|
||||||
}
|
}
|
||||||
output += String::ToString("%5s | %*s", "", loc->first_column, "^");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
yyerror(output.c_str());
|
yyerror(output.c_str());
|
||||||
|
|
|
||||||
|
|
@ -2742,6 +2742,7 @@ void CMDSetScanBuffer(const char *sb, const char *fn)
|
||||||
fileName = fn;
|
fileName = fn;
|
||||||
scanIndex = 0;
|
scanIndex = 0;
|
||||||
yylineno = 1;
|
yylineno = 1;
|
||||||
|
lines.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
int CMDgetc()
|
int CMDgetc()
|
||||||
|
|
|
||||||
|
|
@ -292,6 +292,7 @@ void CMDSetScanBuffer(const char *sb, const char *fn)
|
||||||
fileName = fn;
|
fileName = fn;
|
||||||
scanIndex = 0;
|
scanIndex = 0;
|
||||||
yylineno = 1;
|
yylineno = 1;
|
||||||
|
lines.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
int CMDgetc()
|
int CMDgetc()
|
||||||
|
|
|
||||||
|
|
@ -3352,15 +3352,18 @@ yyreport_syntax_error (const yypcontext_t *ctx)
|
||||||
output += String::ToString("%s %s", i == 0 ? ": expected" : "or", yysymbol_name(expected[i]));
|
output += String::ToString("%s %s", i == 0 ? ": expected" : "or", yysymbol_name(expected[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lines.size() > 0)
|
if(CMDGetCurrentFile())
|
||||||
{
|
{
|
||||||
output += "\n";
|
if (lines.size() > 0)
|
||||||
for (int i = 0; i < lines.size(); i++)
|
|
||||||
{
|
{
|
||||||
int line = lines.size() - i;
|
output += "\n";
|
||||||
output += String::ToString("%5d | ", loc->first_line - (line-1)) + lines[i] + "\n";
|
for (int i = 0; i < lines.size(); i++)
|
||||||
|
{
|
||||||
|
int line = lines.size() - i;
|
||||||
|
output += String::ToString("%5d | ", loc->first_line - (line-1)) + lines[i] + "\n";
|
||||||
|
}
|
||||||
|
output += String::ToString("%5s | %*s", "", loc->first_column, "^");
|
||||||
}
|
}
|
||||||
output += String::ToString("%5s | %*s", "", loc->first_column, "^");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
yyerror(output.c_str());
|
yyerror(output.c_str());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue