aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/comp/front/lexer.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/comp/front/lexer.rs b/src/comp/front/lexer.rs
index eab62069..32f21531 100644
--- a/src/comp/front/lexer.rs
+++ b/src/comp/front/lexer.rs
@@ -327,6 +327,10 @@ fn consume_any_line_comment(reader rdr) {
fn consume_block_comment(reader rdr) {
let int level = 1;
while (level > 0) {
+ if (rdr.is_eof()) {
+ rdr.err("unterminated block comment");
+ fail;
+ }
if (rdr.curr() == '/' && rdr.next() == '*') {
rdr.bump();
rdr.bump();
@@ -340,10 +344,6 @@ fn consume_block_comment(reader rdr) {
rdr.bump();
}
}
- if (rdr.is_eof()) {
- rdr.err("unterminated block comment");
- fail;
- }
}
// restart whitespace munch.
be consume_any_whitespace(rdr);