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:
5
tests/sample_data/pug/test/fixtures/append-without-block/app-layout.pug
vendored
Normal file
5
tests/sample_data/pug/test/fixtures/append-without-block/app-layout.pug
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
extends layout.pug
|
||||
|
||||
append head
|
||||
script(src='app.js')
|
||||
7
tests/sample_data/pug/test/fixtures/append-without-block/layout.pug
vendored
Normal file
7
tests/sample_data/pug/test/fixtures/append-without-block/layout.pug
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
html
|
||||
block head
|
||||
script(src='vendor/jquery.js')
|
||||
script(src='vendor/caustic.js')
|
||||
body
|
||||
block body
|
||||
6
tests/sample_data/pug/test/fixtures/append-without-block/page.pug
vendored
Normal file
6
tests/sample_data/pug/test/fixtures/append-without-block/page.pug
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
extends app-layout.pug
|
||||
|
||||
append head
|
||||
script(src='foo.js')
|
||||
script(src='bar.js')
|
||||
5
tests/sample_data/pug/test/fixtures/append/app-layout.pug
vendored
Normal file
5
tests/sample_data/pug/test/fixtures/append/app-layout.pug
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
extends layout
|
||||
|
||||
block append head
|
||||
script(src='app.js')
|
||||
7
tests/sample_data/pug/test/fixtures/append/layout.pug
vendored
Normal file
7
tests/sample_data/pug/test/fixtures/append/layout.pug
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
html
|
||||
block head
|
||||
script(src='vendor/jquery.js')
|
||||
script(src='vendor/caustic.js')
|
||||
body
|
||||
block body
|
||||
9
tests/sample_data/pug/test/fixtures/append/page.html
vendored
Normal file
9
tests/sample_data/pug/test/fixtures/append/page.html
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<html>
|
||||
<script src="vendor/jquery.js"></script>
|
||||
<script src="vendor/caustic.js"></script>
|
||||
<script src="app.js"></script>
|
||||
<script src="foo.js"></script>
|
||||
<script src="bar.js"></script>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
6
tests/sample_data/pug/test/fixtures/append/page.pug
vendored
Normal file
6
tests/sample_data/pug/test/fixtures/append/page.pug
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
extends app-layout
|
||||
|
||||
block append head
|
||||
script(src='foo.js')
|
||||
script(src='bar.js')
|
||||
1
tests/sample_data/pug/test/fixtures/compile.with.include.locals.error.pug
vendored
Normal file
1
tests/sample_data/pug/test/fixtures/compile.with.include.locals.error.pug
vendored
Normal file
@@ -0,0 +1 @@
|
||||
include include.locals.error.pug
|
||||
1
tests/sample_data/pug/test/fixtures/compile.with.include.syntax.error.pug
vendored
Normal file
1
tests/sample_data/pug/test/fixtures/compile.with.include.syntax.error.pug
vendored
Normal file
@@ -0,0 +1 @@
|
||||
include include.syntax.error.pug
|
||||
1
tests/sample_data/pug/test/fixtures/compile.with.layout.locals.error.pug
vendored
Normal file
1
tests/sample_data/pug/test/fixtures/compile.with.layout.locals.error.pug
vendored
Normal file
@@ -0,0 +1 @@
|
||||
extends layout.locals.error.pug
|
||||
1
tests/sample_data/pug/test/fixtures/compile.with.layout.syntax.error.pug
vendored
Normal file
1
tests/sample_data/pug/test/fixtures/compile.with.layout.syntax.error.pug
vendored
Normal file
@@ -0,0 +1 @@
|
||||
extends layout.syntax.error.pug
|
||||
1
tests/sample_data/pug/test/fixtures/compile.with.layout.with.include.locals.error.pug
vendored
Normal file
1
tests/sample_data/pug/test/fixtures/compile.with.layout.with.include.locals.error.pug
vendored
Normal file
@@ -0,0 +1 @@
|
||||
extends compile.with.include.locals.error.pug
|
||||
1
tests/sample_data/pug/test/fixtures/compile.with.layout.with.include.syntax.error.pug
vendored
Normal file
1
tests/sample_data/pug/test/fixtures/compile.with.layout.with.include.syntax.error.pug
vendored
Normal file
@@ -0,0 +1 @@
|
||||
extends compile.with.include.syntax.error.pug
|
||||
1
tests/sample_data/pug/test/fixtures/element-with-multiple-attributes.pug
vendored
Normal file
1
tests/sample_data/pug/test/fixtures/element-with-multiple-attributes.pug
vendored
Normal file
@@ -0,0 +1 @@
|
||||
div(attr='val')(foo='bar')
|
||||
2
tests/sample_data/pug/test/fixtures/include.locals.error.pug
vendored
Normal file
2
tests/sample_data/pug/test/fixtures/include.locals.error.pug
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
= foo()
|
||||
2
tests/sample_data/pug/test/fixtures/include.syntax.error.pug
vendored
Normal file
2
tests/sample_data/pug/test/fixtures/include.syntax.error.pug
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
= foo(
|
||||
7
tests/sample_data/pug/test/fixtures/invalid-block-in-extends.pug
vendored
Normal file
7
tests/sample_data/pug/test/fixtures/invalid-block-in-extends.pug
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
extends ./layout.pug
|
||||
|
||||
block title
|
||||
title My Article
|
||||
|
||||
block contents
|
||||
// oops, that's not a block
|
||||
2
tests/sample_data/pug/test/fixtures/issue-1593/include-layout.pug
vendored
Normal file
2
tests/sample_data/pug/test/fixtures/issue-1593/include-layout.pug
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.included-layout
|
||||
block include-body
|
||||
4
tests/sample_data/pug/test/fixtures/issue-1593/include.pug
vendored
Normal file
4
tests/sample_data/pug/test/fixtures/issue-1593/include.pug
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
extends ./include-layout.pug
|
||||
|
||||
block include-body
|
||||
.include-body
|
||||
7
tests/sample_data/pug/test/fixtures/issue-1593/index.pug
vendored
Normal file
7
tests/sample_data/pug/test/fixtures/issue-1593/index.pug
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
extends ./layout.pug
|
||||
|
||||
block body-a
|
||||
.body-a
|
||||
block body-b
|
||||
.body-b
|
||||
include ./include.pug
|
||||
3
tests/sample_data/pug/test/fixtures/issue-1593/layout.pug
vendored
Normal file
3
tests/sample_data/pug/test/fixtures/issue-1593/layout.pug
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
.layout-body
|
||||
block body-a
|
||||
block body-b
|
||||
2
tests/sample_data/pug/test/fixtures/layout.locals.error.pug
vendored
Normal file
2
tests/sample_data/pug/test/fixtures/layout.locals.error.pug
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
= foo()
|
||||
6
tests/sample_data/pug/test/fixtures/layout.pug
vendored
Normal file
6
tests/sample_data/pug/test/fixtures/layout.pug
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
block title
|
||||
body
|
||||
block body
|
||||
2
tests/sample_data/pug/test/fixtures/layout.syntax.error.pug
vendored
Normal file
2
tests/sample_data/pug/test/fixtures/layout.syntax.error.pug
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
= foo(
|
||||
5
tests/sample_data/pug/test/fixtures/layout.with.runtime.error.pug
vendored
Normal file
5
tests/sample_data/pug/test/fixtures/layout.with.runtime.error.pug
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
html
|
||||
body
|
||||
= foo.length
|
||||
block content
|
||||
|
||||
5
tests/sample_data/pug/test/fixtures/mixin-include.pug
vendored
Normal file
5
tests/sample_data/pug/test/fixtures/mixin-include.pug
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
mixin bang
|
||||
+foo
|
||||
|
||||
mixin foo
|
||||
p bar
|
||||
2
tests/sample_data/pug/test/fixtures/mixin.error.pug
vendored
Normal file
2
tests/sample_data/pug/test/fixtures/mixin.error.pug
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
mixin mixin-with-error(foo)
|
||||
- foo.length
|
||||
5
tests/sample_data/pug/test/fixtures/multi-append-prepend-block/redefine.pug
vendored
Normal file
5
tests/sample_data/pug/test/fixtures/multi-append-prepend-block/redefine.pug
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
extends root.pug
|
||||
|
||||
block content
|
||||
.content
|
||||
| Defined content
|
||||
5
tests/sample_data/pug/test/fixtures/multi-append-prepend-block/root.pug
vendored
Normal file
5
tests/sample_data/pug/test/fixtures/multi-append-prepend-block/root.pug
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
block content
|
||||
| default content
|
||||
|
||||
block head
|
||||
script(src='/app.js')
|
||||
32
tests/sample_data/pug/test/fixtures/perf.pug
vendored
Normal file
32
tests/sample_data/pug/test/fixtures/perf.pug
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
.data
|
||||
ol.sortable#contents
|
||||
each item in report
|
||||
if (!item.parent)
|
||||
div
|
||||
li.chapter(data-ref= item.id)
|
||||
a(href='/admin/report/detail/' + item.id)
|
||||
= item.name
|
||||
- var chp = item.id
|
||||
ol.sortable
|
||||
each item in report
|
||||
if (item.parent === chp && item.type === 'section')
|
||||
div
|
||||
li.section(data-ref= item.id)
|
||||
a(href='/admin/report/detail/' + item.id)
|
||||
= item.name
|
||||
- var sec = item.id
|
||||
ol.sortable
|
||||
each item in report
|
||||
if (item.parent === sec && item.type === 'page')
|
||||
div
|
||||
li.page(data-ref= item.id)
|
||||
a(href='/admin/report/detail/' + item.id)
|
||||
= item.name
|
||||
- var page = item.id
|
||||
ol.sortable
|
||||
each item in report
|
||||
if (item.parent === page && item.type === 'subpage')
|
||||
div
|
||||
li.subpage(data-ref= item.id)
|
||||
a(href='/admin/report/detail/' + item.id)
|
||||
= item.name
|
||||
5
tests/sample_data/pug/test/fixtures/prepend-without-block/app-layout.pug
vendored
Normal file
5
tests/sample_data/pug/test/fixtures/prepend-without-block/app-layout.pug
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
extends layout.pug
|
||||
|
||||
prepend head
|
||||
script(src='app.js')
|
||||
7
tests/sample_data/pug/test/fixtures/prepend-without-block/layout.pug
vendored
Normal file
7
tests/sample_data/pug/test/fixtures/prepend-without-block/layout.pug
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
html
|
||||
block head
|
||||
script(src='vendor/jquery.js')
|
||||
script(src='vendor/caustic.js')
|
||||
body
|
||||
block body
|
||||
9
tests/sample_data/pug/test/fixtures/prepend-without-block/page.html
vendored
Normal file
9
tests/sample_data/pug/test/fixtures/prepend-without-block/page.html
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<html>
|
||||
<script src="foo.js"></script>
|
||||
<script src="bar.js"></script>
|
||||
<script src="app.js"></script>
|
||||
<script src="vendor/jquery.js"></script>
|
||||
<script src="vendor/caustic.js"></script>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
6
tests/sample_data/pug/test/fixtures/prepend-without-block/page.pug
vendored
Normal file
6
tests/sample_data/pug/test/fixtures/prepend-without-block/page.pug
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
extends app-layout.pug
|
||||
|
||||
prepend head
|
||||
script(src='foo.js')
|
||||
script(src='bar.js')
|
||||
5
tests/sample_data/pug/test/fixtures/prepend/app-layout.pug
vendored
Normal file
5
tests/sample_data/pug/test/fixtures/prepend/app-layout.pug
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
extends layout.pug
|
||||
|
||||
block prepend head
|
||||
script(src='app.js')
|
||||
7
tests/sample_data/pug/test/fixtures/prepend/layout.pug
vendored
Normal file
7
tests/sample_data/pug/test/fixtures/prepend/layout.pug
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
html
|
||||
block head
|
||||
script(src='vendor/jquery.js')
|
||||
script(src='vendor/caustic.js')
|
||||
body
|
||||
block body
|
||||
9
tests/sample_data/pug/test/fixtures/prepend/page.html
vendored
Normal file
9
tests/sample_data/pug/test/fixtures/prepend/page.html
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<html>
|
||||
<script src="foo.js"></script>
|
||||
<script src="bar.js"></script>
|
||||
<script src="app.js"></script>
|
||||
<script src="vendor/jquery.js"></script>
|
||||
<script src="vendor/caustic.js"></script>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
6
tests/sample_data/pug/test/fixtures/prepend/page.pug
vendored
Normal file
6
tests/sample_data/pug/test/fixtures/prepend/page.pug
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
extends app-layout.pug
|
||||
|
||||
block prepend head
|
||||
script(src='foo.js')
|
||||
script(src='bar.js')
|
||||
1
tests/sample_data/pug/test/fixtures/runtime.error.pug
vendored
Normal file
1
tests/sample_data/pug/test/fixtures/runtime.error.pug
vendored
Normal file
@@ -0,0 +1 @@
|
||||
-foo()
|
||||
3
tests/sample_data/pug/test/fixtures/runtime.layout.error.pug
vendored
Normal file
3
tests/sample_data/pug/test/fixtures/runtime.layout.error.pug
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
extends layout.with.runtime.error.pug
|
||||
block content
|
||||
| some content
|
||||
3
tests/sample_data/pug/test/fixtures/runtime.with.mixin.error.pug
vendored
Normal file
3
tests/sample_data/pug/test/fixtures/runtime.with.mixin.error.pug
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
include mixin.error.pug
|
||||
|
||||
+mixin-with-error(null)
|
||||
2
tests/sample_data/pug/test/fixtures/scripts.pug
vendored
Normal file
2
tests/sample_data/pug/test/fixtures/scripts.pug
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
script(src='/jquery.js')
|
||||
script(src='/caustic.js')
|
||||
Reference in New Issue
Block a user