[m-rev.] diff: fix extras/xml (again)

Julien Fischer juliensf at cs.mu.OZ.AU
Wed Jun 1 17:42:14 AEST 2005


Estimated hours taken: 0.1
Branches: main, 0.12

extras/xml/parsing.m:
extras/xml/xml.parse.m:
	Delete the type '' ---> '' and replace instances of
	it in these files with the unit type from std_util.
	The compiler no longer accepts the former type and
	we aren't going to allow it in future anyway.

Julien.

Index: parsing.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/xml/parsing.m,v
retrieving revision 1.2
diff -u -r1.2 parsing.m
--- parsing.m	16 Jun 2001 05:46:26 -0000	1.2
+++ parsing.m	1 Jun 2005 07:36:43 -0000
@@ -81,7 +81,7 @@
 	--->	ok(T)
 	;	error(string).

-:- pred pstate(entity, encoding, globals, io__state, pstate('')).
+:- pred pstate(entity, encoding, globals, io__state, pstate(unit)).
 :- mode pstate(in, in, in, di, puo) is det.

 :- pred finish(parse(T1), pstate(T1), io__state).
@@ -109,7 +109,7 @@
 :- pred return(T, pstate(_), pstate(T)).
 :- mode return(in, pdi, puo) is det.

-:- pred return(pstate(_), pstate('')).
+:- pred return(pstate(_), pstate(unit)).
 :- mode return(pdi, puo) is det.

 :- pred fail(string, pstate(_), pstate(_)).
@@ -152,8 +152,6 @@

 :- type opt(T) ---> no ; yes(T).

-:- type '' ---> ''.
-
 :- type parser(T1, T2) == pred(pstate(T1), pstate(T2)).

 :- inst parser = (pred(pdi, puo) is det).
@@ -196,7 +194,7 @@
 :- pred wrap(parser(T1, T2), pred(T2, T3), pstate(T1), pstate(T3)).
 :- mode wrap(in(parser), pred(in, out) is det, pdi, puo) is det.

-:- pred x(parser(T1, T2), pstate(T1), pstate('')).
+:- pred x(parser(T1, T2), pstate(T1), pstate(unit)).
 :- mode x(in(parser), pdi, puo) is det.

 :- pred fst(parser(S, (T,U)), pstate(S), pstate(T)).
@@ -261,7 +259,7 @@
 mkEncoding(Enc) = 'new enc'(Enc).

 pstate(Entity, Enc, Globs, IO, PS) :-
-    PS = s(0, Entity, Enc, ok(''), Globs, IO).
+    PS = s(0, Entity, Enc, ok(unit), Globs, IO).

 finish(Res, PS0, IO) :-
     status(Status, PS0, PS),
@@ -380,7 +378,7 @@
     PS = PS0^status := ok(X).

 return -->
-    return('').
+    return(unit).

 fail(Msg, PS0, PS) :-
     PS = PS0^status := fail(Msg).
@@ -431,11 +429,11 @@
     return(Thing)
     )).

-:- pred lit2(list(char), pstate(_), pstate('')).
+:- pred lit2(list(char), pstate(_), pstate(unit)).
 :- mode lit2(in, pdi, puo) is det.

 lit2([]) -->
-    return('').
+    return(unit).
 lit2([C|Is]) -->
     { char__to_int(C, I) },
     (tok			    then (pred(I0::in, pdi, puo) is det -->
@@ -581,7 +579,7 @@

 x(P) -->
     P				    then (pred(_::in, pdi, puo) is det -->
-    return('')
+    return(unit)
     ).

 fst(P) -->
Index: xml.parse.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/xml/xml.parse.m,v
retrieving revision 1.3
diff -u -r1.3 xml.parse.m
--- xml.parse.m	18 May 2005 13:50:56 -0000	1.3
+++ xml.parse.m	1 Jun 2005 07:34:20 -0000
@@ -946,7 +946,7 @@

 %   [23]  XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'

-:- pred xmlDecl(pstate(_), pstate('')).
+:- pred xmlDecl(pstate(_), pstate(unit)).
 :- mode xmlDecl(in, out) is det.

 xmlDecl -->
@@ -973,7 +973,7 @@

 %   [24]  VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")

-:- pred versionInfo(pstate(_), pstate('')).
+:- pred versionInfo(pstate(_), pstate(unit)).
 :- mode versionInfo(in, out) is det.

 versionInfo -->
@@ -991,7 +991,7 @@

 %   [25]  Eq ::= S? '=' S?

-:- pred eq(pstate(_), pstate('')).
+:- pred eq(pstate(_), pstate(unit)).
 :- mode eq(in, out) is det.

 eq -->
@@ -1099,7 +1099,7 @@
     return(dtd(Root, Elements, Entities, PEntities))
     ))))))))).

