Commit 554035e5 authored by Diederik van Arkel's avatar Diederik van Arkel
Browse files

move typedefs from trans to syntax; allow for uncurried instances; fix compare for PR_Unused

parent 2735587a
......@@ -3,7 +3,7 @@
*/
implementation module convertDynamics
import syntax, transform, utilities, convertcases, compilerSwitches
import syntax, transform, utilities, convertcases, compilerSwitches, trans
from type_io_common import PredefinedModuleName
// Optional
USE_TUPLES tuple b :== b; // change also StdDynamic.icl and recompile all applications
......
......@@ -3,7 +3,7 @@
*/
definition module convertcases
import syntax, transform, trans
import syntax, transform
convertCasesOfFunctions :: !*{! Group} !Int !{# {# FunType} } !{# CommonDefs} !*{#FunDef} !*{#{# CheckedTypeDef}}
!ImportedConstructors !*VarHeap !*TypeHeaps !*ExpressionHeap
......
......@@ -582,6 +582,10 @@ cIsALocalVar :== False
pIsSafe :== True
:: ImportedConstructors :== [Global Index]
:: ImportedFunctions :== [Global Index]
:: ImportedTypes :== {#{# CheckedTypeDef}}
:: OptionalVariable :== Optional (Bind Ident VarInfoPtr)
:: AuxiliaryPattern
......
......@@ -559,6 +559,10 @@ cIsALocalVar :== False
pIsSafe :== True
:: ImportedConstructors :== [Global Index]
:: ImportedFunctions :== [Global Index]
:: ImportedTypes :== {#{# CheckedTypeDef}}
:: OptionalVariable :== Optional (Bind Ident VarInfoPtr)
:: AuxiliaryPattern
......
......@@ -11,10 +11,6 @@ transformGroups :: !CleanupInfo !Int !Int !*{! Group} !*{#FunDef} !*{!.ConsClass
partitionateFunctions :: !*{# FunDef} ![IndexRange] -> (!*{! Group}, !*{# FunDef})
:: ImportedConstructors :== [Global Index]
:: ImportedFunctions :== [Global Index]
:: ImportedTypes :== {#{# CheckedTypeDef}}
convertSymbolType :: !Bool !{# CommonDefs} !SymbolType !Int !*ImportedTypes !ImportedConstructors !*TypeHeaps !*VarHeap
-> (!SymbolType, !*ImportedTypes, !ImportedConstructors, !*TypeHeaps, !*VarHeap)
......
......@@ -882,6 +882,12 @@ tryToFindInstance new_prods II_Empty fun_heap
# (fun_def_ptr, fun_heap) = newPtr FI_Empty fun_heap
= (cIsANewFunction, fun_def_ptr, II_Node new_prods fun_def_ptr II_Empty II_Empty, fun_heap)
tryToFindInstance new_prods instances=:(II_Node prods fun_def_ptr left right) fun_heap
| size new_prods > size prods
# (is_new, new_fun_def_ptr, right, fun_heap) = tryToFindInstance new_prods right fun_heap
= (is_new, new_fun_def_ptr, II_Node prods fun_def_ptr left right, fun_heap)
| size new_prods < size prods
# (is_new, new_fun_def_ptr, left, fun_heap) = tryToFindInstance new_prods left fun_heap
= (is_new, new_fun_def_ptr, II_Node prods fun_def_ptr left right, fun_heap)
# cmp = compareProducers new_prods prods
| cmp == Equal
= (cIsNotANewFunction, fun_def_ptr, instances, fun_heap)
......@@ -927,6 +933,8 @@ where
= symb_ident1 =< symb_ident2
compare_constructor_arguments PR_Empty PR_Empty
= Equal
compare_constructor_arguments PR_Unused PR_Unused
= Equal
compare_constructor_arguments (PR_Constructor symb_ident1 _ _) (PR_Constructor symb_ident2 _ _)
= symb_ident1 =< symb_ident2
......@@ -2291,10 +2299,6 @@ add_let_binds free_vars rhss original_binds
//@ transformGroups
:: ImportedConstructors :== [Global Index]
:: ImportedFunctions :== [Global Index]
:: ImportedTypes :== {#{# CheckedTypeDef}}
transformGroups :: !CleanupInfo !Int !Int !*{! Group} !*{#FunDef} !*{!.ConsClasses} !{# CommonDefs} !{# {# FunType} }
!*ImportedTypes !ImportedConstructors !*TypeDefInfos !*VarHeap !*TypeHeaps !*ExpressionHeap !Bool
-> (!*{! Group}, !*{#FunDef}, !*ImportedTypes, !ImportedConstructors, !*VarHeap, !*TypeHeaps, !*ExpressionHeap, !*{!ConsClasses})
......
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