Fixed the name munging for declared user-defined operators

This commit is contained in:
Neil Brown 2009-04-08 12:14:05 +00:00
parent 1e21895276
commit 1ea35c6715
2 changed files with 5 additions and 2 deletions

View File

@ -22,7 +22,7 @@ module Types
specTypeOfName, typeOfSpec, typeOfSpec', abbrevModeOfName, underlyingType, underlyingTypeOf, stripArrayType, abbrevModeOfVariable, abbrevModeOfSpec
, isRealType, isIntegerType, isNumericType, isCaseableType, isScalarType, isDataType, isCommunicableType, isSequenceType, isMobileType
, resolveUserType, isSafeConversion, isPreciseConversion, isImplicitConversionRain
, isOperator, functionOperator, occamDefaultOperator, occamBuiltInOperatorFunctions
, isOperator, functionOperator, occamDefaultOperator, occamBuiltInOperatorFunctions, occamOperatorTranslateDefault
, returnTypesOfFunction
, BytesInResult(..), bytesInType, countReplicator, countStructured, computeStructured

View File

@ -405,7 +405,10 @@ findName thisN thisNT
scopeIn :: A.Name -> NameType -> A.SpecType -> A.AbbrevMode -> (Maybe A.Name, A.NameSource) -> OccParser A.Name
scopeIn n@(A.Name m s) nt specType am (munged, ns)
= do n' <- maybe (makeUniqueName m s >>* A.Name m) return munged
= do let s' = if isOperator s
then occamOperatorTranslateDefault s
else s
n' <- maybe (makeUniqueName m s' >>* A.Name m) return munged
let nd = A.NameDef {
A.ndMeta = m,
A.ndName = A.nameName n',