-:- pred parseInternalSubSet(pstate(_), pstate('')).
+:- pred parseInternalSubSet(pstate(_), pstate(unit)).
 :- mode parseInternalSubSet(pdi, puo) is det.

 parseInternalSubSet -->
@@ -1108,7 +1108,7 @@
     return
     ).

-:- pred parseExtSubset(externalId, pstate(_), pstate('')).
+:- pred parseExtSubset(externalId, pstate(_), pstate(unit)).
 :- mode parseExtSubset(in, pdi, puo) is det.

 parseExtSubset(ExId) -->
@@ -1122,7 +1122,7 @@
 %   | NotationDecl | PI | Comment [ VC: Proper Declaration/PE Nesting ]
 %   [ WFC: PEs in Internal Subset ]

-:- pred markupdecl(pstate(_), pstate('')).
+:- pred markupdecl(pstate(_), pstate(unit)).
 :- mode markupdecl(in, out) is det.

 markupdecl -->
@@ -1167,7 +1167,7 @@
 %   External Subset
 %   [30]  extSubset ::= TextDecl? extSubsetDecl

-:- pred extSubset(pstate(T1), pstate('')).
+:- pred extSubset(pstate(T1), pstate(unit)).
 :- mode extSubset(in, out) is det.

 extSubset -->
@@ -1181,7 +1181,7 @@
 %   [31]  extSubsetDecl ::= ( markupdecl | conditionalSect | PEReference
 %   | S )*

-:- pred extSubsetDecl(pstate(_), pstate('')).
+:- pred extSubsetDecl(pstate(_), pstate(unit)).
 :- mode extSubsetDecl(in, out) is det.

 extSubsetDecl -->
@@ -1232,7 +1232,7 @@
 %   [32]  SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"'
 %   ('yes' | 'no') '"')) [ VC: Standalone Document Declaration ]

-:- pred sdDecl(pstate(_), pstate('')).
+:- pred sdDecl(pstate(_), pstate(unit)).
 :- mode sdDecl(in, out) is det.

 sdDecl -->
@@ -1351,7 +1351,7 @@
 %   Language Identification
 %   [33]  LanguageID ::= Langcode ('-' Subcode)*

-:- pred languageID(pstate(_), pstate('')).
+:- pred languageID(pstate(_), pstate(unit)).
 :- mode languageID(in, out) is det.

 languageID -->
@@ -1362,7 +1362,7 @@

 %   [34]  Langcode ::= ISO639Code |  IanaCode |  UserCode

-:- pred langcode(pstate(_), pstate('')).
+:- pred langcode(pstate(_), pstate(unit)).
 :- mode langcode(in, out) is det.

 langcode -->
@@ -1678,7 +1678,7 @@
 %   [45]  elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>' [ VC:
 %   Unique Element Type Declaration ]

-:- pred elementdecl(pstate(_), pstate('')).
+:- pred elementdecl(pstate(_), pstate(unit)).
 :- mode elementdecl(in, out) is det.

 elementdecl -->
@@ -1913,7 +1913,7 @@
 %   Attribute-list Declaration
 %   [52]  AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'

-:- pred attlistDecl(pstate(_), pstate('')).
+:- pred attlistDecl(pstate(_), pstate(unit)).
 :- mode attlistDecl(in, out) is det.

 attlistDecl -->
@@ -2222,7 +2222,7 @@
 %   Conditional Section
 %   [61]  conditionalSect ::= includeSect | ignoreSect

