fix: add scoped error logging for lexer/parser errors

- Add std.log.scoped(.pugz) to template.zig and view_engine.zig
- Log detailed error info (code, line, column, message) when parsing fails
- Log template path context in ViewEngine on parse errors
- Remove debug print from lexer, use proper scoped logging instead
- Move benchmarks, docs, examples, playground, tests out of src/ to project root
- Update build.zig and documentation paths accordingly
- Bump version to 0.3.1
This commit is contained in:
2026-01-25 17:10:02 +05:30
parent 9d3b729c6c
commit aaf6a1af2d
1148 changed files with 57 additions and 330 deletions

View File

@@ -0,0 +1,179 @@
{
"type": "Block",
"nodes": [
{
"type": "Include",
"file": {
"type": "FileReference",
"line": 1,
"filename": "include-extends-of-common-template.pug",
"path": "auxiliary/extends-empty-block-1.pug",
"fullPath": "auxiliary/extends-empty-block-1.pug",
"str": "extends empty-block.pug\n\nblock test\n div test1\n\n",
"ast": {
"type": "Block",
"nodes": [
{
"type": "Extends",
"file": {
"type": "FileReference",
"path": "empty-block.pug",
"line": 1,
"filename": "auxiliary/extends-empty-block-1.pug",
"fullPath": "auxiliary/empty-block.pug",
"str": "block test\n\n",
"ast": {
"type": "Block",
"nodes": [
{
"type": "NamedBlock",
"nodes": [],
"line": 1,
"filename": "auxiliary/empty-block.pug",
"name": "test",
"mode": "replace"
}
],
"line": 0,
"filename": "auxiliary/empty-block.pug"
}
},
"line": 1,
"filename": "auxiliary/extends-empty-block-1.pug"
},
{
"type": "NamedBlock",
"nodes": [
{
"type": "Tag",
"name": "div",
"selfClosing": false,
"block": {
"type": "Block",
"nodes": [
{
"type": "Text",
"val": "test1",
"line": 4,
"filename": "auxiliary/extends-empty-block-1.pug"
}
],
"line": 4,
"filename": "auxiliary/extends-empty-block-1.pug"
},
"attrs": [],
"attributeBlocks": [],
"isInline": false,
"line": 4,
"filename": "auxiliary/extends-empty-block-1.pug"
}
],
"line": 3,
"filename": "auxiliary/extends-empty-block-1.pug",
"name": "test",
"mode": "replace"
}
],
"line": 0,
"filename": "auxiliary/extends-empty-block-1.pug"
}
},
"line": 1,
"filename": "include-extends-of-common-template.pug",
"block": {
"type": "Block",
"nodes": [],
"line": 1,
"filename": "include-extends-of-common-template.pug"
}
},
{
"type": "Include",
"file": {
"type": "FileReference",
"line": 2,
"filename": "include-extends-of-common-template.pug",
"path": "auxiliary/extends-empty-block-2.pug",
"fullPath": "auxiliary/extends-empty-block-2.pug",
"str": "extends empty-block.pug\n\nblock test\n div test2\n\n",
"ast": {
"type": "Block",
"nodes": [
{
"type": "Extends",
"file": {
"type": "FileReference",
"path": "empty-block.pug",
"line": 1,
"filename": "auxiliary/extends-empty-block-2.pug",
"fullPath": "auxiliary/empty-block.pug",
"str": "block test\n\n",
"ast": {
"type": "Block",
"nodes": [
{
"type": "NamedBlock",
"nodes": [],
"line": 1,
"filename": "auxiliary/empty-block.pug",
"name": "test",
"mode": "replace"
}
],
"line": 0,
"filename": "auxiliary/empty-block.pug"
}
},
"line": 1,
"filename": "auxiliary/extends-empty-block-2.pug"
},
{
"type": "NamedBlock",
"nodes": [
{
"type": "Tag",
"name": "div",
"selfClosing": false,
"block": {
"type": "Block",
"nodes": [
{
"type": "Text",
"val": "test2",
"line": 4,
"filename": "auxiliary/extends-empty-block-2.pug"
}
],
"line": 4,
"filename": "auxiliary/extends-empty-block-2.pug"
},
"attrs": [],
"attributeBlocks": [],
"isInline": false,
"line": 4,
"filename": "auxiliary/extends-empty-block-2.pug"
}
],
"line": 3,
"filename": "auxiliary/extends-empty-block-2.pug",
"name": "test",
"mode": "replace"
}
],
"line": 0,
"filename": "auxiliary/extends-empty-block-2.pug"
}
},
"line": 2,
"filename": "include-extends-of-common-template.pug",
"block": {
"type": "Block",
"nodes": [],
"line": 2,
"filename": "include-extends-of-common-template.pug"
}
}
],
"line": 0,
"filename": "include-extends-of-common-template.pug"
}