From f84eb1e0c106ba857b7f40f9c39eaafa63b00cff Mon Sep 17 00:00:00 2001 From: Christopher Wells Date: Sat, 4 Nov 2023 21:16:07 -0700 Subject: [PATCH] Add support for >= and <= comparison operators --- tree-sitter-quickbms/grammar.js | 2 ++ tree-sitter-quickbms/test/corpus/for.bms | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/tree-sitter-quickbms/grammar.js b/tree-sitter-quickbms/grammar.js index 0535d9c..43d1e71 100644 --- a/tree-sitter-quickbms/grammar.js +++ b/tree-sitter-quickbms/grammar.js @@ -216,6 +216,8 @@ module.exports = grammar({ comparison: $ => choice( "<", ">", + "<=", + ">=", "!=", "<>", "!==", diff --git a/tree-sitter-quickbms/test/corpus/for.bms b/tree-sitter-quickbms/test/corpus/for.bms index 9f8f52b..13d4195 100644 --- a/tree-sitter-quickbms/test/corpus/for.bms +++ b/tree-sitter-quickbms/test/corpus/for.bms @@ -34,6 +34,10 @@ For i = 0 < FILES EndIf next i +for i = 0 <= SUPPORTED_CRC_ENGINES + putarray OPERATION_DB_IDX i i +next i + -------------------------------------------------------------------------------- (source_file @@ -125,6 +129,21 @@ next i (print) (string_literal))) (endif)) + (next_statement + (next) + (identifier))) + (for_statement + (for) + (identifier) + (operation) + (integer_literal) + (comparison) + (identifier) + (putarray_statement + (putarray) + (identifier) + (identifier) + (identifier)) (next_statement (next) (identifier))))