From 46af09bc1f2fbe4deb5828e98afb366af8ac728d Mon Sep 17 00:00:00 2001 From: "Achim D. Brucker" Date: Wed, 28 Apr 2021 09:27:40 +0100 Subject: [PATCH] Changed ref to Unsynchronized.ref. --- fxp/src/Catalog/catOptions.sml | 26 ++++---- fxp/src/Catalog/catParams.sml | 12 ++-- fxp/src/Parser/Base/baseData.sml | 6 +- fxp/src/Parser/Dfa/dfaOptions.sml | 12 ++-- fxp/src/Parser/Error/errorString.sml | 14 +++-- fxp/src/Parser/Params/dtd.sml | 30 +++++----- fxp/src/Parser/Params/parserOptions.sml | 80 ++++++++++++------------- fxp/src/Parser/Parse/parseContent.sml | 24 ++++---- fxp/src/Parser/Parse/parseDecl.sml | 8 +-- fxp/src/Parser/entities.sml | 10 ++-- fxp/src/Unicode/Chars/uniClasses.sml | 12 ++-- fxp/src/Util/SymDict/dict.sml | 38 ++++++------ fxp/src/Util/SymDict/symbolTable.sml | 40 ++++++------- 13 files changed, 157 insertions(+), 155 deletions(-) diff --git a/fxp/src/Catalog/catOptions.sml b/fxp/src/Catalog/catOptions.sml index d28f714..4043e29 100644 --- a/fxp/src/Catalog/catOptions.sml +++ b/fxp/src/Catalog/catOptions.sml @@ -1,11 +1,11 @@ signature CatOptions = sig - val O_CATALOG_FILES : Uri.Uri list ref - val O_PREFER_SOCAT : bool ref - val O_PREFER_SYSID : bool ref - val O_PREFER_CATALOG : bool ref - val O_SUPPORT_REMAP : bool ref - val O_CATALOG_ENC : Encoding.Encoding ref + val O_CATALOG_FILES : Uri.Uri list Unsynchronized.ref + val O_PREFER_SOCAT : bool Unsynchronized.ref + val O_PREFER_SYSID : bool Unsynchronized.ref + val O_PREFER_CATALOG : bool Unsynchronized.ref + val O_SUPPORT_REMAP : bool Unsynchronized.ref + val O_CATALOG_ENC : Encoding.Encoding Unsynchronized.ref val setCatalogDefaults : unit -> unit val setCatalogOptions : Options.Option list * (string -> unit) -> Options.Option list @@ -17,12 +17,12 @@ functor CatOptions () : CatOptions = struct open Encoding Options Uri - val O_CATALOG_FILES = ref nil: Uri list ref - val O_PREFER_SOCAT = ref false - val O_PREFER_SYSID = ref false - val O_PREFER_CATALOG = ref true - val O_SUPPORT_REMAP = ref true - val O_CATALOG_ENC = ref LATIN1 + val O_CATALOG_FILES = Unsynchronized.ref nil: Uri list Unsynchronized.ref + val O_PREFER_SOCAT = Unsynchronized.ref false + val O_PREFER_SYSID = Unsynchronized.ref false + val O_PREFER_CATALOG = Unsynchronized.ref true + val O_SUPPORT_REMAP = Unsynchronized.ref true + val O_CATALOG_ENC = Unsynchronized.ref LATIN1 fun setCatalogDefaults() = let @@ -45,7 +45,7 @@ functor CatOptions () : CatOptions = fun setCatalogOptions (opts,doError) = let - val catalogs = ref nil:string list ref + val catalogs = Unsynchronized.ref nil:string list Unsynchronized.ref fun hasNoArg key = "option "^key^" has no argument" fun mustHave key = String.concat ["option ",key," must have an argument"] diff --git a/fxp/src/Catalog/catParams.sml b/fxp/src/Catalog/catParams.sml index 056eb31..fdb0a16 100644 --- a/fxp/src/Catalog/catParams.sml +++ b/fxp/src/Catalog/catParams.sml @@ -5,12 +5,12 @@ signature CatParams = sig - val O_CATALOG_FILES : Uri.Uri list ref - val O_PREFER_SOCAT : bool ref - val O_PREFER_SYSID : bool ref - val O_PREFER_CATALOG : bool ref - val O_SUPPORT_REMAP : bool ref - val O_CATALOG_ENC : Encoding.Encoding ref + val O_CATALOG_FILES : Uri.Uri list Unsynchronized.ref + val O_PREFER_SOCAT : bool Unsynchronized.ref + val O_PREFER_SYSID : bool Unsynchronized.ref + val O_PREFER_CATALOG : bool Unsynchronized.ref + val O_SUPPORT_REMAP : bool Unsynchronized.ref + val O_CATALOG_ENC : Encoding.Encoding Unsynchronized.ref val catError : CatError.Position * CatError.CatError -> unit end diff --git a/fxp/src/Parser/Base/baseData.sml b/fxp/src/Parser/Base/baseData.sml index e97f4bd..db79671 100644 --- a/fxp/src/Parser/Base/baseData.sml +++ b/fxp/src/Parser/Base/baseData.sml @@ -68,9 +68,9 @@ structure BaseData = AD_IMPLIED | AD_REQUIRED | AD_DEFAULT of (UniChar.Vector * UniChar.Vector * AttValue option) - * (Errors.Position * bool ref) + * (Errors.Position * bool Unsynchronized.ref) | AD_FIXED of (UniChar.Vector * UniChar.Vector * AttValue option) - * (Errors.Position * bool ref) + * (Errors.Position * bool Unsynchronized.ref) (*--- attribute definition (list) ---*) (*--- the boolean says whether it was externally declared ---*) @@ -103,7 +103,7 @@ structure BaseData = (*--------------------------------------------------------------------*) (* the id info tells whether an id value has occurred for a name and *) - (* the list of all positions where it occurred as an idref value. *) + (* the list of all positions where it occurred as an idUnsynchronized.ref value. *) (*--------------------------------------------------------------------*) type IdInfo = bool * Errors.Position list val nullIdInfo : IdInfo = (false,nil) diff --git a/fxp/src/Parser/Dfa/dfaOptions.sml b/fxp/src/Parser/Dfa/dfaOptions.sml index 4156eaa..071291a 100644 --- a/fxp/src/Parser/Dfa/dfaOptions.sml +++ b/fxp/src/Parser/Dfa/dfaOptions.sml @@ -1,8 +1,8 @@ signature DfaOptions = sig - val O_DFA_INITIAL_WIDTH : int ref - val O_DFA_MAX_STATES : int ref - val O_DFA_WARN_TOO_LARGE : bool ref + val O_DFA_INITIAL_WIDTH : int Unsynchronized.ref + val O_DFA_MAX_STATES : int Unsynchronized.ref + val O_DFA_WARN_TOO_LARGE : bool Unsynchronized.ref val setDfaDefaults : unit -> unit val setDfaOptions : Options.Option list * (string -> unit) -> Options.Option list @@ -14,9 +14,9 @@ functor DfaOptions () : DfaOptions = struct open Options UtilInt - val O_DFA_INITIAL_WIDTH = ref 4 - val O_DFA_MAX_STATES = ref 256 - val O_DFA_WARN_TOO_LARGE = ref true + val O_DFA_INITIAL_WIDTH = Unsynchronized.ref 4 + val O_DFA_MAX_STATES = Unsynchronized.ref 256 + val O_DFA_WARN_TOO_LARGE = Unsynchronized.ref true fun setDfaDefaults() = let diff --git a/fxp/src/Parser/Error/errorString.sml b/fxp/src/Parser/Error/errorString.sml index 2984c46..18b21ee 100644 --- a/fxp/src/Parser/Error/errorString.sml +++ b/fxp/src/Parser/Error/errorString.sml @@ -55,12 +55,14 @@ structure ErrorString : ErrorString = fun errorVector2String vec = errorData2String (Vector.foldr (op ::) nil vec) - val QUOTE = "'" - fun quoteErrorChar0 c = QUOTE^errorChar2String c^QUOTE - fun quoteErrorChar c = if c=0wx0 then "entity end" else QUOTE^errorChar2String c^QUOTE - fun quoteErrorData cs = QUOTE^errorData2String cs^QUOTE - fun quoteErrorString s = QUOTE^s^QUOTE - fun quoteErrorVector v = QUOTE^errorVector2String v^QUOTE + + (* val QUOTE = "'" *) + + fun quoteErrorChar0 c = ("'"^(errorChar2String c)^"'") + fun quoteErrorChar c = if c=0wx0 then "entity end" else "'"^(errorChar2String c)^"'" + fun quoteErrorData cs = "'"^(errorData2String cs)^"'" + fun quoteErrorString s = "'"^s^"'" + fun quoteErrorVector v = "'"^(errorVector2String v)^"'" fun Position2String (fname,l,c) = if fname="" then "" diff --git a/fxp/src/Parser/Params/dtd.sml b/fxp/src/Parser/Params/dtd.sml index fd94dd2..2bedf28 100644 --- a/fxp/src/Parser/Params/dtd.sml +++ b/fxp/src/Parser/Params/dtd.sml @@ -111,11 +111,11 @@ structure Dtd : Dtd = Base UniChar DataDict DataSymTab - val O_TS_ELEM = ref 6 (* Initial size of element table *) - val O_TS_GEN_ENT = ref 6 (* Initial size of general entity table *) - val O_TS_ID = ref 6 (* Initial size of id attribute table *) - val O_TS_ATT_NOT = ref 6 (* Initial size of notation table *) - val O_TS_PAR_ENT = ref 6 (* Initial size of parameter entity table *) + val O_TS_ELEM = Unsynchronized.ref 6 (* Initial size of element table *) + val O_TS_GEN_ENT = Unsynchronized.ref 6 (* Initial size of general entity table *) + val O_TS_ID = Unsynchronized.ref 6 (* Initial size of id attribute table *) + val O_TS_ATT_NOT = Unsynchronized.ref 6 (* Initial size of notation table *) + val O_TS_PAR_ENT = Unsynchronized.ref 6 (* Initial size of parameter entity table *) (*--------------------------------------------------------------------*) (* this is how the predefined entities must be declared. *) @@ -133,9 +133,9 @@ structure Dtd : Dtd = (*--------------------------------------------------------------------*) (* this type holds all information relevent to the DTD. *) (*--------------------------------------------------------------------*) - type Dtd = {hasDtdFlag : bool ref, - standAloneFlag : bool ref, - externalFlag : bool ref, + type Dtd = {hasDtdFlag : bool Unsynchronized.ref, + standAloneFlag : bool Unsynchronized.ref, + externalFlag : bool Unsynchronized.ref, elDict : ElemInfo DataDict.Dict, genDict : GenEntInfo DataDict.Dict, idDict : IdInfo DataDict.Dict, @@ -144,9 +144,9 @@ structure Dtd : Dtd = preRedef : bool array } - fun newDtd() = {hasDtdFlag = ref false, - standAloneFlag = ref false, - externalFlag = ref false, + fun newDtd() = {hasDtdFlag = Unsynchronized.ref false, + standAloneFlag = Unsynchronized.ref false, + externalFlag = Unsynchronized.ref false, elDict = nullDict ("element",nullElemInfo), idDict = nullDict ("ID name",nullIdInfo), genDict = nullDict ("general entity",(GE_NULL,false)), @@ -163,7 +163,7 @@ structure Dtd : Dtd = (*--------------------------------------------------------------------*) (* standalone status, existance of a DTD and of external declarations *) (* externalFlag is true if there is an external subset or a (not nece-*) - (* ssarily external) parameter entity reference in the DTD. (cf. 4.1) *) + (* ssarily external) parameter entity Unsynchronized.reference in the DTD. (cf. 4.1) *) (*--------------------------------------------------------------------*) fun standsAlone (dtd:Dtd) = !(#standAloneFlag dtd) fun hasExternal (dtd:Dtd) = !(#externalFlag dtd) @@ -178,16 +178,16 @@ structure Dtd : Dtd = (* 4.1: *) (* Well-Formedness Constraint: Entity Declared *) (* In a document without any DTD, a document with only an internal *) - (* DTD subset which contains no parameter entity references, or a *) + (* DTD subset which contains no parameter entity Unsynchronized.references, or a *) (* document with "standalone='yes'", the Name given in the entity *) - (* reference must match that in an entity declaration ... Note that *) + (* Unsynchronized.reference must match that in an entity declaration ... Note that *) (* if entities are declared in the external subset or in external *) (* parameter entities, a non-validating processor is not obligated *) (* to read and process their declarations; for such documents, the *) (* rule that an entity must be declared is a well-formedness *) (* constraint only if standalone='yes'. *) (* *) - (* Thus a reference to an undeclared entity is a well-formedness *) + (* Thus a Unsynchronized.reference to an undeclared entity is a well-formedness *) (* error if either #hasDtdFlag or #externalFlag is false, or if *) (* #standaloneFlag is true *) (*--------------------------------------------------------------------*) diff --git a/fxp/src/Parser/Params/parserOptions.sml b/fxp/src/Parser/Params/parserOptions.sml index 20b1b65..66381f7 100644 --- a/fxp/src/Parser/Params/parserOptions.sml +++ b/fxp/src/Parser/Params/parserOptions.sml @@ -7,30 +7,30 @@ signature ParserOptions = sig structure DfaOptions : DfaOptions - val O_CHECK_ISO639 : bool ref - val O_CHECK_LANGID : bool ref - val O_CHECK_PREDEFINED : bool ref - val O_CHECK_RESERVED : bool ref - val O_CHECK_VERSION : bool ref + val O_CHECK_ISO639 : bool Unsynchronized.ref + val O_CHECK_LANGID : bool Unsynchronized.ref + val O_CHECK_PREDEFINED : bool Unsynchronized.ref + val O_CHECK_RESERVED : bool Unsynchronized.ref + val O_CHECK_VERSION : bool Unsynchronized.ref - val O_WARN_MULT_ENUM : bool ref - val O_WARN_XML_DECL : bool ref - val O_WARN_ATT_NO_ELEM : bool ref - val O_WARN_MULT_ENT_DECL : bool ref - val O_WARN_MULT_NOT_DECL : bool ref - val O_WARN_MULT_ATT_DEF : bool ref - val O_WARN_MULT_ATT_DECL : bool ref - val O_WARN_SHOULD_DECLARE : bool ref - val O_WARN_NON_ASCII_URI : bool ref + val O_WARN_MULT_ENUM : bool Unsynchronized.ref + val O_WARN_XML_DECL : bool Unsynchronized.ref + val O_WARN_ATT_NO_ELEM : bool Unsynchronized.ref + val O_WARN_MULT_ENT_DECL : bool Unsynchronized.ref + val O_WARN_MULT_NOT_DECL : bool Unsynchronized.ref + val O_WARN_MULT_ATT_DEF : bool Unsynchronized.ref + val O_WARN_MULT_ATT_DECL : bool Unsynchronized.ref + val O_WARN_SHOULD_DECLARE : bool Unsynchronized.ref + val O_WARN_NON_ASCII_URI : bool Unsynchronized.ref - val O_ERROR_MINIMIZE : bool ref + val O_ERROR_MINIMIZE : bool Unsynchronized.ref - val O_VALIDATE : bool ref - val O_COMPATIBILITY : bool ref - val O_INTEROPERABILITY : bool ref + val O_VALIDATE : bool Unsynchronized.ref + val O_COMPATIBILITY : bool Unsynchronized.ref + val O_INTEROPERABILITY : bool Unsynchronized.ref - val O_INCLUDE_EXT_PARSED : bool ref - val O_INCLUDE_PARAM_ENTS : bool ref + val O_INCLUDE_EXT_PARSED : bool Unsynchronized.ref + val O_INCLUDE_PARAM_ENTS : bool Unsynchronized.ref val setParserDefaults : unit -> unit val setParserOptions : Options.Option list * (string -> unit) -> Options.Option list @@ -44,41 +44,41 @@ functor ParserOptions () : ParserOptions = open DfaOptions Options UtilInt UtilList - val O_CHECK_VERSION = ref true (* check for conforming xml version? *) - val O_CHECK_ISO639 = ref true (* check whether a two-letter LangCode *) + val O_CHECK_VERSION = Unsynchronized.ref true (* check for conforming xml version? *) + val O_CHECK_ISO639 = Unsynchronized.ref true (* check whether a two-letter LangCode *) (* is acording to ISO 639? *) - val O_CHECK_LANGID = ref true (* check whether a LangCode fullfills *) + val O_CHECK_LANGID = Unsynchronized.ref true (* check whether a LangCode fullfills *) (* IETF RFC 1766? *) - val O_CHECK_RESERVED = ref false(* check for names starting with xml? *) - val O_CHECK_PREDEFINED = ref true (* check declarations of predefined *) - val O_WARN_MULT_ENUM = ref true (* check whether a token occurs *) + val O_CHECK_RESERVED = Unsynchronized.ref false(* check for names starting with xml? *) + val O_CHECK_PREDEFINED = Unsynchronized.ref true (* check declarations of predefined *) + val O_WARN_MULT_ENUM = Unsynchronized.ref true (* check whether a token occurs *) (* twice in the enumerated attribute *) (* types of the same element *) - val O_WARN_XML_DECL = ref false (* warn if the XML decl is missing? *) + val O_WARN_XML_DECL = Unsynchronized.ref false (* warn if the XML decl is missing? *) - val O_WARN_ATT_NO_ELEM = ref true (* warn for undeclared elements *) + val O_WARN_ATT_NO_ELEM = Unsynchronized.ref true (* warn for undeclared elements *) (* in att def list declarations? *) - val O_WARN_MULT_ENT_DECL = ref true (* warn about redefined entities *) - val O_WARN_MULT_NOT_DECL = ref true (* warn about redefined notations*) - val O_WARN_SHOULD_DECLARE = ref true (* warn if predefined entities *) + val O_WARN_MULT_ENT_DECL = Unsynchronized.ref true (* warn about redefined entities *) + val O_WARN_MULT_NOT_DECL = Unsynchronized.ref true (* warn about redefined notations*) + val O_WARN_SHOULD_DECLARE = Unsynchronized.ref true (* warn if predefined entities *) (* are not declared in the dtd *) - val O_WARN_MULT_ATT_DEF = ref true (* warn if an attributes is defd *) + val O_WARN_MULT_ATT_DEF = Unsynchronized.ref true (* warn if an attributes is defd *) (* twice for the same element? *) - val O_WARN_MULT_ATT_DECL = ref true (* warn if there are multiple att *) + val O_WARN_MULT_ATT_DECL = Unsynchronized.ref true (* warn if there are multiple att *) (* def lists for one element? *) - val O_WARN_NON_ASCII_URI = ref true (* warn about non-ascii chars in *) + val O_WARN_NON_ASCII_URI = Unsynchronized.ref true (* warn about non-ascii chars in *) (* system identifiers? *) - val O_ERROR_MINIMIZE = ref true (* try to avoid repeating errors? *) + val O_ERROR_MINIMIZE = Unsynchronized.ref true (* try to avoid repeating errors? *) - val O_VALIDATE = ref true - val O_COMPATIBILITY = ref true - val O_INTEROPERABILITY = ref false + val O_VALIDATE = Unsynchronized.ref true + val O_COMPATIBILITY = Unsynchronized.ref true + val O_INTEROPERABILITY = Unsynchronized.ref false - val O_INCLUDE_EXT_PARSED = ref false - val O_INCLUDE_PARAM_ENTS = ref false + val O_INCLUDE_EXT_PARSED = Unsynchronized.ref false + val O_INCLUDE_PARAM_ENTS = Unsynchronized.ref false fun setParserDefaults() = let diff --git a/fxp/src/Parser/Parse/parseContent.sml b/fxp/src/Parser/Parse/parseContent.sml index e83c07a..5f97bcd 100644 --- a/fxp/src/Parser/Parse/parseContent.sml +++ b/fxp/src/Parser/Parse/parseContent.sml @@ -232,7 +232,7 @@ struct (* appear in their literal form only when used as markup delimiters,*) (* or within a comment, a processing instruction, or a CDATA *) (* section... If they are needed elsewhere, they must be escaped *) - (* using either numeric character references or the strings "&" *) + (* using either numeric character Unsynchronized.references or the strings "&" *) (* and "<" respectively... *) (* *) (* consume the content of the element, accumulating it via the user *) @@ -319,19 +319,19 @@ struct end end (*--------------------------------------------------------------*) - (* consume a reference, handling errors by ignoring them. *) + (* consume a Unsynchronized.reference, handling errors by ignoring them. *) (*--------------------------------------------------------------*) fun do_ref (q,(c1,a1,q1)) = if c1=0wx23 (* #"#" *) (*------------------------------------------------------*) - (* it's a character reference. *) + (* it's a character Unsynchronized.reference. *) (*------------------------------------------------------*) then let val err = ERR_ELEM_CONTENT IT_CHAR_REF val a2 = hookError(a1,(getPos q,err)) in skipCharRef(a2,q1) end (*---------------------------------------------------------*) - (* it's a general entity reference. *) + (* it's a general entity Unsynchronized.reference. *) (*---------------------------------------------------------*) else let val ((id,ent),(a2,q2)) = parseGenRef dtd (c1,a1,q1) in case ent @@ -368,7 +368,7 @@ struct "parseGenRef returned GE_UNPARSED") end (*-------------------------------------------------------*) - (* handle any errors in references by ignoring them. *) + (* handle any errors in Unsynchronized.references by ignoring them. *) (*-------------------------------------------------------*) handle SyntaxError caq => caq | NoSuchEntity aq => getChar aq @@ -552,10 +552,10 @@ struct (* appear in their literal form only when used as markup delimiters,*) (* or within a comment, a processing instruction, or a CDATA *) (* section... If they are needed elsewhere, they must be escaped *) - (* using either numeric character references or the strings "&" *) + (* using either numeric character Unsynchronized.references or the strings "&" *) (* and "<" respectively. The right angle bracket (>) may be *) (* represented using the string ">", and must, for compatibility,*) - (* be escaped using ">" or a character reference when it appears *) + (* be escaped using ">" or a character Unsynchronized.reference when it appears *) (* in the string "]]>" in content, when that string is not marking *) (* the end of a CDATA section. *) (* *) @@ -583,7 +583,7 @@ struct (*--------------------------------------------------------------*) fun do_data (br,(c0,a0,q0)) = let - val pos0 = ref (getPos q0) + val pos0 = Unsynchronized.ref (getPos q0) val _ = Array.update(dataBuffer,0,c0) fun data_hook (i,(a,q)) = @@ -663,12 +663,12 @@ struct *) (*--------------------------------------------------------------*) - (* consume a reference, handling errors by ignoring them. *) + (* consume a Unsynchronized.reference, handling errors by ignoring them. *) (*--------------------------------------------------------------*) fun do_ref (q0,(c,a,q)) = if c=0wx23 (* #"#" *) (*------------------------------------------------------*) - (* it's a character reference. *) + (* it's a character Unsynchronized.reference. *) (*------------------------------------------------------*) then let val (cs,(ch,a1,q1)) = parseCharRefLit [0wx23,0wx26] (a,q) val cv = Data2Vector(rev cs) @@ -678,7 +678,7 @@ struct handle SyntaxError caq => caq | NoSuchChar aq => getChar aq (*---------------------------------------------------------*) - (* it's a general entity reference. *) + (* it's a general entity Unsynchronized.reference. *) (*---------------------------------------------------------*) else let val ((id,ent),(a1,q1)) = parseGenRef dtd (c,a,q) in case ent @@ -715,7 +715,7 @@ struct "parseGenRef returned GE_UNPARSED") end (*-------------------------------------------------------*) - (* handle any errors in references by ignoring them. *) + (* handle any errors in Unsynchronized.references by ignoring them. *) (*-------------------------------------------------------*) handle SyntaxError caq => caq | NoSuchEntity aq => getChar aq diff --git a/fxp/src/Parser/Parse/parseDecl.sml b/fxp/src/Parser/Parse/parseDecl.sml index 478e9a5..9efc861 100644 --- a/fxp/src/Parser/Parse/parseDecl.sml +++ b/fxp/src/Parser/Parse/parseDecl.sml @@ -897,7 +897,7 @@ struct (*--------------------------------------------------------------------*) (* parse an attribute type, the 1st arg being the element this decl. *) - (* refers to. 3.3.1: *) + (* Unsynchronized.refers to. 3.3.1: *) (* *) (* [54] AttType ::= StringType | TokenizedType | EnumeratedType *) (* *) @@ -1026,7 +1026,7 @@ struct else let val (cv,(av,a4)) = makeAttValue dtd (a3,q2) (aidx,attType,false,true,text) - in (AD_FIXED((lit,cv,av),(getPos q2,ref false)),(c3,a4,q3)) + in (AD_FIXED((lit,cv,av),(getPos q2,Unsynchronized.ref false)),(c3,a4,q3)) end handle AttValue a => (AD_IMPLIED,(c3,a,q3)) end @@ -1052,13 +1052,13 @@ struct in (AD_IMPLIED,(c1,a2,q1)) end else let val (cv,(av,a2)) = makeAttValue dtd (a1,q) (aidx,attType,false,true,text) - in (AD_DEFAULT((lit,cv,av),(getPos q,ref false)),(c1,a2,q1)) + in (AD_DEFAULT((lit,cv,av),(getPos q,Unsynchronized.ref false)),(c1,a2,q1)) end handle AttValue a => (AD_IMPLIED,(c1,a,q1)) end (*--------------------------------------------------------------------*) - (* parse an attribute definition, the referred element given as 1st *) + (* parse an attribute definition, the Unsynchronized.referred element given as 1st *) (* argument. 3.3: *) (* *) (* [53] AttDef ::= S Name S AttType S DefaultDecl *) diff --git a/fxp/src/Parser/entities.sml b/fxp/src/Parser/entities.sml index e2cbcf0..46334ed 100644 --- a/fxp/src/Parser/entities.sml +++ b/fxp/src/Parser/entities.sml @@ -46,7 +46,7 @@ (* *) (* The characters #x85 and #x2028 cannot be reliably recognized and *) (* translated until an entity's encoding declaration (if present) has *) -(* been read. Therefore, it is a fatal error to use them within the XML *) +(* been read. TheUnsynchronized.refore, it is a fatal error to use them within the XML *) (* declaration or text declaration. *) (****************************************************************************) (* *) @@ -86,7 +86,7 @@ signature Entities = val getChar : AppData * State -> UniChar.Char * AppData * State val getChar11 : AppData * State -> UniChar.Char * AppData * State - val getCharRef : (AppData * State -> UniChar.Char * AppData * State) ref + val getCharRef : (AppData * State -> UniChar.Char * AppData * State) Unsynchronized.ref val ungetChars : State * UniChar.Data -> State val isOpen : int * bool * State -> bool @@ -489,7 +489,7 @@ functor Entities (structure Hooks : Hooks) : Entities = else if c<0wx7F orelse c>0wx9F then (c,a,EXT1(dec1,l,col+1,false,typ)) else (* in XML 1.1 the control characters 0wx7F through 0wx9F must appear - only as chracter references *) + only as chracter Unsynchronized.references *) let val a1 = hookError(a,(getPos q,ERR_MUST_CHARREF c)) in @@ -530,7 +530,7 @@ functor Entities (structure Hooks : Hooks) : Entities = else if c<0wx7F orelse c>0wx9F then (c,a,EXT2(arr,s,i+1,l,col+1,false,det)) else (* in XML 1.1 the control characters 0wx7F through 0wx9F must appear - only as chracter references *) + only as chracter Unsynchronized.references *) let val a1 = hookError(a,(getPos q,ERR_MUST_CHARREF c)) in @@ -557,7 +557,7 @@ functor Entities (structure Hooks : Hooks) : Entities = | LOOKED(nil,q) => getChar11(a,q) | LOOKED(c::cs,q) => (c,a,LOOKED(cs,q)) - val getCharRef = ref getChar + val getCharRef = Unsynchronized.ref getChar fun getChar x = !getCharRef x diff --git a/fxp/src/Unicode/Chars/uniClasses.sml b/fxp/src/Unicode/Chars/uniClasses.sml index b013722..2f7db03 100644 --- a/fxp/src/Unicode/Chars/uniClasses.sml +++ b/fxp/src/Unicode/Chars/uniClasses.sml @@ -30,13 +30,13 @@ signature UniClasses = sig val isName : UniChar.Char -> bool val isName11 : UniChar.Char -> bool - val isNameRef : (UniChar.Char -> bool) ref + val isNameRef : (UniChar.Char -> bool) Unsynchronized.ref val isNms : UniChar.Char -> bool val isNms11 : UniChar.Char -> bool - val isNmsRef : (UniChar.Char -> bool) ref + val isNmsRef : (UniChar.Char -> bool) Unsynchronized.ref val isXml : UniChar.Char -> bool val isXml11 : UniChar.Char -> bool - val isXmlRef : (UniChar.Char -> bool) ref + val isXmlRef : (UniChar.Char -> bool) Unsynchronized.ref val isPubid : UniChar.Char -> bool val isS : UniChar.Char -> bool val isEnc : UniChar.Char -> bool @@ -112,7 +112,7 @@ structure UniClasses : UniClasses = fun isNms11 c = if c<=0wxFFFF then inCharClass(c,nms11Class) else c>=0wx10000 andalso c<=0wxEFFFF - val isNmsRef = ref isNms + val isNmsRef = Unsynchronized.ref isNms fun isNms x = (!isNmsRef) x @@ -129,7 +129,7 @@ structure UniClasses : UniClasses = fun isName11 c = if c<=0wxFFFF then inCharClass(c,name11Class) else c>=0wx10000 andalso c<=0wxEFFFF - val isNameRef = ref isName + val isNameRef = Unsynchronized.ref isName fun isName x = (!isNameRef) x @@ -150,7 +150,7 @@ structure UniClasses : UniClasses = c>=0wxE000 andalso c<=0wxFFFD orelse c>=0wx10000 andalso c<=0wx10FFFF - val isXmlRef = ref isXml + val isXmlRef = Unsynchronized.ref isXml fun isXml x = (!isXmlRef) x diff --git a/fxp/src/Util/SymDict/dict.sml b/fxp/src/Util/SymDict/dict.sml index 1dd1e6a..2af8681 100644 --- a/fxp/src/Util/SymDict/dict.sml +++ b/fxp/src/Util/SymDict/dict.sml @@ -108,21 +108,21 @@ functor Dict (structure Key : Key) : Dict = (* - a default value for the value table *) (*--------------------------------------------------------------------*) type 'a Dict = {desc : string, - tab : (Key * 'a) array ref, - hashTab : Bucket array ref, - hashFun : (Key -> int) ref, - width : int ref, (* bit width *) - size : int ref, (* tab size=2^width, hash size is double *) - count : int ref, (* number of entries *) + tab : (Key * 'a) array Unsynchronized.ref, + hashTab : Bucket array Unsynchronized.ref, + hashFun : (Key -> int) Unsynchronized.ref, + width : int Unsynchronized.ref, (* bit width *) + size : int Unsynchronized.ref, (* tab size=2^width, hash size is double *) + count : int Unsynchronized.ref, (* number of entries *) def : 'a (* default for values *) } fun nullDict (desc,def) = {desc = desc, - tab = ref (Array.array(1,(Key.null,def))), - hashTab = ref (Array.array(2,nullBucket)), - hashFun = ref (fn _ => 0), - count = ref 0, - size = ref 1, - width = ref 0, + tab = Unsynchronized.ref (Array.array(1,(Key.null,def))), + hashTab = Unsynchronized.ref (Array.array(2,nullBucket)), + hashFun = Unsynchronized.ref (fn _ => 0), + count = Unsynchronized.ref 0, + size = Unsynchronized.ref 1, + width = Unsynchronized.ref 0, def = def} (*--------------------------------------------------------------------*) @@ -168,12 +168,12 @@ functor Dict (structure Key : Key) : Dict = val width= Int.min(Int.max(1,w),MAX_WIDTH) val size = Word.toInt(Word.<<(0w1,Word.fromInt(width-1))) in {desc = desc, - tab = ref (Array.array(size,(Key.null,def))), - hashTab = ref (Array.array(2*size,nullBucket)), - hashFun = ref (makeHashFun(size,width)), - width = ref width, - size = ref size, - count = ref 0, + tab = Unsynchronized.ref (Array.array(size,(Key.null,def))), + hashTab = Unsynchronized.ref (Array.array(2*size,nullBucket)), + hashFun = Unsynchronized.ref (makeHashFun(size,width)), + width = Unsynchronized.ref width, + size = Unsynchronized.ref size, + count = Unsynchronized.ref 0, def = def} end @@ -184,7 +184,7 @@ functor Dict (structure Key : Key) : Dict = case widthOpt of NONE => let - val {tab=ref tab,hashTab=ref hashTab,size,count,def,...} = dict + val {tab=Unsynchronized.ref tab,hashTab=Unsynchronized.ref hashTab,size,count,def,...} = dict val _ = appInterval (fn i => Array.update(tab,i,(Key.null,def))) (0,!count-1) val _ = appInterval (fn i => Array.update(hashTab,i,nullBucket)) (0,!size*2-1) in diff --git a/fxp/src/Util/SymDict/symbolTable.sml b/fxp/src/Util/SymDict/symbolTable.sml index 5d03e45..53b04ad 100644 --- a/fxp/src/Util/SymDict/symbolTable.sml +++ b/fxp/src/Util/SymDict/symbolTable.sml @@ -99,21 +99,21 @@ functor SymTable (structure Key : Key) : SymTable = (* - an integer count holding the next free index *) (*--------------------------------------------------------------------*) type SymTable = {desc : string, - tab : Key array ref, - hash : Bucket array ref, - hashFun : (Key -> int) ref, - width : int ref, (* bit width *) - size : int ref, (* tab size=2^width, hash size is double *) - count : int ref (* number of entries *) + tab : Key array Unsynchronized.ref, + hash : Bucket array Unsynchronized.ref, + hashFun : (Key -> int) Unsynchronized.ref, + width : int Unsynchronized.ref, (* bit width *) + size : int Unsynchronized.ref, (* tab size=2^width, hash size is double *) + count : int Unsynchronized.ref (* number of entries *) } fun nullSymTable desc = {desc = desc, - tab = ref (Array.array(1,Key.null)), - hash = ref (Array.array(2,nullBucket)), - hashFun = ref (fn _ => 0), - count = ref 0, - size = ref 1, - width = ref 0} : SymTable + tab = Unsynchronized.ref (Array.array(1,Key.null)), + hash = Unsynchronized.ref (Array.array(2,nullBucket)), + hashFun = Unsynchronized.ref (fn _ => 0), + count = Unsynchronized.ref 0, + size = Unsynchronized.ref 1, + width = Unsynchronized.ref 0} : SymTable (*--------------------------------------------------------------------*) (* how many entries are in the symtable? *) @@ -158,12 +158,12 @@ functor SymTable (structure Key : Key) : SymTable = val width= Int.min(Int.max(1,w),MAX_WIDTH) val size = Word.toInt(Word.<<(0w1,Word.fromInt(width-1))) in {desc = desc, - tab = ref (Array.array(size,Key.null)), - hash = ref (Array.array(2*size,nullBucket)), - hashFun = ref (makeHashFun(size,width)), - width = ref width, - size = ref size, - count = ref 0} + tab = Unsynchronized.ref (Array.array(size,Key.null)), + hash = Unsynchronized.ref (Array.array(2*size,nullBucket)), + hashFun = Unsynchronized.ref (makeHashFun(size,width)), + width = Unsynchronized.ref width, + size = Unsynchronized.ref size, + count = Unsynchronized.ref 0} end (*--------------------------------------------------------------------*) @@ -173,7 +173,7 @@ functor SymTable (structure Key : Key) : SymTable = case widthOpt of NONE => let - val {tab=ref tab,hash=ref hash,size,count,...} = symTab + val {tab=Unsynchronized.ref tab,hash=Unsynchronized.ref hash,size,count,...} = symTab val _ = appInterval (fn i => Array.update(tab,i,Key.null)) (0,!count-1) val _ = appInterval (fn i => Array.update(hash,i,nullBucket)) (0,!size*2-1) in @@ -276,7 +276,7 @@ functor SymTable (structure Key : Key) : SymTable = (*--------------------------------------------------------------------*) (* reserve an index for a (yet unknown) key. *) (*--------------------------------------------------------------------*) - fun reserveSymIndex(st as {size,count=count as ref i,...}:SymTable) = + fun reserveSymIndex(st as {size,count=count as Unsynchronized.ref i,...}:SymTable) = let val _ = if !size>i then () else growTable st val _ = count := i+1