Commit 13759745 authored by Ronny Wichers Schreur's avatar Ronny Wichers Schreur 🏘
Browse files

use same default fixity and priority (infixl 9) everywhere

parent a6d80818
......@@ -239,7 +239,7 @@ optionalPriority isinfix (PriorityToken prio) pState
= (prio, pState)
optionalPriority isinfix token pState
| isinfix
= (DummyPriority, tokenBack pState)
= (DefaultPriority, 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 DummyPriority NoPrio) (Yes tspec) specials, wantEndOfDefinition "type definition (1)" pState)
= (PD_TypeSpec pos name (if is_infix DummyPriority NoPrio) (Yes tspec) SP_None, wantEndOfDefinition "type definition (2)" pState)
= (PD_TypeSpec pos name (if is_infix DefaultPriority NoPrio) (Yes tspec) specials, wantEndOfDefinition "type definition (1)" pState)
= (PD_TypeSpec pos name (if is_infix DefaultPriority 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
......
......@@ -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
......
......@@ -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
......
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment