aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartinw2001-03-02 11:04:51 +0000
committermartinw2001-03-02 11:04:51 +0000
commita9d0a3079a558d012ac5ca0e6f5f51a1b6de54ff (patch)
tree28fd74cc3a4835e53d648136c83c526611172970
parentbugfix: compiler couldn't detect following inconsistency: (diff)
making compiler self compilable (this doesn't say anything about the
quality of the generated executable) git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@314 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
-rw-r--r--frontend/check.icl5
-rw-r--r--frontend/checksupport.dcl2
-rw-r--r--frontend/checksupport.icl2
-rw-r--r--frontend/convertcases.icl4
-rw-r--r--frontend/main.icl9
-rw-r--r--frontend/portToNewSyntax.dcl10
-rw-r--r--frontend/transform.icl17
-rw-r--r--frontend/type.icl4
8 files changed, 19 insertions, 34 deletions
diff --git a/frontend/check.icl b/frontend/check.icl
index 421b8bc..eca7d46 100644
--- a/frontend/check.icl
+++ b/frontend/check.icl
@@ -1042,7 +1042,7 @@ checkDclModules imports_of_icl_mod dcl_modules icl_functions heaps cs=:{cs_symbo
checkDclComponent :: !{![Int]} !{![Int]} ![[(Index, Position, [ImportNrAndIdents])]] ![Int]
!(!Int, !*ExplImpInfos, !*{# DclModule}, !*{# FunDef}, !*Heaps,!*CheckState)
- -> (!Int, !.ExplImpInfos, !.{# DclModule}, !.{# FunDef}, !.Heaps,!.CheckState)
+ -> (!Int, !*ExplImpInfos, !.{# DclModule}, !.{# FunDef}, !.Heaps,!.CheckState)
checkDclComponent components_array super_components expl_imp_indices mod_indices
(component_nr, expl_imp_infos, dcl_modules, icl_functions, heaps, cs=:{cs_x})
| not cs.cs_error.ea_ok || hd mod_indices==size dcl_modules // the icl module!
@@ -1924,6 +1924,9 @@ add_declaration_to_symbol_table opt_dcl_macro_range {dcl_kind=STE_FunctionOrMacr
add_declaration_to_symbol_table yes_for_icl_module {dcl_kind=dcl_kind=:STE_Imported def_kind def_mod, dcl_ident, dcl_index, dcl_pos} importing_mod cs
= addSymbol yes_for_icl_module dcl_ident dcl_pos dcl_kind def_kind dcl_index def_mod importing_mod cs
+updateExplImpInfo :: [Int] Index {!Declaration} {!Declaration} u:{#DclModule}
+ {!{!*ExplImpInfo}} *SymbolTable
+ -> (u:{#DclModule},!{!{!.ExplImpInfo}},.SymbolTable)
updateExplImpInfo super_components mod_index dcls_import dcls_local_for_import
dcl_modules expl_imp_infos cs_symbol_table
# (changed_symbols, (expl_imp_infos, cs_symbol_table))
diff --git a/frontend/checksupport.dcl b/frontend/checksupport.dcl
index d0442fc..695bd4a 100644
--- a/frontend/checksupport.dcl
+++ b/frontend/checksupport.dcl
@@ -63,7 +63,7 @@ cConversionTableSize :== 8
, dcls_local_for_import ::!{!Declaration}
}
-:: ExplImpInfos :== {!{!.ExplImpInfo}}
+:: *ExplImpInfos :== *{!*{!*ExplImpInfo}}
:: ExplImpInfo
= ExplImpInfo Ident !.DeclaringModulesSet
diff --git a/frontend/checksupport.icl b/frontend/checksupport.icl
index 7eb91eb..13b3ef0 100644
--- a/frontend/checksupport.icl
+++ b/frontend/checksupport.icl
@@ -75,7 +75,7 @@ where
, dcls_local_for_import ::!{!Declaration}
}
-:: ExplImpInfos :== {!{!.ExplImpInfo}}
+:: *ExplImpInfos :== *{!*{!*ExplImpInfo}}
:: ExplImpInfo
= ExplImpInfo Ident !.DeclaringModulesSet
diff --git a/frontend/convertcases.icl b/frontend/convertcases.icl
index 11b09e0..9b5050a 100644
--- a/frontend/convertcases.icl
+++ b/frontend/convertcases.icl
@@ -1562,10 +1562,6 @@ instance <<< (Ptr a)
where
(<<<) file ptr = file <<< ptrToInt ptr
-instance <<< BoundVar
-where
- (<<<) file {var_name,var_info_ptr} = file <<< var_name <<< '[' <<< var_info_ptr <<< ']'
-
instance <<< FunctionBody
where
(<<<) file (TransformedBody {tb_rhs}) = file <<< tb_rhs
diff --git a/frontend/main.icl b/frontend/main.icl
index 7fc2459..06a4e99 100644
--- a/frontend/main.icl
+++ b/frontend/main.icl
@@ -21,14 +21,6 @@ Start world
CommandLoop proj ms=:{ms_io}
- # answer = "c t5\n"
- (command, argument) = SplitAtLayoutChar (dropWhile isSpace (fromString answer))
- | command == []
- = CommandLoop proj { ms & ms_io = ms_io}
- # (ready, proj, ms) = DoCommand command argument proj { ms & ms_io = ms_io}
- = ms
-/*
-CommandLoop proj ms=:{ms_io}
# (answer, ms_io) = freadline (ms_io <<< "> ")
(command, argument) = SplitAtLayoutChar (dropWhile isSpace (fromString answer))
| command == []
@@ -37,7 +29,6 @@ CommandLoop proj ms=:{ms_io}
| ready
= ms
= CommandLoop proj ms
-*/
:: MainStateDefs funs funtypes types conses classes instances members selectors =
{ msd_funs :: !funs
diff --git a/frontend/portToNewSyntax.dcl b/frontend/portToNewSyntax.dcl
index a5367f8..2e06636 100644
--- a/frontend/portToNewSyntax.dcl
+++ b/frontend/portToNewSyntax.dcl
@@ -2,16 +2,6 @@ definition module portToNewSyntax
// see the file readme.txt in the portToNewSyntax folder about
// this module
-from StdMisc import abort
-//1.3
-from StdFile import Files
-from StdString import String
-from scanner import SearchPaths
-//3.1
-/*2.0
-from StdFile import :: Files
-from scanner import :: SearchPaths
-0.2*/
import checksupport
switch_port_to_new_syntax port dont_port :== dont_port
diff --git a/frontend/transform.icl b/frontend/transform.icl
index 3d216b1..768c5e6 100644
--- a/frontend/transform.icl
+++ b/frontend/transform.icl
@@ -1253,15 +1253,18 @@ instance expand Expression
where
expand (App app=:{app_symb = symb=:{symb_arity, symb_kind = SK_Macro {glob_object,glob_module}}, app_args}) ei
# (app_args, (calls, es)) = expand app_args ei
- # (macro, es) = es!es_fun_defs.[glob_object]
+ (macro, es) = es!es_fun_defs.[glob_object]
| macro.fun_arity == symb_arity
= unfoldMacro macro app_args (calls, es)
- # (calls, es_symbol_table) = examineFunctionCall macro.fun_symb {fc_index = glob_object, fc_level = NotALevel} (calls, es.es_symbol_table)
- | macro.fun_info.fi_group_index<NoIndex
- # macro = {macro & fun_info.fi_group_index= -2-macro.fun_info.fi_group_index}
- # es= {es & es_fun_defs.[glob_object]=macro}
- = (App { app & app_symb = { symb & symb_kind = SK_Function {glob_object = glob_object, glob_module = glob_module} }, app_args = app_args },(calls, { es & es_symbol_table = es_symbol_table }))
- = (App { app & app_symb = { symb & symb_kind = SK_Function {glob_object = glob_object, glob_module = glob_module} }, app_args = app_args },(calls, { es & es_symbol_table = es_symbol_table }))
+ # (calls, es_symbol_table)
+ = examineFunctionCall macro.fun_symb {fc_index = glob_object, fc_level = NotALevel}
+ (calls, es.es_symbol_table)
+ es = { es & es_symbol_table = es_symbol_table }
+ | macro.fun_info.fi_group_index<NoIndex
+ # macro = {macro & fun_info.fi_group_index= -2-macro.fun_info.fi_group_index}
+ es= {es & es_fun_defs.[glob_object]=macro}
+ = (App { app & app_symb = { symb & symb_kind = SK_Function {glob_object = glob_object, glob_module = glob_module} }, app_args = app_args },(calls, es))
+ = (App { app & app_symb = { symb & symb_kind = SK_Function {glob_object = glob_object, glob_module = glob_module} }, app_args = app_args },(calls, es))
expand (App app=:{app_args}) ei
# (app_args, ei) = expand app_args ei
= (App { app & app_args = app_args }, ei)
diff --git a/frontend/type.icl b/frontend/type.icl
index 8680b19..2962f5a 100644
--- a/frontend/type.icl
+++ b/frontend/type.icl
@@ -845,7 +845,7 @@ freshAttribute ts=:{ts_attr_store}
}
attribute_error type_attr No
- = abort ("sanity check nr 723 failed in module type"--->("type_attr", type_attr))
+ = No // XXX abort ("sanity check nr 723 failed in module type"--->("type_attr", type_attr))
attribute_error type_attr (Yes err)
# err = errorHeading "Type error" err
= Yes { err & ea_file = err.ea_file <<< "* attribute expected instead of " <<< type_attr <<< '\n' }
@@ -869,6 +869,7 @@ addPropagationAttributesToAType modules type=:{at_type = TA cons_id=:{type_index
= unsafeFold2St (check_kind type_name modules) tdi_kinds cons_args (1, error_admin)
-> Yes error_admin
= ({ type & at_type = TA cons_id cons_args, at_attribute = at_attribute }, prop_class, { ps & prop_attr_vars = prop_attr_vars,
+// MW probably = ({ type & at_type = TA cons_id cons_args, at_attribute = at_attribute, at_annotation = AN_None }, prop_class, { ps & prop_attr_vars = prop_attr_vars,
prop_td_infos = prop_td_infos, prop_attr_env = prop_attr_env,
prop_type_heaps = { prop_type_heaps & th_vars = th_vars, th_attrs = th_attrs}, prop_error = prop_error })
where
@@ -965,6 +966,7 @@ addPropagationAttributesToAType modules type=:{at_type = TA cons_id=:{type_index
addPropagationAttributesToAType modules type=:{at_type} ps
# (at_type, ps) = addPropagationAttributesToType modules at_type ps
= ({ type & at_type = at_type }, NoPropClass, ps)
+// MW probably = ({ type & at_type = at_type, at_annotation = AN_None }, NoPropClass, ps)
addPropagationAttributesToType modules (arg_type --> res_type) ps
# (arg_type, prop_class, ps) = addPropagationAttributesToAType modules arg_type ps