Add new AST node for continue statement in while loops #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds support for the
continuestatement to the language, enabling users to skip to the next iteration of awhileloop for more flexible control flow. The implementation covers lexer, parser, AST, runtime, documentation, and testing, ensuring thatcontinueworks seamlessly alongside existing features likebreak. The documentation and examples are updated to help users understand and use the new statement effectively.Language Feature Implementation
ContinueNodeto the AST (src/AST/ContinueNode.cpp,src/AST/ContinueNode.hpp) and corresponding runtime logic, throwing a newContinueExceptionto handle control flow in loops. [1] [2] [3]continuekeyword, parse it into AST nodes, and handle it during statement parsing. [1] [2] [3] [4] [5] [6]Control Flow Integration
WhileStatementNodeto catchContinueExceptionand skip to the next iteration, ensuring correct loop semantics.Documentation and Examples
README.mdto document the newcontinuestatement, its features, usage patterns, and added multiple example scenarios. [1] [2] [3] [4]examples/test_continue_examples.obqdemonstrating practical uses ofcontinuein filtering, validation, searching, batching, and combined withbreak.Build and Testing
CMakeLists.txt,tests/CMakeLists.txt) to include new source and header files, and added a dedicated test for continue statement functionality. [1] [2] [3] [4]