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
92107a1e
Commit
92107a1e
authored
Jul 13, 2004
by
John van Groningen
Browse files
fix conversion of selection (pattern match in lhs of where or let)
from a constructor (not a tuple or record) on a cycle
parent
47fcb797
Changes
1
Hide whitespace changes
Inline
Side-by-side
backendC/CleanCompilerSources/sa.c
View file @
92107a1e
...
...
@@ -2472,26 +2472,31 @@ static Exp ConvertNode (Node node, NodeId nid)
}
case
MatchNode
:
{
Exp
exp
;
Symbol
symbol
;
exp
=
ConvertNode
(
node
->
node_arguments
->
arg_node
,
Null
);
symbol
=
node
->
node_symbol
;
if
(
symbol
->
symb_kind
==
definition
&&
symbol
->
symb_def
->
sdef_kind
==
CONSTRUCTOR
&&
symbol
->
symb_def
->
sdef_arity
==
1
)
symbol
->
symb_def
->
sdef_arity
==
1
)
{
Exp
selexp
;
selexp
=
NewValueExp
(
selectsym
[
0
],
False
,
1
);
selexp
->
e_args
[
0
]
=
exp
;
exp
=
selexp
;
if
(
nid
)
nid
->
nid_exp_
=
selexp
;
selexp
->
e_args
[
0
]
=
ConvertNode
(
node
->
node_arguments
->
arg_node
,
NULL
);
return
selexp
;
}
else
{
if
(
nid
)
nid
->
nid_exp_
=
NULL
;
node
=
node
->
node_arguments
->
arg_node
;
if
(
node
->
node_kind
==
NodeIdNode
)
return
ConvertNodeId
(
node
->
node_node_id
);
else
return
ConvertNode
(
node
,
nid
);
}
if
(
nid
)
nid
->
nid_exp_
=
exp
;
return
exp
;
}
default:
DoFatalError
(
"ConvertNode (SA): unknown node kind"
);
...
...
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