mirror of
https://github.com/anoma/juvix.git
synced 2024-12-01 00:04:58 +03:00
8095e52c21
Give an error when there are two operators with incomparable precedences instead of linearising the ordering arbitrarily.
20 lines
379 B
Plaintext
20 lines
379 B
Plaintext
module IncomparablePrecedences;
|
|
|
|
type Bool := true | false;
|
|
|
|
syntax fixity log1 {arity: binary, assoc: left};
|
|
syntax fixity log2 {arity: binary, assoc: right};
|
|
|
|
syntax operator && log1;
|
|
syntax operator || log2;
|
|
|
|
&& : Bool -> Bool -> Bool
|
|
| true x := x
|
|
| false _ := false;
|
|
|
|
|| : Bool -> Bool -> Bool
|
|
| true _ := true
|
|
| false x := x;
|
|
|
|
main : Bool := false && true || true;
|