Closed AndreaWalchshoferSCCH closed 10 months ago
Good job, it seems that you need a more user-friendly syntax tree and node API, just like what I did with C#, in this case, writing such diagnostics would only need to be like:
auto nodes = tree.Children<NameExpr>().Where([](auto it) -> { return it.Declaration(tree).Is<LocalName>(); });
// make diagnostic
of course I didn't design such an API for this project, for this project, I didn't initially intend to implement complex diagnostic algorithms, including format checking, which was just written casually. therefore, although the AST has the shadow of the red-green tree, it is not strongly typed, which leads to a very unfriendly API.
I might take the time to write a C++ parser that can parse all LuaCats and emmyluadoc, if I have the time. Many people should need it to write tools.
This PR adds a name style configuration option for variables marked with the attribute
<const>
, as described in https://github.com/CppCXY/EmmyLuaCodeStyle/issues/158How it's designed:
const_variable_name_style
ImportModuleName
andModuleName
are not affected<const>
are affectedSnakeCase
andUpperSnakeCase
are allowed, so it should not affect existing code bases using the default name style configuration. If preferred, we could also set it toIgnore
as the default, but as the name styles themselves are still quite recent, I wouldn't assume it would annoy people.