Skip to content

new feature: break continue - #17

Merged
rokde merged 12 commits into
mainfrom
001-break-continue
Dec 3, 2025
Merged

rokde merged 12 commits into
mainfrom
001-break-continue

Conversation

@rokde

@rokde rokde commented Nov 30, 2025

Copy link
Copy Markdown
Contributor

No description provided.

rokde added 10 commits November 18, 2025 18:18
…te, implement, plan, specify, tasks) with outlines and execution workflows
…rds, covering requirements, user scenarios, and validation criteria
…`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.
@rokde rokde self-assigned this Nov 30, 2025
rokde added 2 commits December 3, 2025 17:36
…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.
@rokde
rokde merged commit 8874abe into main Dec 3, 2025
17 checks passed
@rokde
rokde deleted the 001-break-continue branch December 3, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant