Commit 01504e10 authored by Ronny Wichers Schreur's avatar Ronny Wichers Schreur 🏘
Browse files

clean up: introduced quote function for strings

parent c18a60be
......@@ -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
......
Markdown is supported
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