Skip to content

Commit

Permalink
Add support for >= and <= comparison operators
Browse files Browse the repository at this point in the history
  • Loading branch information
ExcaliburZero committed Nov 5, 2023
1 parent 5a30af7 commit f84eb1e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tree-sitter-quickbms/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ module.exports = grammar({
comparison: $ => choice(
"<",
">",
"<=",
">=",
"!=",
"<>",
"!==",
Expand Down
19 changes: 19 additions & 0 deletions tree-sitter-quickbms/test/corpus/for.bms
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))))

0 comments on commit f84eb1e

Please sign in to comment.