aboutsummaryrefslogtreecommitdiffhomepage
path: root/parsing
diff options
context:
space:
mode:
authorGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2016-11-05 10:55:55 +0100
committerGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2016-11-05 12:27:11 +0100
commit0ad6edc1d088385ffe90f1a4dd1bddc04cb31b07 (patch)
tree247beb00512ff53800e168abcdbdedb58b0d7657 /parsing
parentf558a0552b49b533c1c79ee3eb6d49015eeb6084 (diff)
Removing obsolete parsing of strings à la v7 in comments.
This was for the translator and is not relevant for the beautifier.
Diffstat (limited to 'parsing')
-rw-r--r--parsing/cLexer.ml424
1 files changed, 1 insertions, 23 deletions
diff --git a/parsing/cLexer.ml4 b/parsing/cLexer.ml4
index a0cf631ea..d570f015e 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 ->