Commit 66861b88 authored by Pietro Abate's avatar Pietro Abate

[r2004-12-30 00:30:19 by afrisch] --script, punning

Original author: afrisch
Date: 2004-12-30 00:30:19+00:00
parent 861f06de
......@@ -9,6 +9,7 @@ Since 0.2.1
- new syntax { l = p else p' }
- fixed a little bit support for XML Schema, but still largely broken
- better compilation of sequence capture variables
- punning in record/attribute expressions and values ({ x; y } -> {x=x;y=y})
0.2.1
......
......@@ -35,7 +35,7 @@ charme_build:
install_web_distant:
$(MAKE) webpages
scp CHANGES INSTALL INSTALL.WIN32 web/www/*.html web/cduce.css cduce@iris.ens.fr:public_html/
scp CHANGES INSTALL INSTALL.WIN32 web/www/*.html web/demo.js web/cduce.css cduce@iris.ens.fr:public_html/
SCRIPT =
INCLUDES_DEB = $(INCLUDES) $(shell ocamlfind query -i-format -recursive $(PACKAGES))
......
......@@ -11,6 +11,7 @@ let args = ref []
let compile = ref false
let run = ref false
let script = ref false
let version () =
Printf.eprintf "CDuce, version %s\n" <:symbol<cduce_version>>;
......@@ -41,10 +42,13 @@ let specs = ref
" add one directory to the lookup path for .cdo and .cmi files";
"--stdin", Arg.Unit (fun () -> src := "" :: !src),
" read CDuce script on standard input";
"--arg", Arg.Rest (fun s -> args := s :: !args),
" following arguments are passed to the CDuce program";
" following arguments are passed to the CDuce program";
"--script", Arg.Rest (fun s ->
if not !script then (script := true;
src := s :: !src)
else args := s :: !args),
" the first argument after is the source, then the arguments";
"--no", Arg.String Config.inhibit,
" disable a feature (cduce -v to get a list of features)";
"--debug", Arg.Unit (fun () -> Stats.set_verbosity Stats.Summary),
......
......@@ -572,13 +572,20 @@ EXTEND
or_else : [ [ OPT [ "else"; y = pat -> y ] ] ];
record_spec:
[ [ r = LIST0 [ l = [IDENT | keyword ]; "=";
opt_field_pat: [ [ OPT [ "=";
o = [ "?" -> true | -> false];
x = pat; y = or_else ->
let x = if o then mk loc (Optional x) else x in
(label l, (x,y))
] SEP ";" ->
x = pat; y = or_else -> (o,x,y) ] ] ];
record_spec:
[ [ r = LIST0 [ l = [IDENT | keyword ]; f = opt_field_pat ->
let (o,x,y) =
match f with
| None -> (false, mknoloc (PatVar (U.mk l)), None)
| Some z -> z
in
let x = if o then mk loc (Optional x) else x in
(label l, (x,y))
] SEP ";" ->
r
] ];
......@@ -589,21 +596,28 @@ EXTEND
attrib_spec:
[ [ r = LIST0 [ l = [IDENT | keyword ]; "=";
o = [ "?" -> true | -> false];
x = pat; y = or_else; OPT ";" ->
let x = if o then mk loc (Optional x) else x in
(label l, (x, y))
] ->
[ [ r = LIST0 [ l = [IDENT | keyword ]; f = opt_field_pat; OPT ";" ->
let (o,x,y) =
match f with
| None -> (false, mknoloc (PatVar (U.mk l)), None)
| Some z -> z
in
let x = if o then mk loc (Optional x) else x in
(label l, (x, y))
] ->
mk loc (Record (true,r))
| "("; t = pat; ")" -> t
| "{"; r = record_spec; "}" -> mk loc (Record (true,r))
| "{|"; r = record_spec; "|}" -> mk loc (Record (false,r))
] ];
opt_field_expr: [ [ OPT [ "="; x = expr LEVEL "no_appl" -> x ] ] ];
expr_record_spec:
[ [ r = LIST1
[ l = [IDENT | keyword ]; "="; x = expr LEVEL "no_appl" ->
[ l = [IDENT | keyword ];
x = opt_field_expr ->
let x = match x with Some x -> x | None -> Var (U.mk l) in
(label l,x) ]
SEP ";" ->
exp loc (RecordLitt r)
......@@ -611,7 +625,9 @@ EXTEND
expr_attrib_spec:
[ [ r = LIST1
[ l = [IDENT | keyword ]; "="; x = expr LEVEL "no_appl"; OPT ";" ->
[ l = [IDENT | keyword ];
x = opt_field_expr; OPT ";" ->
let x = match x with Some x -> x | None -> Var (U.mk l) in
(label l,x) ] ->
exp loc (RecordLitt r)
]
......
......@@ -28,7 +28,10 @@ function defreq(pr)
function submit(pr) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("POST", "/cgi-bin/evaluator" ,true);
netscape.security.PrivilegeManager.enablePrivilege(
'UniversalXPConnect UniversalBrowserAccess'
);
xmlhttp.open("POST", "http://reglisse.ens.fr/evaluator" ,true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) { show_result(pr,xmlhttp.responseText); }
}
......
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