Commit fb76e22c authored by gerd's avatar gerd

Updated.


git-svn-id: https://godirepo.camlcity.org/svn/lib-xstrp4/trunk@31 56444827-45db-0310-81c6-95464f7ca4c4
parent 8d2d8c49
This is a camlp4 extension that expands brace expansions like a shell
does. See sample.ml for examples.
This version works only for O'Caml 3.08.
You need findlib to 'make install'; AT LEAST VERSION 0.4 OF FINDLIB!
BUILD:
......@@ -23,8 +21,17 @@ HOW TO USE IT:
See sample.ml for explanations. See the Makefile how to compile sample.ml.
KNOWN BUGS:
Errors reported by xstrp4 are usually off by 2 (for O'Caml 3.10). This
is O'Caml bug #4357 (http://caml.inria.fr/mantis/view.php?id=4357).
CHANGES:
Changed in version 1.7:
Porting to O'Caml 3.10. Still works for older O'Caml versions.
Changed in version 1.6:
Setting the name of the location variable explicitly
because the default changed in O'Caml 3.09.
......@@ -60,5 +67,7 @@ You can download it from
http://www.ocaml-programming.de/packages/.
This module has an entry in the O'Caml link database,
http://www.npc.de/ocaml/linkdb/
http://links.camlcity.org/
Subversion:
See https://godirepo.camlcity.org/svn/
......@@ -17,10 +17,6 @@ let camlp4loc (loc1,loc2) =
let interpolated_expr lexbuf _loc =
(* Parse [lexbuf], and generate the syntax tree for the corresponding expression.
*)
(*
Printf.eprintf "All at line %d bol %d off %d\n%!"
(Loc.start_line _loc) (Loc.start_bol _loc) (Loc.start_off _loc);
*)
let rec parse_here_expr() =
let tok = Xstrp4_here_lexer.token lexbuf in
......@@ -64,24 +60,6 @@ Printf.eprintf "All at line %d bol %d off %d\n%!"
let toklist =
List.map fix_positions (normalize_literals (parse_here_expr ())) in
(*
let loc =
let start_pos =
match toklist with
Literal(_,(l1,_)) :: _ -> l1
| Variable(_,_,(l1,_)) :: _ -> l1
| _ -> Lexing.dummy_pos
in
let end_pos =
match List.rev toklist with
Literal(_,(_,l2)) :: _ -> l2
| Variable(_,_,(_,l2)) :: _ -> l2
| _ -> Lexing.dummy_pos
in
(start_pos, end_pos)
in
let _loc = camlp4loc loc in
*)
let toklist_ast =
List.map
......@@ -98,11 +76,7 @@ Printf.eprintf "All at line %d bol %d off %d\n%!"
let valueid_ast = translate_id sl' in
<:expr< $moduleid_ast$ . $valueid_ast$ >>
| [s] ->
(*
Printf.eprintf "Var at line %d bol %d off %d\n%!"
(Loc.start_line _loc) (Loc.start_bol _loc) (Loc.start_off _loc);
*)
<:expr< $lid:s$ >>
<:expr< $lid:s$ >>
| _ ->
failwith "Xstrp4.here_expr"
in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment