git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4058 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
eaecf6179f
commit
7bc2529a20
|
@ -1,6 +1,10 @@
|
|||
Camlp4 Version 3.04
|
||||
-------------------
|
||||
|
||||
- [27 Nov 01] Fixed functions Token.eval_char and Token.eval_string which
|
||||
returned bad values, resulting lexing of backslash sequences incompatible
|
||||
with OCaml (e.g. "\1" returned "\001" (one character) but OCaml returns
|
||||
the string of the two characters \ and 1).
|
||||
- [15 Nov 01] In revised syntax, in let binding in sequences, the "in"
|
||||
can be replaced by a semicolon; the revised syntax printer pr_r.cmo
|
||||
now rather prints a semicolon there.
|
||||
|
|
|
@ -119,17 +119,17 @@ value rec backslash s i =
|
|||
| '0'..'9' as c -> backslash1 (valch c) s (i + 1)
|
||||
| _ -> raise Not_found ]
|
||||
and backslash1 cod s i =
|
||||
if i = String.length s then (Char.chr cod, i)
|
||||
if i = String.length s then ('\\', i - 1)
|
||||
else
|
||||
match s.[i] with
|
||||
[ '0'..'9' as c -> backslash2 (10 * cod + valch c) s (i + 1)
|
||||
| _ -> (Char.chr cod, i) ]
|
||||
| _ -> ('\\', i - 1) ]
|
||||
and backslash2 cod s i =
|
||||
if i = String.length s then (Char.chr cod, i)
|
||||
if i = String.length s then ('\\', i - 2)
|
||||
else
|
||||
match s.[i] with
|
||||
[ '0'..'9' as c -> (Char.chr (10 * cod + valch c), i + 1)
|
||||
| _ -> (Char.chr cod, i) ]
|
||||
| _ -> ('\\', i - 2) ]
|
||||
;
|
||||
|
||||
value rec skip_indent s i =
|
||||
|
|
|
@ -114,17 +114,17 @@ let rec backslash s i =
|
|||
| '0'..'9' as c -> backslash1 (valch c) s (i + 1)
|
||||
| _ -> raise Not_found
|
||||
and backslash1 cod s i =
|
||||
if i = String.length s then Char.chr cod, i
|
||||
if i = String.length s then '\\', i - 1
|
||||
else
|
||||
match s.[i] with
|
||||
'0'..'9' as c -> backslash2 (10 * cod + valch c) s (i + 1)
|
||||
| _ -> Char.chr cod, i
|
||||
| _ -> '\\', i - 1
|
||||
and backslash2 cod s i =
|
||||
if i = String.length s then Char.chr cod, i
|
||||
if i = String.length s then '\\', i - 2
|
||||
else
|
||||
match s.[i] with
|
||||
'0'..'9' as c -> Char.chr (10 * cod + valch c), i + 1
|
||||
| _ -> Char.chr cod, i
|
||||
| _ -> '\\', i - 2
|
||||
;;
|
||||
|
||||
let rec skip_indent s i =
|
||||
|
|
Loading…
Reference in New Issue