diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-09-12 01:35:30 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-09-12 01:35:30 +0200 |
| commit | e72e20e025ab14320c79c2dca75721a0a5e002bd (patch) | |
| tree | 3b2d0d90f38c80442ee518e000b4026e753c66c9 /boot/lexer.ll | |
| parent | 2d3ba9b352478e5a3d3add482f56f1c801965428 (diff) | |
| download | elna-e72e20e025ab14320c79c2dca75721a0a5e002bd.tar.gz | |
Allow random text after ending the module
Diffstat (limited to 'boot/lexer.ll')
| -rw-r--r-- | boot/lexer.ll | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/boot/lexer.ll b/boot/lexer.ll index e8dde7c..89eb4ed 100644 --- a/boot/lexer.ll +++ b/boot/lexer.ll @@ -55,6 +55,10 @@ EXPONENT [eE][+-]?[[:digit:]]+ %% %{ + if (driver.finished) + { + return yy::parser::make_YYEOF(this->location); + } this->location.step(); %} @@ -65,8 +69,17 @@ EXPONENT [eE][+-]?[[:digit:]]+ \n+ { this->location.step(); } + <<EOF>> { + driver.add_error<syntax_error>("Unterminated comment", this->comment_start); + BEGIN(INITIAL); + + return yy::parser::make_YYEOF(this->location); + } +} +\(\* { + this->comment_start = this->location; + BEGIN(IN_COMMENT); } -\(\* BEGIN(IN_COMMENT); [ \t\r] { this->location.step(); } |
