Commit a395db8f authored by John van Groningen's avatar John van Groningen
Browse files

move FunctionPattern type from syntax to backendconvert

parent a5ee3e52
......@@ -29,6 +29,12 @@ sfoldr op r l s
foldr [] = r
foldr [a:x] = op a (foldr x)
:: FunctionPattern = FP_Basic !BasicValue !(Optional FreeVar)
| FP_Algebraic !(Global DefinedSymbol) ![FunctionPattern] !(Optional FreeVar)
| FP_Variable !FreeVar
| FP_Dynamic ![VarInfoPtr] !FreeVar !TypeCodeExpression !(Optional FreeVar)
| FP_Empty
:: BEMonad a :== *BackEndState -> *(!a,!*BackEndState)
:: BackEnder :== *BackEndState -> *BackEndState
......
......@@ -175,17 +175,6 @@ instance sequence LetBind where
sequence bind
= sequence bind.lb_dst
instance sequence FunctionPattern where
sequence (FP_Algebraic _ subpatterns optionalVar)
= sequence subpatterns
o` sequence optionalVar
sequence (FP_Variable freeVar)
= sequence freeVar
sequence (FP_Basic _ optionalVar)
= sequence optionalVar
sequence FP_Empty
= identity
instance sequence (Ptr VarInfo) where
sequence varInfoPtr
= assignSequenceNumber varInfoPtr
......@@ -1277,13 +1277,6 @@ instance == OverloadedListType
| TCE_UnqType !TypeCodeExpression
:: GlobalTCType = GTT_Basic !BasicType | GTT_Constructor !SymbIdent | GTT_PredefTypeConstructor !(Global Index) | GTT_Function
:: FunctionPattern = FP_Basic !BasicValue !(Optional FreeVar)
| FP_Algebraic !(Global DefinedSymbol) ![FunctionPattern] !(Optional FreeVar)
| FP_Variable !FreeVar
| FP_Dynamic ![VarInfoPtr] !FreeVar !TypeCodeExpression !(Optional FreeVar)
| FP_Empty
:: AlgebraicPattern =
{ ap_symbol :: !(Global DefinedSymbol)
......@@ -1346,7 +1339,7 @@ cNotALineNumber :== -1
instance == ModuleKind, Ident
instance <<< (Module a) | <<< a, ParsedDefinition, InstanceType, AttributeVar, TypeVar, SymbolType, Expression, Type, Ident, (Global object) | <<< object,
Position, CaseAlt, AType, FunDef, ParsedExpr, TypeAttribute, (Bind a b) | <<< a & <<< b, ParsedConstructor, (TypeDef a) | <<< a, TypeVarInfo, AttrVarInfo,
BasicValue, ATypeVar, TypeRhs, FunctionPattern, (Import from_symbol) | <<< from_symbol, ImportDeclaration, ImportedIdent, CasePatterns,
BasicValue, ATypeVar, TypeRhs, (Import from_symbol) | <<< from_symbol, ImportDeclaration, ImportedIdent, CasePatterns,
(Optional a) | <<< a, ConsVariable, BasicType, Annotation, SelectorKind, Selection, SelectorDef, ConsDef, LocalDefs, FreeVar, ClassInstance, SignClassification,
TypeCodeExpression, CoercionPosition, AttrInequality, LetBind, Declaration, STE_Kind, BoundVar,
TypeSymbIdent,
......
......@@ -526,22 +526,6 @@ instance <<< ParsedBody
where
(<<<) file {pb_args,pb_rhs} = file <<< pb_args <<< " = " <<< pb_rhs
instance <<< FunctionPattern
where
(<<<) file (FP_Basic val (Yes var))
= file <<< var <<< "=:" <<< val
(<<<) file (FP_Basic val No)
= file <<< val
(<<<) file (FP_Algebraic constructor vars (Yes var))
= file <<< var <<< "=:" <<< constructor <<< vars
(<<<) file (FP_Algebraic constructor vars No)
= file <<< constructor <<< vars
(<<<) file (FP_Variable var) = file <<< var
(<<<) file (FP_Dynamic vars var type_code _)
= writeVarPtrs (file <<< var <<< " :: ") vars <<< type_code
(<<<) file (FP_Empty) = file <<< '_'
instance <<< FunKind
where
(<<<) file (FK_Function False) = file <<< "FK_Function"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment