new feature: break continue - #17
Merged
Merged
Conversation
…te, implement, plan, specify, tasks) with outlines and execution workflows
… principles, and workflows
…rds, covering requirements, user scenarios, and validation criteria
…steps and feature guidance
…`continue` keywords in PHP Script, including AST nodes, lexer/parser integration, loop context tracking, and validation rules
…rds in PHP Script, including AST nodes, lexer/parser updates, loop context handling, testing, and validation criteria
…aversal, and codegen - Added `BreakStatement` node to the AST. - Updated lexer to recognize `break` and `continue` keywords. - Extended parser to handle `break` expressions with and without levels. - Enhanced `AstTraverser` to validate loop depth and process break levels. - Added comprehensive unit tests for parsing, traversal, validation, and rendering of `break` statements.
… traversal, and codegen - Added `ContinueStatement` node to the AST. - Extended parser to handle `continue` statements with and without levels. - Enhanced `AstTraverser` for validating loop depth and processing `continue` levels. - Implemented code generation for `continue` statements in `PhpScriptRenderer`. - Added comprehensive unit tests for parsing, traversal, validation, and rendering of `continue` statements. - Updated `MonarchLanguageDefinitionService` to include snippets for `continue` and `continue N`.
…ST and traversal - Added tests for `break` and `continue` execution in loops. - Included additional tests for visitor pattern methods (`visitBreakStatement` and `visitContinueStatement`). - Achieved 100% coverage for `break` and `continue` statements in `AstTraverser`. - Introduced `TestAstTraverser` helper class for loop depth simulation in tests. - Updated tests to ensure validation of loop context handling for `break` and `continue`.
…xamples and usage - Added detailed sections on `break` and `continue` statements, including syntax, examples, and nested loop handling. - Clarified runtime error scenarios for improper use of `break` and `continue`. - Expanded documentation with code samples for level-based loop control.
…nue` with examples and editor features - Added syntax highlighting, code snippets, and linting details for `break` and `continue` in the Monaco Editor. - Expanded `break` and `continue` documentation in statements and control-flow sections with detailed examples and use cases. - Linked related control-flow documentation for improved navigation.
- Updated the editor to dynamically provide `break` and `continue` suggestions only when inside loops. - Separated `loopControls` category for loop-specific snippets from `controlFlows`. - Adjusted `MonarchLanguageDefinitionService` to exclude `break` and `continue` from global keywords, adding them to `loopKeywords`. - Added depth tracking logic to identify valid loop contexts for IntelliSense. - Updated tests to confirm correct categorization and suggestion behavior for loop controls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.