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
200cdc12
Commit
200cdc12
authored
Nov 04, 2013
by
John van Groningen
Browse files
fix comprehensions with a non lower case identifier as pattern,
for example: [0 \\ [] <- [[]]]
parent
33f06e86
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/postparse.icl
View file @
200cdc12
...
...
@@ -948,8 +948,9 @@ makeComprehensions [{tq_generators,tq_let_defs,tq_filter, tq_end, tq_call, tq_lh
case_with_default
::
Ident
ParsedExpr
Bool
ParsedExpr
Rhs
ParsedExpr
->
Rhs
case_with_default
case_ident
expr
expr_is_uselect
pattern
=:(
PE_Ident
ident
)
rhs
=:{
rhs_alts
=
UnGuardedExpr
ung_exp
=:{
ewl_nodes
,
ewl_expr
,
ewl_locals
=
LocalParsedDefs
[],
ewl_position
},
rhs_locals
=
LocalParsedDefs
[]}
default_rhs
#
new_node
={
ndwl_strict
=
False
,
ndwl_def
={
bind_src
=
expr
,
bind_dst
=
pattern
},
ndwl_locals
=
LocalParsedDefs
[],
ndwl_position
=
ewl_position
}
=
{
rhs
&
rhs_alts
=
UnGuardedExpr
{
ung_exp
&
ewl_nodes
=[
new_node
:
ewl_nodes
]}}
|
isLowerCaseName
ident
.
id_name
#
new_node
={
ndwl_strict
=
False
,
ndwl_def
={
bind_src
=
expr
,
bind_dst
=
pattern
},
ndwl_locals
=
LocalParsedDefs
[],
ndwl_position
=
ewl_position
}
=
{
rhs
&
rhs_alts
=
UnGuardedExpr
{
ung_exp
&
ewl_nodes
=[
new_node
:
ewl_nodes
]}}
case_with_default
case_ident
expr
True
pattern
=:(
PE_Tuple
[
PE_Ident
ident1
,
ident2_exp
=:
PE_Ident
ident2
])
rhs
=:{
rhs_alts
=
UnGuardedExpr
ung_exp
=:{
ewl_nodes
,
ewl_expr
,
ewl_locals
=
LocalParsedDefs
[],
ewl_position
},
rhs_locals
=
LocalParsedDefs
[]}
default_rhs
#
new_node1
={
ndwl_strict
=
False
,
ndwl_def
={
bind_src
=
expr
,
bind_dst
=
pattern
},
ndwl_locals
=
LocalParsedDefs
[],
ndwl_position
=
ewl_position
}
#
new_node2
={
ndwl_strict
=
True
,
ndwl_def
={
bind_src
=
ident2_exp
,
bind_dst
=
ident2_exp
},
ndwl_locals
=
LocalParsedDefs
[],
ndwl_position
=
ewl_position
}
...
...
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