Improved error message (added character position.
This commit is contained in:
parent
9141f8ead4
commit
867df13019
|
@ -153,7 +153,7 @@ object LaTeXLexer extends RegexParsers {
|
||||||
|
|
||||||
def apply(code: String): Either[LaTeXLexerError, List[LaTeXToken]] = {
|
def apply(code: String): Either[LaTeXLexerError, List[LaTeXToken]] = {
|
||||||
parse(tokens, code) match {
|
parse(tokens, code) match {
|
||||||
case NoSuccess(msg, next) => Left(LaTeXLexerError(msg))
|
case NoSuccess(msg, next) => Left(LaTeXLexerError(msg + "at position "+next.pos))
|
||||||
case Success(result, next) => Right(result)
|
case Success(result, next) => Right(result)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue