mirror of
https://github.com/irmen/prog8.git
synced 2025-01-12 04:30:03 +00:00
avoid crash when parser doesn't report an offending token for a parse error
This commit is contained in:
parent
4011dce31b
commit
40bf117497
@ -98,7 +98,11 @@ object Prog8Parser {
|
||||
TODO("no RecognitionException - create your own ParseError")
|
||||
//throw ParseError()
|
||||
} else {
|
||||
throw ParseError(msg, e.getPosition(src.origin), e)
|
||||
if(e.offendingToken==null) {
|
||||
throw ParseError(msg, Position(src.origin, line, charPositionInLine, charPositionInLine), e)
|
||||
} else {
|
||||
throw ParseError(msg, e.getPosition(src.origin), e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user