Fix ending in with #end in the file (#5)

* Update Parser.hx

* Update Parser.hx
This commit is contained in:
Redar13
2024-11-06 16:39:09 +01:00
committed by GitHub
parent f18c7a2210
commit 3a5c4f2164
+8 -3
View File
@@ -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;