-
Notifications
You must be signed in to change notification settings - Fork 137
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
gets stuck in an infinit loop when a function gets called without a ; #493
Comments
+1 |
I found the same issue, however, it seems like the failure conditions are a little more complicated. The loop only occurs when the last statement is a function without a semicolon. This is why, for example, Norminette does NOT execute a loop when you write statements such as return
but if you only write a function such as write without
If you write two or more subsequent functions without semicolons, Norminette won't get stuck in a loop, but instead
This happens regardless of whether or not the functions are in the same statement body. Putting a semicolon ANYWHERE after a function without My best guess is that Norminette is hardcoded to process the file from top to bottom, and processes each line until she sees a semicolon. If she doesn't see one, she will loop if she doesn't encounter subsequent functions or semicolons, or she will process any function she sees afterward as if they were part of the offending line and then print lots of indentation, parenthesis, empty line, and other errors, or crash, depending on the syntax. This would track with why she will complain about indentation here at line 7 and 12, and an empty line at line 10, because she is not aware that the statement body of
I hope this was any help because I spent way more time on this than I am willing to admit and I should really get back to speedrunning C in the Piscine lol. Additional infos |
Describe the bug
when the last function called has no ; in the end "example()" the norminette gets stuck on an infinite loop.
This will only happen if there are no ; in the code following the function
Erroneous code
like this it will get stuck in a lop
but if you add a ; after the return norm will work correctly
Additional infos
norminette 3.3.55
The text was updated successfully, but these errors were encountered: