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
cc8dbec0
Commit
cc8dbec0
authored
Jul 13, 2001
by
John van Groningen
Browse files
{} is not allowed in patterns, because array 'denotations' in patterns
are not implemented
parent
bf77a4f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/parse.icl
View file @
cc8dbec0
...
@@ -2391,16 +2391,17 @@ buildNodeDef lhsExpr rhsExpr
...
@@ -2391,16 +2391,17 @@ buildNodeDef lhsExpr rhsExpr
wantRecordOrArrayExp
::
!
Bool
!
ParseState
->
(
ParsedExpr
,
!
ParseState
)
wantRecordOrArrayExp
::
!
Bool
!
ParseState
->
(
ParsedExpr
,
!
ParseState
)
wantRecordOrArrayExp
is_pattern
pState
wantRecordOrArrayExp
is_pattern
pState
#
(
token
,
pState
)
=
nextToken
FunctionContext
pState
#
(
token
,
pState
)
=
nextToken
FunctionContext
pState
|
token
==
CurlyCloseToken
=
(
PE_ArrayDenot
[],
pState
)
|
is_pattern
|
is_pattern
|
token
==
SquareOpenToken
|
token
==
SquareOpenToken
#
(
elems
,
pState
)
=
want_array_assignments
cIsAPattern
pState
#
(
elems
,
pState
)
=
want_array_assignments
cIsAPattern
pState
=
(
PE_ArrayPattern
elems
,
wantToken
FunctionContext
"array selections in pattern"
CurlyCloseToken
pState
)
=
(
PE_ArrayPattern
elems
,
wantToken
FunctionContext
"array selections in pattern"
CurlyCloseToken
pState
)
// MW was = (PE_Empty, parseError "array selection" No "No array selection in pattern" pState)
|
token
==
CurlyCloseToken
=
(
PE_Empty
,
parseError
"record or array pattern"
No
"Array denotation not"
pState
)
// otherwise // is_pattern && token <> SquareOpenToken
// otherwise // is_pattern && token <> SquareOpenToken
=
want_record_pattern
token
pState
=
want_record_pattern
token
pState
// otherwise // ~ is_pattern
// otherwise // ~ is_pattern
|
token
==
CurlyCloseToken
=
(
PE_ArrayDenot
[],
pState
)
#
(
opt_type
,
pState
)
=
try_type_specification
token
pState
#
(
opt_type
,
pState
)
=
try_type_specification
token
pState
=
case
opt_type
of
=
case
opt_type
of
Yes
_
Yes
_
...
...
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