diff options
author | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2010-10-11 21:10:07 +0000 |
---|---|---|
committer | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2010-10-11 21:10:07 +0000 |
commit | f815aa9b59892a6c7cd2823c3c2a2424e616d4f2 (patch) | |
tree | a4d6a23f2eeaade4176cda64867784ead68a2d21 /parsing | |
parent | 85e52dd8deaaea8dded6be09e7f733c949fd54c5 (diff) |
Backporting r13521 from branch 8.3 to trunk (fixing bug #2406, looping
on unsupported unicode character) + forbidding unsupported unicode in
Notation declarations too.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13526 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'parsing')
-rw-r--r-- | parsing/lexer.ml4 | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/parsing/lexer.ml4 b/parsing/lexer.ml4 index 15cdc6077..3c392acb6 100644 --- a/parsing/lexer.ml4 +++ b/parsing/lexer.ml4 @@ -158,7 +158,7 @@ let lookup_utf8_tail c cs = | _ -> error_utf8 cs in try classify_unicode unicode, n - with UnsupportedUtf8 -> error_unsupported_unicode_character n cs + with UnsupportedUtf8 -> njunk n cs; error_unsupported_unicode_character n cs let lookup_utf8 cs = match Stream.peek cs with @@ -169,8 +169,11 @@ let lookup_utf8 cs = let check_special_token str = let rec loop_symb = parser | [< ' (' ' | '\n' | '\r' | '\t' | '"') >] -> bad_token str - | [< _ = Stream.empty >] -> () - | [< '_ ; s >] -> loop_symb s + | [< s >] -> + match lookup_utf8 s with + | Utf8Token (_,n) -> njunk n s; loop_symb s + | AsciiChar -> Stream.junk s; loop_symb s + | EmptyStream -> () in loop_symb (Stream.of_string str) |