xaizek / zograscope (License: AGPLv3 only) (since 2018-12-07)
Mainly a syntax-aware diff that also provides a number of additional tools.
Commit dad9c9b3fde33219c225fbdaed6e8a66684885c1

Make Lua's function signature a value node
This required defining it in the grammar.
Author: xaizek
Author date (UTC): 2022-11-29 18:55
Committer name: xaizek
Committer date (UTC): 2022-12-03 11:37
Parent(s): 4c0448ebdfc4d0aa1f7e0fbee3418ccd84a91355
Signing key: 99DC5E4DB05F6BE2
Tree: a6f89ef8189cd6fa5cafc22b58420cd34a0b9f86
File Lines added Lines deleted
src/ts/lua/TSLuaLanguage.cpp 5 1
src/ts/lua/TSLuaSType.hpp 1 0
third-party/tree-sitter/parsers/lua-parser.c 3666 3271
File src/ts/lua/TSLuaLanguage.cpp changed (mode: 100644) (index 5d430da..3f84869)
... ... TsLuaLanguage::TsLuaLanguage() : tsLanguage(*tree_sitter_lua())
69 69
70 70 { "function_body", +TSLuaSType::FunctionBody }, { "function_body", +TSLuaSType::FunctionBody },
71 71 { "function_definition", +TSLuaSType::FunctionDefinition }, { "function_definition", +TSLuaSType::FunctionDefinition },
72 { "function_definition_signature",
73 +TSLuaSType::FunctionDefinitionSignature },
72 74
73 75 { "local_variable_declaration", +TSLuaSType::LocalVariableDeclaration }, { "local_variable_declaration", +TSLuaSType::LocalVariableDeclaration },
74 76 { "variable", +TSLuaSType::Variable }, { "variable", +TSLuaSType::Variable },
 
... ... TsLuaLanguage::shouldSplice(SType parent, const Node *childNode) const
276 278 bool bool
277 279 TsLuaLanguage::isValueNode(SType stype) const TsLuaLanguage::isValueNode(SType stype) const
278 280 { {
279 return -stype == TSLuaSType::ConditionExpression;
281 return -stype == TSLuaSType::ConditionExpression
282 || -stype == TSLuaSType::FunctionDefinitionSignature;
280 283 } }
281 284
282 285 bool bool
 
... ... TsLuaLanguage::toString(SType stype) const
382 385 CASE(ForNumericStatement); CASE(ForNumericStatement);
383 386 CASE(FunctionBody); CASE(FunctionBody);
384 387 CASE(FunctionDefinition); CASE(FunctionDefinition);
388 CASE(FunctionDefinitionSignature);
385 389 CASE(FunctionDefinitionStatement); CASE(FunctionDefinitionStatement);
386 390 CASE(GotoStatement); CASE(GotoStatement);
387 391 CASE(IfStatement); CASE(IfStatement);
File src/ts/lua/TSLuaSType.hpp changed (mode: 100644) (index db7223e..68ed8ea)
... ... enum class TSLuaSType : std::uint8_t
64 64
65 65 FunctionBody, FunctionBody,
66 66 FunctionDefinition, FunctionDefinition,
67 FunctionDefinitionSignature,
67 68
68 69 LocalVariableDeclaration, LocalVariableDeclaration,
69 70 Variable, Variable,
The diff for file third-party/tree-sitter/parsers/lua-parser.c is too big (6937 changes) and cannot be shown.
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/zograscope

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/zograscope

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master