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
13759745
Commit
13759745
authored
Dec 01, 2003
by
Ronny Wichers Schreur
🏢
Browse files
use same default fixity and priority (infixl 9) everywhere
parent
a6d80818
Changes
4
Hide whitespace changes
Inline
Side-by-side
frontend/parse.icl
View file @
13759745
...
...
@@ -239,7 +239,7 @@ optionalPriority isinfix (PriorityToken prio) pState
=
(
prio
,
pState
)
optionalPriority
isinfix
token
pState
|
isinfix
=
(
D
ummy
Priority
,
tokenBack
pState
)
=
(
D
efault
Priority
,
tokenBack
pState
)
=
(
NoPrio
,
tokenBack
pState
)
/*
...
...
@@ -399,8 +399,6 @@ wantDefinitions :: !ParseContext !ParseState -> (![ParsedDefinition], !ParseStat
wantDefinitions
parseContext
pState
=
parseList
(
tryDefinition
parseContext
)
pState
DummyPriority
:==
Prio
LeftAssoc
9
cHasPriority
:==
True
cHasNoPriority
:==
False
...
...
@@ -601,8 +599,8 @@ where
(
tspec
,
pState
)
=
want
pState
// SymbolType
|
isDclContext
parseContext
#
(
specials
,
pState
)
=
optionalSpecials
pState
=
(
PD_TypeSpec
pos
name
(
if
is_infix
D
ummy
Priority
NoPrio
)
(
Yes
tspec
)
specials
,
wantEndOfDefinition
"type definition (1)"
pState
)
=
(
PD_TypeSpec
pos
name
(
if
is_infix
D
ummy
Priority
NoPrio
)
(
Yes
tspec
)
SP_None
,
wantEndOfDefinition
"type definition (2)"
pState
)
=
(
PD_TypeSpec
pos
name
(
if
is_infix
D
efault
Priority
NoPrio
)
(
Yes
tspec
)
specials
,
wantEndOfDefinition
"type definition (1)"
pState
)
=
(
PD_TypeSpec
pos
name
(
if
is_infix
D
efault
Priority
NoPrio
)
(
Yes
tspec
)
SP_None
,
wantEndOfDefinition
"type definition (2)"
pState
)
want_rhs_of_def
parseContext
(
opt_name
,
args
)
(
PriorityToken
prio
)
pos
pState
#
(
name
,
_,
pState
)
=
check_name_and_fixity
opt_name
cHasPriority
pState
(
token
,
pState
)
=
nextToken
TypeContext
pState
...
...
frontend/postparse.icl
View file @
13759745
...
...
@@ -288,7 +288,7 @@ where
=
(
fun_defs
,
[{
nd_dst
=
PE_Ident
name
,
nd_alts
=
rhs_alts
,
nd_locals
=
rhs_locals
,
nd_position
=
pos
}
:
node_defs
],
ca
)
reorganiseLocalDefinitions
[
PD_Function
pos
name
is_infix
args
rhs
fun_kind
:
defs
]
ca
#
prio
=
if
is_infix
(
Prio
NoAssoc
9
)
NoPrio
#
prio
=
if
is_infix
DefaultPriority
NoPrio
fun_arity
=
length
args
(
bodies
,
fun_kind
,
defs
,
ca
)
=
collectFunctionBodies
name
fun_arity
prio
fun_kind
defs
ca
(
fun_defs
,
node_defs
,
ca
)
=
reorganiseLocalDefinitions
defs
ca
...
...
frontend/scanner.dcl
View file @
13759745
...
...
@@ -125,6 +125,7 @@ instance <<< FilePosition
::
Assoc
=
LeftAssoc
|
RightAssoc
|
NoAssoc
::
Priority
=
Prio
Assoc
Int
|
NoPrio
DefaultPriority
::
Priority
class
getFilename
state
::
!*
state
->
(!
String
,!*
state
)
instance
getFilename
ScanState
...
...
frontend/scanner.icl
View file @
13759745
...
...
@@ -1470,6 +1470,9 @@ where
(<) _ _ = True
*/
DefaultPriority
::
Priority
DefaultPriority
=
Prio
LeftAssoc
9
determinePriority
::
!
Priority
!
Priority
->
Optional
Bool
determinePriority
(
Prio
assoc_left
prio_left
)
(
Prio
assoc_right
prio_right
)
...
...
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