Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
clean-compiler-and-rts
compiler
Commits
b8ce1eef
Commit
b8ce1eef
authored
Oct 12, 2001
by
John van Groningen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add <|- generator for overloaded lists again
parent
7f939dcc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
14 deletions
+9
-14
frontend/parse.icl
frontend/parse.icl
+2
-4
frontend/syntax.dcl
frontend/syntax.dcl
+1
-4
frontend/syntax.icl
frontend/syntax.icl
+6
-6
No files found.
frontend/parse.icl
View file @
b8ce1eef
...
...
@@ -2665,16 +2665,14 @@ where
(
lhs_expr
,
pState
)
=
wantExpression
cIsAPattern
pState
(
token
,
pState
)
=
nextToken
FunctionContext
pState
|
token
==
LeftArrowToken
//MW3 was: = want_generators IsListGenerator (toLineAndColumn qual_position) lhs_expr pState
=
want_generators
IsListGenerator
(
toLineAndColumn
qual_position
)
qual_filename
lhs_expr
pState
|
token
==
LeftArrowColonToken
//MW3 was: = want_generators IsArrayGenerator (toLineAndColumn qual_position) lhs_expr pState
=
want_generators
IsArrayGenerator
(
toLineAndColumn
qual_position
)
qual_filename
lhs_expr
pState
|
token
==
LeftArrowWithBarToken
=
want_generators
IsOverloadedListGenerator
(
toLineAndColumn
qual_position
)
qual_filename
lhs_expr
pState
=
({
qual_generators
=
[],
qual_filter
=
No
,
qual_position
=
{
lc_line
=
0
,
lc_column
=
0
},
qual_filename
=
""
},
parseError
"comprehension: qualifier"
(
Yes
token
)
"qualifier(s)"
pState
)
//MW3 was: want_generators :: !GeneratorKind !LineAndColumn !ParsedExpr !ParseState -> (!Qualifier, !ParseState)
//MW3 was: want_generators gen_kind qual_position pattern_exp pState
want_generators
::
!
GeneratorKind
!
LineAndColumn
!
FileName
!
ParsedExpr
!
ParseState
->
(!
Qualifier
,
!
ParseState
)
want_generators
gen_kind
qual_position
qual_filename
pattern_exp
pState
#
(
gen_position
,
pState
)
=
getPosition
pState
...
...
frontend/syntax.dcl
View file @
b8ce1eef
...
...
@@ -1055,10 +1055,7 @@ cNonUniqueSelection :== False
|
PS_Array
!
ParsedExpr
|
PS_Erroneous
::
GeneratorKind
:==
Bool
IsListGenerator
:==
True
IsArrayGenerator
:==
False
::
GeneratorKind
=
IsListGenerator
|
IsOverloadedListGenerator
|
IsArrayGenerator
::
LineAndColumn
=
{
lc_line
::
!
Int
,
lc_column
::
!
Int
}
...
...
frontend/syntax.icl
View file @
b8ce1eef
...
...
@@ -1050,11 +1050,7 @@ cNonUniqueSelection :== False
|
PS_Array
!
ParsedExpr
|
PS_Erroneous
::
GeneratorKind
:==
Bool
IsListGenerator
:==
True
IsArrayGenerator
:==
False
::
GeneratorKind
=
IsListGenerator
|
IsOverloadedListGenerator
|
IsArrayGenerator
::
LineAndColumn
=
{
lc_line
::
!
Int
,
lc_column
::
!
Int
}
...
...
@@ -1524,7 +1520,11 @@ where
instance
<<<
Generator
where
(<<<)
file
{
gen_kind
,
gen_pattern
,
gen_expr
}
=
file
<<<
gen_pattern
<<<
(
if
gen_kind
"<-"
"<-:"
)
<<<
gen_expr
=
file
<<<
gen_pattern
<<<
(
gen_kind_to_string
gen_kind
)
<<<
gen_expr
where
gen_kind_to_string
IsListGenerator
=
"<-"
gen_kind_to_string
IsOverloadedListGenerator
=
"<|-"
gen_kind_to_string
IsArrayGenerator
=
"<-:"
instance
<<<
BasicValue
where
...
...
Write
Preview
Markdown
is supported
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