From 08056428cec5d1e63e471590ac09d82dcbfcab93 Mon Sep 17 00:00:00 2001 From: Mustafa Quraish Date: Sat, 29 Jan 2022 00:20:09 -0500 Subject: Add relational and logical operators + refactor binop parser We now support OR and AND with short circuiting! (Yet to be tested since we don't yet have local variables to play with). The binop parser took a bit of an overhaul factoring out the common code so that it's easier to describe the operator precendence relationships without being overly repetitive. --- examples/comparisons.cup | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 examples/comparisons.cup (limited to 'examples') diff --git a/examples/comparisons.cup b/examples/comparisons.cup new file mode 100644 index 0000000..d2bd41f --- /dev/null +++ b/examples/comparisons.cup @@ -0,0 +1,3 @@ +fn main() { + return (5 == 3) + (5 > 4) + (1 != 2); +} \ No newline at end of file -- cgit v1.2.3