Update of /cvsroot/q-lang/faust2pd/faust2pd
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22410/faust2pd
Modified Files:
faustxml.q
Log Message:
fixes for compatibility with latest Faust from cvs
Index: faustxml.q
===================================================================
RCS file: /cvsroot/q-lang/faust2pd/faust2pd/faustxml.q,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** faustxml.q 9 Jun 2008 09:46:17 -0000 1.2
--- faustxml.q 11 Aug 2008 08:15:15 -0000 1.3
***************
*** 110,122 ****
= S otherwise;
! private parse_prop S, parse_control X, parse_group CD X;
! parse_doc (node (element "name" _ _) [node (text NAME) _],
! node (element "version" _ _) [node (text VERSION) _],
! node (element "inputs" _ _) [node (text IN) _],
! node (element "outputs" _ _) [node (text OUT) _],
CONTROLS,LAYOUT)
= (NAME,VERSION,IN,OUT,CONTROLS)
! where [NAME,VERSION] = map (parse_prop.trim) [NAME,VERSION],
IN:Int = val IN, OUT:Int = val OUT,
CONTROLS = map parse_control CONTROLS,
--- 110,123 ----
= S otherwise;
! private parse_node X, parse_prop S, parse_control X, parse_group CD X;
! parse_doc (node (element "name" _ _) NAME,
! node (element "version" _ _) VERSION,
! node (element "inputs" _ _) IN,
! node (element "outputs" _ _) OUT,
CONTROLS,LAYOUT)
= (NAME,VERSION,IN,OUT,CONTROLS)
! where [NAME,VERSION,IN,OUT] = map parse_node [NAME,VERSION,IN,OUT],
! [NAME,VERSION] = map (parse_prop.trim) [NAME,VERSION],
IN:Int = val IN, OUT:Int = val OUT,
CONTROLS = map parse_control CONTROLS,
***************
*** 124,127 ****
--- 125,133 ----
parse_doc _ = throw "invalid XML data" otherwise;
+ parse_node [node (text S:String) _]
+ = S;
+ parse_node [] = "";
+ parse_node _ = throw "invalid XML data" otherwise;
+
parse_prop "Unknow" // sic!
= "";
***************
*** 141,146 ****
parse_control _ = throw "invalid XML data" otherwise;
! param (node (element NAME:String _ _) [node (text VAL:String) _])
! = (NAME,VAL);
param _ _ = throw "invalid XML data" otherwise;
--- 147,152 ----
parse_control _ = throw "invalid XML data" otherwise;
! param (node (element NAME:String _ _) VAL)
! = (NAME,VAL) where VAL:String = parse_node VAL;
param _ _ = throw "invalid XML data" otherwise;
***************
*** 168,173 ****
make_group CD TYPE
! [node (element "label" _ _) [node (text LABEL:String) _]|PARAMS]
! = C where C:Control = (val $ "faustxml::"++ TYPE)
(str_val LABEL,map (parse_group CD) PARAMS);
make_group _ _ _ = throw "invalid XML data" otherwise;
--- 174,180 ----
make_group CD TYPE
! [node (element "label" _ _) LABEL|PARAMS]
! = C where LABEL:String = parse_node LABEL,
! C:Control = (val $ "faustxml::"++ TYPE)
(str_val LABEL,map (parse_group CD) PARAMS);
make_group _ _ _ = throw "invalid XML data" otherwise;
|