[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Demexp-dev] [PATCH] Compatibility with CDuce 0.3
From: |
Thomas Petazzoni |
Subject: |
[Demexp-dev] [PATCH] Compatibility with CDuce 0.3 |
Date: |
Fri, 08 Apr 2005 22:27:25 +0200 |
User-agent: |
Mozilla Thunderbird 1.0.2 (X11/20050331) |
Hello,
As previously reported by Thomas de Grenier de Latour on this
mailing-list, the CDuce language changed between 0.2 and 0.3. The old {|
and |} are now replaced by simple { and }.
The attached patch fixes the problem. (Note: the included patch is a
Debian patch. It can be applied by simply removing the first few lines).
Sincerly,
Thomas
--
PETAZZONI Thomas - address@hidden
http://thomas.enix.org - Jabber: address@hidden
KOS: http://kos.enix.org/ - SOS: http://sos.enix.org
Fingerprint : 0BE1 4CF3 CEA4 AC9D CC6E 1624 F653 CB30 98D3 F7A7
#! /bin/sh /usr/share/dpatch/dpatch-run
## cduce-new-format.dpatch by <address@hidden>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNad demexp-0.4/srv/xml.cd.nw /tmp/dpep.4BokgR/demexp-0.4/srv/xml.cd.nw
--- demexp-0.4/srv/xml.cd.nw 2005-03-15 18:50:23.000000000 +0100
+++ /tmp/dpep.4BokgR/demexp-0.4/srv/xml.cd.nw 2005-04-03 23:54:37.521910963
+0200
@@ -79,32 +79,32 @@
type Ocaml_int = -1073741824 -- 1073741823 ;;
type Ocaml_string = Latin1 ;;
type Ocaml_kind = `Individual | `Delegate ;;
-type Ocaml_participant = {| kind = Ocaml_kind;
+type Ocaml_participant = { kind = Ocaml_kind;
login = Ocaml_string;
password = Ocaml_string;
- groups = [ Ocaml_string* ] |} ;;
-type Ocaml_response = {| r_desc = Ocaml_string;
+ groups = [ Ocaml_string* ] } ;;
+type Ocaml_response = { r_desc = Ocaml_string;
r_author = Ocaml_string;
- r_links = [ Ocaml_string* ] |} ;;
-type Ocaml_vote = {| voter = Ocaml_string;
- choices = [ Ocaml_int* ] |} ;;
+ r_links = [ Ocaml_string* ] } ;;
+type Ocaml_vote = { voter = Ocaml_string;
+ choices = [ Ocaml_int* ] } ;;
type Ocaml_elected = Ocaml_int ;;
type Ocaml_tag = Ocaml_string ;;
type Ocaml_tagid_list = [ Ocaml_int* ] ;;
type Ocaml_status = `Tagging_only | `Public ;;
-type Ocaml_question = {| q_desc = Ocaml_string;
+type Ocaml_question = { q_desc = Ocaml_string;
q_author = Ocaml_string;
limit_date = Ocaml_string;
status = Ocaml_status;
responses = [ Ocaml_response* ];
votes = [ Ocaml_vote* ];
- elected = [ Ocaml_elected* ] |} ;;
-type Ocaml_xml_content = {| version = Ocaml_string;
+ elected = [ Ocaml_elected* ] } ;;
+type Ocaml_xml_content = { version = Ocaml_string;
participants = [ (Ocaml_int, Ocaml_participant)* ];
questions = [ (Ocaml_int, Ocaml_question)* ];
tags = [ (Ocaml_int, Ocaml_tag)* ];
tagged_questions = [ (Ocaml_int,
- Ocaml_tagid_list)* ] |} ;;
+ Ocaml_tagid_list)* ] } ;;
@
\section{XML export}
@@ -138,7 +138,7 @@
| `Delegate -> "delegate"
in
map a with
- (i, {| kind=q; login=l; password=p; groups=g |})
+ (i, { kind=q; login=l; password=p; groups=g })
-> <participant kind=(trans_kind q)
p_id=(ocaml2xml_int i)>[ <login>l
<password>p
@@ -177,20 +177,20 @@
map l with s&Latin1 -> <link>s
in
map r with
- {| r_desc=d; r_author=a; r_links=l |} ->
+ { r_desc=d; r_author=a; r_links=l } ->
<response>[ <desc>d
<author>a
!(trans_links l) ] in
let trans_votes (v : [Ocaml_vote*]) : [Xml_vote*] =
- map v with {| voter=id; choices=c |} ->
+ map v with { voter=id; choices=c } ->
<vote voter=id>(map c with i&Int -> <choice is=(ocaml2xml_int i)>[]) in
let trans_elected (e : [Ocaml_elected*]) : [Xml_elected*] =
map e with i&Int -> <elected>(ocaml2xml_int i) in
let trans_status (Ocaml_status -> Xml_status)
| `Tagging_only -> "tagging_only"
| `Public -> "public" in
- map a with (i,{| q_desc=d; q_author=a; limit_date=l; status=s;
- responses=r; votes=v; elected=e |}) ->
+ map a with (i,{ q_desc=d; q_author=a; limit_date=l; status=s;
+ responses=r; votes=v; elected=e }) ->
<question q_id=(ocaml2xml_int i)
status=(trans_status s)>
[ <desc>d
@@ -207,7 +207,7 @@
<<xml.cd>>=
let save (f : Latin1) (c : Ocaml_xml_content) : [] =
let content = match c with
- {| version=v; participants=p; questions=q; tags=t; tagged_questions=tq |} ->
+ { version=v; participants=p; questions=q; tags=t; tagged_questions=tq } ->
<demexp_base version=v>[ <participant_base>(ocaml2xml_participants p)
<question_base>(ocaml2xml_questions q)
<classification_base>[ <tags>(ocaml2xml_tags t)
signature.asc
Description: OpenPGP digital signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Demexp-dev] [PATCH] Compatibility with CDuce 0.3,
Thomas Petazzoni <=