Throw exceptions (not errors) from lexer

+ Add more data to the exception message
This commit is contained in:
Andrey Breslav
2014-05-27 18:17:18 +04:00
parent 453fdb0dbe
commit e50eb73fb1
5 changed files with 42 additions and 9 deletions
+6
View File
@@ -36,6 +36,12 @@
<target name="lexer">
<flex flexfile="${home}/src/org/jetbrains/jet/lexer/Jet.flex"
destdir="${home}/src/org/jetbrains/jet/lexer/"/>
<!-- This is a hack, but we don't want to alter the skeleton we are using now, because being in sync with IDEA is more important-->
<replaceregexp file="${home}/src/org/jetbrains/jet/lexer/_JetLexer.java"
match="throw new KotlinLexerException\(message\);"
replace="throw new KotlinLexerException(message + &quot;\\\\n at '&quot; + yytext() + &quot;'\\\\n&quot; + zzBuffer);"/>
<flex flexfile="${home}/src/org/jetbrains/jet/kdoc/lexer/KDoc.flex"
destdir="${home}/src/org/jetbrains/jet/kdoc/lexer/"/>
</target>