mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 15:14:35 +00:00
Improved error printing torquescript
Added a vector that can lookback across x number of lines in a file, if not a file just print out the error.
This commit is contained in:
parent
f82082f59f
commit
8cf5fac497
4 changed files with 130 additions and 110 deletions
|
|
@ -55,7 +55,7 @@ static int Sc_ScanIdent();
|
|||
#define FLEX_DEBUG 0
|
||||
#endif
|
||||
|
||||
char linebuf[512];
|
||||
Vector<String> lines;
|
||||
|
||||
// Install our own input code...
|
||||
#undef CMDgetc
|
||||
|
|
@ -116,7 +116,13 @@ HEXDIGIT [a-fA-F0-9]
|
|||
("///"([^/\n\r][^\n\r]*)?[\n\r]+)+ { return(Sc_ScanDocBlock()); }
|
||||
"//"[^\n\r]* ;
|
||||
[\r] ;
|
||||
\n.* { yycolumn = 1; dStrcpy(linebuf, yytext + 1, sizeof(linebuf)); yyless(1); }
|
||||
\n.* { yycolumn = 1;
|
||||
lines.push_back(String::ToString("%s", yytext+1));
|
||||
if (lines.size() > Con::getIntVariable("$scriptErrorLineCount", 10))
|
||||
lines.erase(lines.begin());
|
||||
|
||||
yyless(1);
|
||||
}
|
||||
\"(\\.|[^\\"\n\r])*\" { return(Sc_ScanString(STRATOM)); }
|
||||
\'(\\.|[^\\'\n\r])*\' { return(Sc_ScanString(TAGATOM)); }
|
||||
"==" { CMDlval.i = MakeToken< int >( opEQ, yylineno ); return opEQ; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue