aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorronny2004-03-23 10:53:15 +0000
committerronny2004-03-23 10:53:15 +0000
commit4563850b63ca90d0328f73162e91b28fc88ded5e (patch)
tree0d46815d1a7d85108e87e5ef09d56cad187ebbf5 /frontend
parentrenamed variable (diff)
clean up: introduced quote function for strings
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1474 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend')
-rw-r--r--frontend/typereify.icl12
1 files changed, 7 insertions, 5 deletions
diff --git a/frontend/typereify.icl b/frontend/typereify.icl
index 546f25e..acdd9b2 100644
--- a/frontend/typereify.icl
+++ b/frontend/typereify.icl
@@ -365,6 +365,10 @@ record type_index bs=:{bs_common_defs, bs_predefs}
= predefRecordConstructor type_index bs_common_defs bs_predefs
= lift symbol {bs & bs_predefs=bs_predefs}
+quote :: {#Char} -> {#Char}
+quote string
+ = "\"" +++ string +++ "\""
+
function :: Index *BuildTypeFunState
-> *(Expression, *BuildTypeFunState)
function fun_index bs=:{bs_predefs}
@@ -403,16 +407,14 @@ instance reify {#Char} where
instance reify CheckedTypeDef where
reify {td_ident, td_arity, td_attribute, td_rhs}
- = record PD_CTTypeDef ` name ` td_arity ` is_unq_attribute td_attribute ` td_rhs
+ = record PD_CTTypeDef ` quote td_ident.id_name ` td_arity
+ ` is_unq_attribute td_attribute ` td_rhs
where
is_unq_attribute (TA_Var _)
= False
is_unq_attribute TA_Unique
= True
- name
- = ("\"" +++ td_ident.id_name +++ "\"")
-
instance reify TypeRhs where
reify (AlgType constructors)
= cons PD_CTAlgType ` get constructors
@@ -451,7 +453,7 @@ instance reify FieldSymbol where
where
selector fs_index st=:{bs_main, bs_common_defs}
= (record PD_CTFieldDef
- ` ("\"" +++ def.sd_ident.id_name +++ "\"")
+ ` quote def.sd_ident.id_name
` length (def.sd_exi_vars)
` def.sd_type.st_result)
(numberTypeVariables def.sd_type.st_vars