Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
f1b5100f
Commit
f1b5100f
authored
Nov 12, 1999
by
Sjaak Smetsers
Browse files
minor bug fix, some code polishing
parent
99c3e87f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
frontend/check.icl
View file @
f1b5100f
...
...
@@ -718,8 +718,9 @@ checkPatternConstructor mod_index is_expr_list {ste_index, ste_kind} cons_symb o
where
determine_pattern_symbol
mod_index
id_index
STE_Constructor
id_name
cons_defs
modules
error
#!
cons_def
=
cons_defs
.[
id_index
]
#
{
cons_type
={
st_arity
},
cons_priority
,
cons_type_index
}
=
cons_def
#
{
cons_symb
,
cons_type
={
st_arity
},
cons_priority
,
cons_type_index
}
=
cons_def
=
(
id_index
,
mod_index
,
st_arity
,
cons_priority
,
cons_type_index
,
cons_defs
,
modules
,
error
)
// ---> ("determine_pattern_symbol", id_name, cons_symb)
determine_pattern_symbol
mod_index
id_index
(
STE_Imported
STE_Constructor
import_mod_index
)
id_name
cons_defs
modules
error
#!
{
dcl_common
,
dcl_conversions
}
=
modules
.[
import_mod_index
]
#!
cons_def
=
dcl_common
.
com_cons_defs
.[
id_index
]
...
...
@@ -2226,11 +2227,11 @@ combineDclAndIclModule _ modules icl_decl_symbols icl_definitions icl_sizes cs
=
(
{
modules
&
[
cIclModIndex
]
=
{
dcl_mod
&
dcl_conversions
=
Yes
conversion_table
}}
,
icl_decl_symbols
,
{
icl_definitions
&
def_types
=
rev
_append
icl_definitions
.
def_types
new_type_defs
,
def_constructors
=
rev
_append
icl_definitions
.
def_constructors
new_cons_defs
,
def_selectors
=
rev
_append
icl_definitions
.
def_selectors
new_selector_defs
,
def_classes
=
rev
_append
icl_definitions
.
def_classes
new_class_defs
,
def_members
=
rev
_append
icl_definitions
.
def_members
new_member_defs
&
def_types
=
my
_append
icl_definitions
.
def_types
new_type_defs
,
def_constructors
=
my
_append
icl_definitions
.
def_constructors
new_cons_defs
,
def_selectors
=
my
_append
icl_definitions
.
def_selectors
new_selector_defs
,
def_classes
=
my
_append
icl_definitions
.
def_classes
new_class_defs
,
def_members
=
my
_append
icl_definitions
.
def_members
new_member_defs
}
,
icl_sizes
,
{
cs
&
cs_symbol_table
=
cs_symbol_table
}
...
...
@@ -2336,10 +2337,10 @@ where
(
new_type_defs
,
new_class_defs
,
new_cons_defs
,
new_selector_defs
,
new_member_defs
,
cs
)
=
(
new_type_defs
,
new_class_defs
,
new_cons_defs
,
new_selector_defs
,
new_member_defs
,
cs
)
rev
_append
front
[]
my
_append
front
[]
=
front
rev
_append
front
back
=
front
++
reverse
back
my
_append
front
back
=
front
++
back
(<=<)
infixl
(<=<)
state
fun
:==
fun
state
...
...
frontend/transform.icl
View file @
f1b5100f
...
...
@@ -901,7 +901,7 @@ liftFunctions min_level group group_index fun_defs var_heap expr_heap
#
(
contains_free_vars
,
lifted_function_called
,
fun_defs
)
=
foldSt
(
add_free_vars_of_non_recursive_calls_to_function
group_index
)
group
(
False
,
False
,
fun_defs
)
|
contains_free_vars
#
fun_defs
=
iterateSt
(
foldSt
(
add_free_vars_of_recursive_calls_to_function
group_index
)
group
)
fun_defs
#
fun_defs
=
iterateSt
(
add_free_vars_of_recursive_calls_to_function
s
group_index
group
)
fun_defs
=
lift_functions
group
fun_defs
var_heap
expr_heap
|
lifted_function_called
=
lift_functions
group
fun_defs
var_heap
expr_heap
...
...
@@ -925,6 +925,9 @@ where
#
(
free_vars_added
,
free_vars
)
=
add_free_variables
fun_def_level
fi_free_vars
(
False
,
free_vars
)
=
(
True
,
free_vars
,
fun_defs
)
add_free_vars_of_recursive_calls_to_functions
group_index
group
fun_defs
=
foldSt
(
add_free_vars_of_recursive_calls_to_function
group_index
)
group
(
False
,
fun_defs
)
add_free_vars_of_recursive_calls_to_function
group_index
fun
(
free_vars_added
,
fun_defs
)
#
(
fun_def
=:{
fun_info
},
fun_defs
)
=
fun_defs
![
fun
]
{
fi_free_vars
,
fi_def_level
,
fi_calls
}
=
fun_info
...
...
frontend/type.icl
View file @
f1b5100f
This diff is collapsed.
Click to expand it.
frontend/utilities.dcl
View file @
f1b5100f
...
...
@@ -3,6 +3,7 @@ definition module utilities
from
StdString
import
String
from
StdEnv
import
Eq
,
not
,
Ord
,
IncDec
import
StdMisc
,
general
/*
For Strings
*/
...
...
@@ -72,6 +73,7 @@ foldSt op l st :== fold_st l st
fold_st
[]
st
=
st
fold_st
[
a
:
x
]
st
=
fold_st
x
(
op
a
st
)
// iFoldSt :: (Int -> .(.b -> .b)) !Int !Int .b -> .b
iFoldSt
op
fr
to
st
:==
i_fold_st
fr
to
st
where
i_fold_st
fr
to
st
...
...
@@ -82,7 +84,7 @@ iFoldSt op fr to st :== i_fold_st fr to st
iterateSt
op
st
:==
iterate_st
op
st
where
iterate_st
op
st
#
(
continue
,
st
)
=
op
(
False
,
st
)
#
(
continue
,
st
)
=
op
st
|
continue
=
iterate_st
op
st
=
st
...
...
frontend/utilities.icl
View file @
f1b5100f
...
...
@@ -169,7 +169,7 @@ iFoldSt op fr to st :== i_fold_st fr to st
iterateSt
op
st
:==
iterate_st
op
st
where
iterate_st
op
st
#
(
continue
,
st
)
=
op
(
False
,
st
)
#
(
continue
,
st
)
=
op
st
|
continue
=
iterate_st
op
st
=
st
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment