From 19dadd080226d2e7c6dc44a53eb0ee3ee2afcbae Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Thu, 22 Jan 2026 11:19:54 +0100 Subject: Add Lua grammar --- queries/lua.h | 23 +++++++++++++++++++++++ queries/lua.scm | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 queries/lua.h create mode 100644 queries/lua.scm (limited to 'queries') diff --git a/queries/lua.h b/queries/lua.h new file mode 100644 index 0000000..e2089c7 --- /dev/null +++ b/queries/lua.h @@ -0,0 +1,23 @@ +unsigned char query_lua[] = { + 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, + 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x22, 0x66, + 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x40, 0x66, 0x74, + 0x79, 0x70, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x28, 0x5f, + 0x29, 0x20, 0x40, 0x66, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x3a, 0x20, 0x28, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x29, 0x20, 0x40, 0x66, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x29, 0x0a, 0x28, 0x61, 0x73, 0x73, + 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x28, 0x76, 0x61, 0x72, 0x69, 0x61, + 0x62, 0x6c, 0x65, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, + 0x65, 0x3a, 0x20, 0x28, 0x5f, 0x29, 0x20, 0x40, 0x66, 0x6e, 0x61, 0x6d, + 0x65, 0x29, 0x20, 0x28, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x28, 0x66, 0x75, 0x6e, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x20, 0x40, 0x66, 0x74, 0x79, 0x70, 0x65, 0x20, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x3a, 0x20, 0x28, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x29, 0x20, + 0x40, 0x66, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x29, 0x29, 0x29, 0x0a +}; +unsigned int query_lua_len = 240; diff --git a/queries/lua.scm b/queries/lua.scm new file mode 100644 index 0000000..f708a7c --- /dev/null +++ b/queries/lua.scm @@ -0,0 +1,2 @@ +(function_declaration "function" @ftype name: (_) @fname parameters: (parameters) @fparams) +(assignment_statement (variable_list name: (_) @fname) (expression_list (function_definition "function" @ftype parameters: (parameters) @fparams))) -- cgit v1.2.3