-:- pred conditionalSect(pstate(_), pstate('')).
+:- pred conditionalSect(pstate(_), pstate(unit)).
 :- mode conditionalSect(in, out) is det.

 conditionalSect -->
@@ -2230,7 +2230,7 @@

 %   [62]  includeSect ::= '<![' S? 'INCLUDE' S? '[' extSubsetDecl ']]>'

-:- pred includeSect(pstate(_), pstate('')).
+:- pred includeSect(pstate(_), pstate(unit)).
 :- mode includeSect(in, out) is det.

 includeSect -->
@@ -2248,7 +2248,7 @@
 %   [63]  ignoreSect ::= '<![' S? 'IGNORE' S? '[' ignoreSectContents*
 %   ']]>'

-:- pred ignoreSect(pstate(_), pstate('')).
+:- pred ignoreSect(pstate(_), pstate(unit)).
 :- mode ignoreSect(in, out) is det.

 ignoreSect -->
@@ -2264,7 +2264,7 @@
 %   [64]  ignoreSectContents ::= Ignore ('<![' ignoreSectContents ']]>'
 %   Ignore)*

-:- pred ignoreSectContents(pstate(_), pstate('')).
+:- pred ignoreSectContents(pstate(_), pstate(unit)).
 :- mode ignoreSectContents(in, out) is det.

 ignoreSectContents -->
@@ -2425,7 +2425,7 @@
 %   Entity Reference
 %   [67]  Reference ::= EntityRef | CharRef

-%:- pred reference(pstate(_), pstate('')).
+%:- pred reference(pstate(_), pstate(unit)).
 %:- mode reference(in, out) is det.
 %
 %reference -->
@@ -2556,7 +2556,7 @@
 %   Entity Declaration
 %   [70]  EntityDecl ::= GEDecl | PEDecl

-:- pred entityDecl(pstate(_), pstate('')).
+:- pred entityDecl(pstate(_), pstate(unit)).
 :- mode entityDecl(in, out) is det.

 entityDecl -->
@@ -2564,7 +2564,7 @@

 %   [71]  GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'

-:- pred geDecl(pstate(_), pstate('')).
+:- pred geDecl(pstate(_), pstate(unit)).
 :- mode geDecl(in, out) is det.

 geDecl -->
@@ -2589,7 +2589,7 @@

 %   [72]  PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'

-:- pred peDecl(pstate(_), pstate('')).
+:- pred peDecl(pstate(_), pstate(unit)).
 :- mode peDecl(in, out) is det.

 peDecl -->
@@ -2760,7 +2760,7 @@
 %   Text Declaration
 %   [77]  TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'

-:- pred textDecl(pstate(_), pstate('')).
+:- pred textDecl(pstate(_), pstate(unit)).
 :- mode textDecl(in, out) is det.

 textDecl -->
@@ -2802,7 +2802,7 @@

 %   [79]  extPE ::= TextDecl? extSubsetDecl

-:- pred extPE(pstate(_), pstate('')).
+:- pred extPE(pstate(_), pstate(unit)).
 :- mode extPE(in, out) is det.

 extPE -->
@@ -3132,7 +3132,7 @@
 %   [82]  NotationDecl ::= '<!NOTATION' S Name S (ExternalID |  PublicID)
 %   S? '>'

-:- pred notationDecl(pstate(_), pstate('')).
+:- pred notationDecl(pstate(_), pstate(unit)).
 :- mode notationDecl(in, out) is det.

 notationDecl -->
@@ -3655,7 +3655,7 @@
     { doc:add(Cont, Ref, Content0, Content) },
     set(gContent, Content).

-%:- pred psp(pstate(T1), pstate('')).
+%:- pred psp(pstate(T1), pstate(unit)).
 %:- mode psp(pdi, puo) is det.
 %
 %psp -->
@@ -3663,7 +3663,7 @@
 %    return
 %    ).

-%:- pred ps(pstate(T1), pstate('')).
+%:- pred ps(pstate(T1), pstate(unit)).
 %:- mode ps(pdi, puo) is det.
 %
 %ps -->
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list