Commit 0ab4a63b authored by Ronny Wichers Schreur's avatar Ronny Wichers Schreur 🏢
Browse files

moved var info definitions to the modules where they are used

parent 33ccf081
......@@ -5,6 +5,8 @@ definition module convertDynamics
import syntax, transform
:: TypeCodeVariableInfo
:: DynamicValueAliasInfo
convertDynamicPatternsIntoUnifyAppls :: {! GlobalTCType} !{# CommonDefs} !Int !*{! Group} !*{#FunDef} !*PredefinedSymbols !*VarHeap !*TypeHeaps !*ExpressionHeap (Optional *File) {# DclModule} !IclModule /* TD */ [String]
-> (!*{! Group}, !*{#FunDef}, !*PredefinedSymbols, !*{#{# CheckedTypeDef}}, !ImportedConstructors, !*VarHeap, !*TypeHeaps, !*ExpressionHeap, Optional *File)
......@@ -17,6 +17,9 @@ import type_io;
from type_io_common import class toString (..),instance toString GlobalTCType;
0.2*/
:: TypeCodeVariableInfo = TCI_TypeTerm | TCI_TypeVar !Expression
:: DynamicValueAliasInfo :== BoundVar
:: *ConversionState =
{ ci_predef_symb :: !*PredefinedSymbols
, ci_var_heap :: !*VarHeap
......
......@@ -5,6 +5,9 @@ definition module convertcases
import syntax, transform
:: LetVarInfo
:: LetExpressionInfo
convertCasesOfFunctions :: !*{! Group} !Int !{# {# FunType} } !{# CommonDefs} !*{#FunDef} !*{#{# CheckedTypeDef}}
!ImportedConstructors !*VarHeap !*TypeHeaps !*ExpressionHeap
-> (!ImportedFunctions, !*{! Group}, !*{#FunDef}, !*{#{# CheckedTypeDef}}, !ImportedConstructors, !*VarHeap, !*TypeHeaps, !*ExpressionHeap)
......@@ -126,6 +126,21 @@ convertCasesInBody (TransformedBody body) (Yes type) group_index common_defs cs
, rcs_expr_heap :: !.ExpressionHeap
}
:: LetVarInfo =
{ lvi_count :: !Int
, lvi_depth :: !Int
, lvi_new :: !Bool
, lvi_var :: !Ident
, lvi_expression :: !Expression
, lvi_previous :: ![PreviousLetVarInfo]
}
:: PreviousLetVarInfo =
{ plvi_count :: !Int
, plvi_depth :: !Int
, plvi_new :: !Bool
}
checkImportedSymbol :: SymbKind VarInfoPtr ([SymbKind], *VarHeap) -> ([SymbKind], *VarHeap)
checkImportedSymbol symb_kind symb_type_ptr (collected_imports, var_heap)
# (type_info, var_heap) = readPtr symb_type_ptr var_heap
......@@ -421,6 +436,17 @@ where
only if the expr is neither used in the pattern nor in a surrounding expr.
*/
:: LetExpressionStatus = LES_Untouched | LES_Moved | LES_Updated !Expression
:: LetExpressionInfo =
{ lei_count :: !Int
, lei_depth :: !Int
, lei_var :: !FreeVar
, lei_expression :: !Expression
, lei_status :: !LetExpressionStatus
, lei_type :: !AType
}
:: DistributeState =
{ ds_lets :: ![VarInfoPtr]
, ds_var_heap :: !.VarHeap
......
......@@ -599,7 +599,7 @@ pIsSafe :== True
:: AP_Kind = APK_Constructor !Index | APK_Macro !Bool // is_dcl_macro
:: TypeCodeVariableInfo = TCI_TypeTerm | TCI_TypeVar !Expression
from convertDynamics import :: TypeCodeVariableInfo, :: DynamicValueAliasInfo
:: VarInfo = VI_Empty | VI_Type !AType !(Optional CoercionPosition) | VI_FAType ![ATypeVar] !AType !(Optional CoercionPosition) |
VI_Occurrence !Occurrence | VI_UsedVar !Ident |
......@@ -620,7 +620,7 @@ pIsSafe :== True
VI_Record ![AuxiliaryPattern] |
VI_Pattern !AuxiliaryPattern |
VI_TypeCodeVariable !TypeCodeVariableInfo |
VI_DynamicValueAlias !BoundVar |
VI_DynamicValueAlias !DynamicValueAliasInfo |
VI_Body !SymbIdent !TransformedBody ![FreeVar] | /* used during fusion */
VI_Dictionary !SymbIdent ![Expression] !Type | /* used during fusion */
VI_Extended !ExtendedVarInfo !VarInfo |
......@@ -637,31 +637,7 @@ pIsSafe :== True
:: VarInfoPtr :== Ptr VarInfo
:: LetVarInfo =
{ lvi_count :: !Int
, lvi_depth :: !Int
, lvi_new :: !Bool
, lvi_var :: !Ident
, lvi_expression :: !Expression
, lvi_previous :: ![PreviousLetVarInfo]
}
:: PreviousLetVarInfo =
{ plvi_count :: !Int
, plvi_depth :: !Int
, plvi_new :: !Bool
}
:: LetExpressionStatus = LES_Untouched | LES_Moved | LES_Updated !Expression
:: LetExpressionInfo =
{ lei_count :: !Int
, lei_depth :: !Int
, lei_var :: !FreeVar
, lei_expression :: !Expression
, lei_status :: !LetExpressionStatus
, lei_type :: !AType
}
from convertcases import :: LetVarInfo, :: LetExpressionInfo
cNotVarNumber :== -1
......
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