-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RecursionError: maximum recursion depth exceeded #293
Comments
Hi,
Sorry for the long waiting. I will be on a work break next week and will fix this then.
Terry
… On 15 Jul 2020, at 4:41 PM, cyw3 ***@***.***> wrote:
the test case is the index.js of ***@***.***
<https://user-images.githubusercontent.com/11549103/87523771-f03cfe80-c6b9-11ea-8992-da0167b644ba.png>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#293 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAGASYQHL5556ASGUPJI3R3R3VTTHANCNFSM4OWHTJ5A>.
|
We are also facing same issue. |
+1 |
The core of the problem here is that the tokenizer is expecting every open html tag, i.e Example snippet out of the referenced prettier: {
type: 'DebuggerStatement';
_DebuggerStatement: void;
end: number;
innerComments: ?Array<Comment>;
leadingComments: ?Array<Comment>;
loc: {
end: { column: number, line: number },
start: { column: number, line: number },
};
start: number;
trailingComments: ?Array<Comment>;
} each |
To help lizard at least survive these encounters, one may apply this crude monkey patch (or something similar): diff --git a/lizard.py b/lizard.py
index ba8b0eb..ab74698 100755
--- a/lizard.py
+++ b/lizard.py
@@ -562,8 +562,11 @@ class FileAnalyzer(object): # pylint: disable=R0903
tokens = reader.generate_tokens(code)
for processor in self.processors:
tokens = processor(tokens, reader)
- for _ in reader(tokens, reader):
- pass
+ try:
+ for _ in reader(tokens, reader):
+ pass
+ except RecursionError as err:
+ print("skipped:", filename, "with reason: RecursionError (unclosed tags/scopes?)") # or something similar ...
return context.fileinfo |
Thanks! |
Lizard 1.17.5
Python 3.7.0
When I want to update lizard 1.16.3 to lizard 1.17.5, I get a error:
And when use Lizard 1.16.3 to scan the same project, it works.
The text was updated successfully, but these errors were encountered: