diff --git a/tree-sitter-quickbms/grammar.js b/tree-sitter-quickbms/grammar.js index b8308b7..ec5b2d4 100644 --- a/tree-sitter-quickbms/grammar.js +++ b/tree-sitter-quickbms/grammar.js @@ -286,6 +286,7 @@ module.exports = grammar({ $.binary, $.unicode, $.byte, + $.basename, ), _endian_type: $ => choice( $.little, @@ -319,6 +320,7 @@ module.exports = grammar({ binary: $ => /[Bb][Ii][Nn][Aa][Rr][Yy]/, unicode: $ => /[Uu][Nn][Ii][Cc][Oo][Dd][Ee]/, byte: $ => /[Bb][Yy][Tt][Ee]/, + basename: $ => /[Bb][Aa][Ss][Ee][Nn][Aa][Mm][Ee]/, endian: $ => /[Ee][Nn][Dd][Ii][Aa][Nn]/, little: $ => /[Ll][Ii][Tt][Tt][Ll][Ee]/, intel: $ => /[Ii][Nn][Tt][Ee][Ll]/, diff --git a/tree-sitter-quickbms/test/corpus/get.bms b/tree-sitter-quickbms/test/corpus/get.bms index 197bc9a..6456f1c 100644 --- a/tree-sitter-quickbms/test/corpus/get.bms +++ b/tree-sitter-quickbms/test/corpus/get.bms @@ -6,6 +6,9 @@ Get NAME string get NAME string 0 get SIZE asize +get SIZE asize MEMORY_FILE +get NAME basename + -------------------------------------------------------------------------------- (source_file @@ -29,4 +32,15 @@ get SIZE asize (get) (identifier) (type - (asize)))) + (asize))) + (get_statement + (get) + (identifier) + (type + (asize)) + (identifier)) + (get_statement + (get) + (identifier) + (type + (basename))))