Fix ending in with #end in the file (#5)
* Update Parser.hx * Update Parser.hx
This commit is contained in:
+8
-3
@@ -2003,9 +2003,14 @@ class Parser {
|
||||
var pos = readPos;
|
||||
while( true ) {
|
||||
var tk = token();
|
||||
// TODO: Fix ending in with #end in the file
|
||||
if( tk == TEof )
|
||||
error(EInvalidPreprocessor("Unclosed"), pos, pos);
|
||||
|
||||
if( tk == TEof ) {
|
||||
if (preprocStack.length != 0) {
|
||||
error(EInvalidPreprocessor("Unclosed"), pos, pos);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( preprocStack[spos] != obj ) {
|
||||
push(tk);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user