Commit 2c6cabd0 authored by Vincent Zweije's avatar Vincent Zweije
Browse files

Change user-defined symbol representation

parent b48541b6
......@@ -4,7 +4,7 @@ definition module coreclean
from strat import Strategy
from rule import Rule
from syntax import TypeSymbIdent,Ident,TypeVar,ExprInfoPtr,VarInfoPtr
from syntax import TypeSymbIdent,Ident,TypeVar,ExprInfoPtr,VarInfoPtr,SymbKind
// Transitive necessities
from strat import Substrategy
......@@ -34,7 +34,7 @@ from StdString import String
sucltypeheap :: [SuclTypeVariable]
:: SuclSymbol
= SuclUser Ident
= SuclUser SymbKind
| SuclCase ExprInfoPtr
| SuclApply Int
| SuclInt Int
......
......@@ -30,7 +30,7 @@ sucltypeheap :: [SuclTypeVariable]
sucltypeheap =: map SuclANONYMOUS [0..]
:: SuclSymbol
= SuclUser Ident
= SuclUser SymbKind
| SuclCase ExprInfoPtr
| SuclApply Int
| SuclInt Int
......@@ -76,6 +76,18 @@ where (==) (SuclUser id1 ) (SuclUser id2 ) = id1 == id2
(==) (SuclBool bool1) (SuclBool bool2) = bool1 == bool2
(==) _ _ = False
instance == SymbKind
where (==) SK_Unknown SK_Unknown = True
(==) (SK_Function gi1) (SK_Function gi2) = gi1==gi2
(==) (SK_LocalMacroFunction i1) (SK_LocalMacroFunction i2) = i1==i2
(==) (SK_OverloadedFunction gi1) (SK_OverloadedFunction gi2) = gi1==gi2
(==) (SK_Generic gi1 tk1) (SK_Generic gi2 tk2) = gi1==gi2 && tk1==tk2
(==) (SK_Constructor gi1) (SK_Constructor gi2) = gi1==gi2
(==) (SK_Macro gi1) (SK_Macro gi2) = gi1==gi2
(==) (SK_GeneratedFunction fip1 i1) (SK_GeneratedFunction fip2 i2) = fip1==fip2 && i1==i2
(==) SK_TypeCode SK_TypeCode = True
(==) _ _ = False
instance == SuclVariable
where (==) (SuclAnonymous i1) (SuclAnonymous i2) = i1 == i2
(==) (SuclNamed p1) (SuclNamed p2) = p1 == p2
......
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