hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 084fa357e671fa379ab6b572538f6d33330afb6b
parent dee84dc6e09e463f1eb785ad4d5f0222de14e7ef
Author: Sebastian <sebastian@sebsite.pw>
Date:   Mon, 28 Mar 2022 17:26:52 -0400

lex: rename ltoks GREATER/GREATEREQ to GT/GTEQ

This is more consistent with hare::parse::binarithm_op.

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mhare/lex/+test.ha | 4++--
Mhare/lex/lex.ha | 2+-
Mhare/lex/token.ha | 4++--
Mhare/parse/expr.ha | 6+++---
4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/hare/lex/+test.ha b/hare/lex/+test.ha @@ -142,9 +142,9 @@ fn loc(line: uint, col: uint) location = location { (ltok::LSHIFT, void, loc(1, 12)), (ltok::LESSEQ, void, loc(1, 15)), (ltok::LSHIFTEQ, void, loc(1, 18)), - (ltok::GREATER, void, loc(1, 22)), + (ltok::GT, void, loc(1, 22)), (ltok::RSHIFT, void, loc(1, 24)), - (ltok::GREATEREQ, void, loc(1, 27)), + (ltok::GTEQ, void, loc(1, 27)), (ltok::RSHIFTEQ, void, loc(1, 30)), (ltok::RSHIFT, void, loc(1, 34)), ]; diff --git a/hare/lex/lex.ha b/hare/lex/lex.ha @@ -666,7 +666,7 @@ fn lex3(lex: *lexer) (token | error) = { case '<' => yield [ltok::LESS, ltok::LESSEQ, ltok::LSHIFT, ltok::LSHIFTEQ]; case '>' => - yield [ltok::GREATER, ltok::GREATEREQ, ltok::RSHIFT, + yield [ltok::GT, ltok::GTEQ, ltok::RSHIFT, ltok::RSHIFTEQ]; case '&' => yield [ltok::BAND, ltok::BANDEQ, ltok::LAND, ltok::LANDEQ]; diff --git a/hare/lex/token.ha b/hare/lex/token.ha @@ -91,8 +91,8 @@ export type ltok = enum uint { DOUBLE_COLON, ELLIPSIS, EQUAL, - GREATER, - GREATEREQ, + GT, + GTEQ, LAND, LANDEQ, LBRACE, diff --git a/hare/parse/expr.ha b/hare/parse/expr.ha @@ -1223,9 +1223,9 @@ fn binop_for_tok(tok: lex::token) ast::binarithm_op = { return ast::binarithm_op::BXOR; case ltok::DIV => return ast::binarithm_op::DIV; - case ltok::GREATER => + case ltok::GT => return ast::binarithm_op::GT; - case ltok::GREATEREQ => + case ltok::GTEQ => return ast::binarithm_op::GTEQ; case ltok::LAND => return ast::binarithm_op::LAND; @@ -1267,7 +1267,7 @@ fn precedence(tok: lex::token) int = { return 2; case ltok::LEQUAL, ltok::NEQUAL => return 3; - case ltok::LESS, ltok::LESSEQ, ltok::GREATER, ltok::GREATEREQ => + case ltok::LESS, ltok::LESSEQ, ltok::GT, ltok::GTEQ => return 4; case ltok::BOR => return 5;