Improve template exceptions with original source mapping across extends#1
Draft
Copilot wants to merge 17 commits into
Draft
Improve template exceptions with original source mapping across extends#1Copilot wants to merge 17 commits into
Copilot wants to merge 17 commits into
Conversation
Copilot created this pull request from a session on behalf of
beobles
May 27, 2026 02:06
View session
Copilot
AI
changed the title
Stabilize template engine pipeline (lexer/parser/compiler) and harden runtime path/cache handling
refactor: self-compiling nodes, NodeVisitor pattern, thin Compiler orchestrator
May 27, 2026
Copilot
AI
changed the title
refactor: self-compiling nodes, NodeVisitor pattern, thin Compiler orchestrator
Remove May 27, 2026
Beobles namespace prefix and standardize on Core\View
Copilot
AI
changed the title
Remove
Handle May 27, 2026
Beobles namespace prefix and standardize on Core\Viewextends/import directives as full statements during lexing
Copilot
AI
changed the title
Handle
Implement real May 27, 2026
extends/import directives as full statements during lexingextends inheritance and correct <Block> rendering semantics
Copilot
AI
changed the title
Implement real
Fix template inheritance caching: invalidate child cache on parent layout changes
May 27, 2026
extends inheritance and correct <Block> rendering semantics
Copilot
AI
changed the title
Fix template inheritance caching: invalidate child cache on parent layout changes
Fortalecer herança/caching de templates e endurecer parser/lexer para sintaxe confiável
May 27, 2026
Copilot
AI
changed the title
Replace eval-based template rendering with compiled-file execution
Harden template rendering with pre-include syntax validation and precise SyntaxException reporting
May 27, 2026
Copilot
AI
changed the title
Harden template rendering with pre-include syntax validation and precise SyntaxException reporting
Harden template render pipeline with precise syntax diagnostics and SAPI-safe linting
May 27, 2026
…reach
- Lexer extractTag: replaced [^>]* regex with character-scanner that handles
'>' inside quoted attribute values and {{ }} expressions (e.g. <If condition="{{ a > b }}">)
- Parser parseCloseTag: silently ignore </ElseIf> instead of throwing an exception
- ForeachNode: inject $__loop object (index, count, total, first, last, even, odd,
percentage) at the top of each iteration; use a stack to restore $__loop for
nested foreach loops
- CloseTagNode: restore $__loop from stack when closing a Foreach
- SYNTAX.md: fix associative-array example (as="value,key") to match actual engine
convention (first var = value, second = key)
Copilot
AI
changed the title
Harden template render pipeline with precise syntax diagnostics and SAPI-safe linting
fix: lexer tag scanner, ElseIf close tag, Foreach Jun 2, 2026
$__loop, and SYNTAX.md correction
Copilot
AI
changed the title
fix: lexer tag scanner, ElseIf close tag, Foreach
Fix Lexer: Jun 2, 2026
$__loop, and SYNTAX.md correction}} / !} inside quoted strings terminates expression prematurely
Copilot stopped work on behalf of
beobles due to an error
June 2, 2026 19:30
Copilot
AI
changed the title
Fix Lexer:
Refactor View core for clearer responsibilities and production-safe error handling
Jun 2, 2026
}} / !} inside quoted strings terminates expression prematurely
Copilot
AI
changed the title
Refactor View core for clearer responsibilities and production-safe error handling
Improve template exceptions with original source mapping across extends
Jun 2, 2026
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.
Template errors were surfacing from merged/compiled output, making it hard to locate the real fault—especially when the bug lived in a parent layout (
extends). This change makes syntax/parser failures report the original template file, line, and column where the error actually exists.Source-aware inheritance merge
extendsand block overrides.Lexer-level source metadata
Lexer::tokenize()now accepts optional source mapping and annotates tokens with:source_filesource_linesource_columnSyntaxExceptionmessages with contextual snippet.Stronger syntax exception model
SyntaxExceptionto support structured location/context construction (fromLocation(...)).Parser exceptions with exact origin
Clearer extends-chain failures
Docs
extends-driven errors now point to the original template source location.