mirror of
https://github.com/ksherlock/mpw.git
synced 2024-11-24 13:32:39 +00:00
fix template lexer errors.
This commit is contained in:
parent
427a4a6f31
commit
15d0eded63
@ -228,33 +228,21 @@ bool LoadTemplateFile(const std::string &filename, std::unordered_map<std::strin
|
||||
const char *te;
|
||||
int cs, act;
|
||||
|
||||
for(;;)
|
||||
%% write init;
|
||||
%% write exec;
|
||||
|
||||
if (cs == lexer_error || cs < lexer_first_final)
|
||||
{
|
||||
|
||||
%% write init;
|
||||
%% write exec;
|
||||
|
||||
if (cs == lexer_error)
|
||||
{
|
||||
if (p == eof)
|
||||
fprintf(stderr, "Template error: line %d - unexpected EOF\n", info.LineNumber);
|
||||
else
|
||||
fprintf(stderr, "Template error: line %d - illegal character: `%c'\n", info.LineNumber, *p);
|
||||
TemplateParseFree(parser, free);
|
||||
munmap(buffer, st.st_size);
|
||||
return false;
|
||||
}
|
||||
if (cs == lexer_en_error)
|
||||
{
|
||||
TemplateParseFree(parser, free);
|
||||
munmap(buffer, st.st_size);
|
||||
return false;
|
||||
}
|
||||
if (p == pe)
|
||||
{
|
||||
// ?
|
||||
//TemplateParse(parser, tkEOF, 0);
|
||||
break;
|
||||
}
|
||||
TemplateParseFree(parser, free);
|
||||
munmap(buffer, st.st_size);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
TemplateParse(parser, 0, 0);
|
||||
TemplateParseFree(parser, free);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user