Browse Source

give proper error on ridiculous #line numbers (closes #5551)

Simon Krajewski 9 years ago
parent
commit
6128db4509
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/syntax/parser.ml

+ 1 - 1
src/syntax/parser.ml

@@ -1675,7 +1675,7 @@ let parse ctx code =
 			| _ -> error Unimplemented (snd tk))
 		| Sharp "line" ->
 			let line = (match next_token() with
-				| (Const (Int s),_) -> int_of_string s
+				| (Const (Int s),p) -> (try int_of_string s with _ -> error (Custom ("Could not parse ridiculous line number " ^ s)) p)
 				| (t,p) -> error (Unexpected t) p
 			) in
 			!(Lexer.cur).Lexer.lline <- line - 1;