aboutsummaryrefslogtreecommitdiffhomepage
path: root/parsing/cLexer.ml4
diff options
context:
space:
mode:
authorGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2016-11-18 11:49:25 +0100
committerGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2016-11-18 11:53:55 +0100
commit80cfb61c8c497a2d33a6b47fcdaa9d071223a502 (patch)
tree4371040b97d39647f9e8679e4d8e8a1a6b077a3a /parsing/cLexer.ml4
parent0f5e89ec54bc613f59ce971e6a95ed1161ffc37b (diff)
parentbdcf5b040b975a179fe9b2889fea0d38ae4689df (diff)
Merge branch 'v8.6'
Diffstat (limited to 'parsing/cLexer.ml4')
-rw-r--r--parsing/cLexer.ml424
1 files changed, 1 insertions, 23 deletions
diff --git a/parsing/cLexer.ml4 b/parsing/cLexer.ml4
index 69e4eb8d2..003fb6789 100644
--- a/parsing/cLexer.ml4
+++ b/parsing/cLexer.ml4
@@ -408,24 +408,6 @@ let comment_stop ep =
comment_begin := None;
between_commands := false
-(* Does not unescape!!! *)
-let rec comm_string loc bp = parser
- | [< ''"' >] -> push_string "\""; loc
- | [< ''\\'; loc =
- (parser [< ' ('"' | '\\' as c) >] ->
- let () = match c with
- | '"' -> real_push_char c
- | _ -> ()
- in
- real_push_char c; loc
- | [< >] -> real_push_char '\\'; loc); s >]
- -> comm_string loc bp s
- | [< _ = Stream.empty >] ep ->
- let loc = set_loc_pos loc bp ep in
- err loc Unterminated_string
- | [< ''\n' as c; s >] ep -> real_push_char c; comm_string (bump_loc_line loc ep) bp s
- | [< 'c; s >] -> real_push_char c; comm_string loc bp s
-
let rec comment loc bp = parser bp2
| [< ''(';
loc = (parser
@@ -437,11 +419,7 @@ let rec comment loc bp = parser bp2
| [< '')' >] -> push_string "*)"; loc
| [< s >] -> real_push_char '*'; comment loc bp s >] -> loc
| [< ''"'; s >] ->
- let loc =
- (* In beautify mode, the lexing differs between strings in comments and
- regular strings (e.g. escaping). It seems wrong. *)
- if !Flags.beautify then (push_string"\""; comm_string loc bp2 s)
- else fst (string loc ~comm_level:(Some 0) bp2 0 s)
+ let loc = fst (string loc ~comm_level:(Some 0) bp2 0 s)
in
comment loc bp s
| [< _ = Stream.empty >] ep ->