Skip to content
GitLab
Menu
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
cf7cb8f2
Commit
cf7cb8f2
authored
Apr 05, 2012
by
John van Groningen
Browse files
fix aliases in sub patterns of # or let, for example:
g # (_,a=:b) = g = (a,b)
parent
ce0c5c1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/checkFunctionBodies.icl
View file @
cf7cb8f2
...
...
@@ -1974,7 +1974,14 @@ checkAndTransformPatternIntoBind free_vars [] e_input e_state e_info cs
transfromPatternIntoBind
::
!
Index
!
Level
!
AuxiliaryPattern
!
Expression
!
Position
!*
VarHeap
!*
ExpressionHeap
!*
ExpressionInfo
!*
CheckState
->
*(![
LetBind
],
!*
VarHeap
,
!*
ExpressionHeap
,
!*
ExpressionInfo
,
!*
CheckState
)
transfromPatternIntoBind
mod_index
def_level
(
AP_Variable
name
var_info
_)
src_expr
position
var_store
expr_heap
e_info
cs
transfromPatternIntoBind
mod_index
def_level
(
AP_Variable
name
var_info
(
Yes
{
bind_src
,
bind_dst
}))
src_expr
position
var_store
expr_heap
e_info
cs
#
(
var_expr_ptr
,
expr_heap
)
=
newPtr
EI_Empty
expr_heap
bound_var
=
{
var_ident
=
bind_src
,
var_info_ptr
=
bind_dst
,
var_expr_ptr
=
var_expr_ptr
}
free_var
=
{
fv_ident
=
bind_src
,
fv_info_ptr
=
bind_dst
,
fv_def_level
=
NotALevel
,
fv_count
=
0
}
bind1
=
{
lb_src
=
src_expr
,
lb_dst
=
free_var
,
lb_position
=
position
}
bind2
=
{
lb_src
=
Var
bound_var
,
lb_dst
=
{
fv_ident
=
name
,
fv_info_ptr
=
var_info
,
fv_def_level
=
NotALevel
,
fv_count
=
0
},
lb_position
=
position
}
=
([
bind1
,
bind2
],
var_store
,
expr_heap
,
e_info
,
cs
)
transfromPatternIntoBind
mod_index
def_level
(
AP_Variable
name
var_info
No
)
src_expr
position
var_store
expr_heap
e_info
cs
#
bind
=
{
lb_src
=
src_expr
,
lb_dst
=
{
fv_ident
=
name
,
fv_info_ptr
=
var_info
,
fv_def_level
=
def_level
,
fv_count
=
0
},
lb_position
=
position
}
=
([
bind
],
var_store
,
expr_heap
,
e_info
,
cs
)
transfromPatternIntoBind
mod_index
def_level
(
AP_Algebraic
cons_symbol
=:{
glob_module
,
glob_object
=
ds_cons
=:{
ds_arity
,
ds_index
,
ds_ident
}}
type_index
args
opt_var
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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