Skip to content

Commit

Permalink
Add asize type
Browse files Browse the repository at this point in the history
  • Loading branch information
ExcaliburZero committed Nov 4, 2023
1 parent 9ed2fe0 commit 0a15d42
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tree-sitter-quickbms/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ module.exports = grammar({
),
type: $ => choice(
$.long,
$.asize,
$.string,
),
_endian_type: $ => choice(
Expand Down Expand Up @@ -206,6 +207,7 @@ module.exports = grammar({
endfunction: $ => /[Ee][Nn][Dd][Ff][Uu][Nn][Cc][Tt][Ii][Oo][Nn]/,
callfunction: $ => /[Cc][Aa][Ll][Ll][Ff][Uu][Nn][Cc][Tt][Ii][Oo][Nn]/,
long: $ => /[Ll][Oo][Nn][Gg]/,
asize: $ => /[Aa][Ss][Ii][Zz][Ee]/,
string: $ => /[Ss][Tt][Rr][Ii][Nn][Gg]/,
endian: $ => /[Ee][Nn][Dd][Ii][Aa][Nn]/,
little: $ => /[Ll][Ii][Tt][Tt][Ll][Ee]/,
Expand Down
8 changes: 7 additions & 1 deletion tree-sitter-quickbms/test/corpus/get.bms
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Get statements
Get OFFSET long
Get NAME string
get NAME string 0
get SIZE asize

--------------------------------------------------------------------------------

Expand All @@ -23,4 +24,9 @@ get NAME string 0
(identifier)
(type
(string))
(integer_literal)))
(integer_literal))
(get_statement
(get)
(identifier)
(type
(asize))))

0 comments on commit 0a15d42

Please sign in to comment.