diff --git a/common/Types.hs b/common/Types.hs index 9294622..c19ac30 100644 --- a/common/Types.hs +++ b/common/Types.hs @@ -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 diff --git a/frontends/ParseOccam.hs b/frontends/ParseOccam.hs index 317aace..dd88bed 100644 --- a/frontends/ParseOccam.hs +++ b/frontends/ParseOccam.hs @@ -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',