Commit 0242804d authored by Pietro Abate's avatar Pietro Abate

[r2003-05-26 22:36:48 by cvscast] Cosmetique

Original author: cvscast
Date: 2003-05-26 22:36:48+00:00
parent e5d09cb3
let symbols = ref [] let symbols = ref []
let define s = let define s =
try let i =
let i = String.index s '=' in try String.index s '='
symbols := with Not_found -> failwith ("Invalid symbol definition :" ^ s) in
(String.sub s 0 i, String.sub s (i + 1) (String.length s - i - 1)) :: symbols :=
!symbols (String.sub s 0 i, String.sub s (i + 1) (String.length s - i - 1)) ::
with Not_found -> !symbols
failwith ("Invalid symbol definition :" ^ s)
let expr _ s = let expr _ s =
try List.assoc s !symbols try List.assoc s !symbols
with Not_found -> with Not_found -> failwith ("No definition for symbol " ^ s)
failwith ("No definition for symbol " ^ s)
let _ = let _ =
Quotation.add "symbol" (Quotation.ExStr expr); Quotation.add "symbol" (Quotation.ExStr expr);
Pcaml.add_option "-symbol" (Arg.String define) Pcaml.add_option "-symbol" (Arg.String define)
"<symbol=value> Define a symbol" "<symbol=value> Define a symbol"
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