Closed elmotec closed 5 years ago
hmm, thanks for the re part and test. I will look into it. The nested structure implementation is mostly from a pull request and right now not functioning as expected.
I think I have an angle on it, I should have a fix today.
The only thing is that right now, I break the "ignoring explicit forever loop" which is illustrated by the following test case:
def test_one_function_nd_ignoring_explicit_forever_loop(self):
result = get_cpp_with_nestdepth("""
x a() {
for(;;) { // <-- explicit forever loop
if(a != 0){
a = b;
}
}
}
x b() {
while(1) {
if(a != 0){
a = b;
}
}
}
x c() {
while(true) {
if(a != 0){
a = b;
}
}
}
""")
self.assertEqual(1, result[0].max_nesting_depth)
self.assertEqual(2, result[1].max_nesting_depth)
self.assertEqual(2, result[2].max_nesting_depth)
I am not sure why for (;;)
deserves a special treatment. What's your take on it?
@terryyin, just realized that the PR #257 had not been merged. Only the fixes to the test suite. What's the next move?
Just merged it. Sorry for the delay.
On 9 Mar 2019, at 8:35 AM, elmotec notifications@github.com wrote:
@terryyin https://github.com/terryyin, just realized that the PR #257 https://github.com/terryyin/lizard/pull/257 had not been merged. Only the fixes to the test suite. What's the next move?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/terryyin/lizard/issues/254#issuecomment-471125338, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwJYpJRggdPMczelo0hWMu9Ml67M25qks5vUwHFgaJpZM4a_URY.
No worries. Thank you for Lizard!
Hello,
I see an issue with
max_nested_depth
that I reproduced in the following test case:result[0].max_nesting_depth
is 1 instead of 2 so this test should fail if you add it to testNestingDepth.py.Note that without the
b;
statement, I getmax_nesting_depth
2 which I is correct but I don't believeb;
should impact the nesting depth.