-
Notifications
You must be signed in to change notification settings - Fork 0
Description
The evaluation of the abstract syntax tree (AST) to count logical lines of code in libreckon aborts the operation if any syntax error is found in the given source code [Reference]. This guard was originally put in place to ensure that the source code being processed is syntactically correct in its entirety and so to not give wrong count results. However, at least for some language parsers, the tree-sitter library might struggle to fully parse certain common programming constructs. The only known issue at the moment is macro definitions in C code. The problem is that due to the fact that such macro definitions are very prevalent in ordinary C code, for example export macro symbols found in API headers, this might result in a lot of processing errors for some codebases.
Make the default behaviour of libreckon lenient. This means that most syntax errors, if they concern only a single node in the AST, could get ignored and the tree traversal continues unaffected. Debugging output should not be changed and it should still output all found syntax errors if the environment variable is set accordingly.
Perhaps add a --strict option to scount to enable the present behaviour.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status