]> ocean-lang.org Git - ocean/commitdiff
Oceani: be sure to set precedence on required terminals.
authorNeilBrown <neil@brown.name>
Mon, 10 Jun 2019 06:51:31 +0000 (16:51 +1000)
committerNeilBrown <neil@brown.name>
Mon, 10 Jun 2019 06:59:12 +0000 (16:59 +1000)
In some cases I was only setting on nonterminals which derived the
terminals.  That set it for the reduction, but not the terminal.

Also remove an ERROR production that duplicates one from Declaration

Signed-off-by: NeilBrown <neil@brown.name>
csrc/oceani.mdc

index b1b5c334c1bc811c2d0172f45f050125b03d8053..8fef86460ab64f08583b8ec2776d945bc302771b 100644 (file)
@@ -2472,7 +2472,7 @@ room for ambiguity, so a full conditional expression is allowed in there.
 
 ###### Grammar
 
-       $LEFT $$ifelse
+       $LEFT if $$ifelse
        ## expr precedence
 
        $*exec
@@ -2695,7 +2695,7 @@ expression operator.
        NEql,
 
 ###### expr precedence
-       $LEFT CMPop
+       $LEFT < > <= >= == != CMPop
 
 ###### expression grammar
        | Expression CMPop Expression ${ {
@@ -2807,8 +2807,8 @@ precedence is handled better I might be able to discard this.
        Bracket,
 
 ###### expr precedence
-       $LEFT Eop
-       $LEFT Top
+       $LEFT + - Eop
+       $LEFT * / % ++ Top
        $LEFT Uop
 
 ###### expression grammar
@@ -4104,10 +4104,6 @@ analysis is a bit more interesting at this level.
                var_block_close(c, CloseSequential);
                if (c->scope_stack && !c->parse_error) abort();
                }$
-               | ERROR ${
-                       tok_err(c,
-                               "error: unhandled parse error", &$1);
-               }$
 
        Varlist -> Varlist ArgDecl ${
                        $0 = new(binode);