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:
@@ -0,0 +1 @@
|
||||
block content
|
||||
@@ -0,0 +1,4 @@
|
||||
mixin test()
|
||||
.test&attributes(attributes)
|
||||
|
||||
+test()
|
||||
@@ -0,0 +1,8 @@
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
title Default title
|
||||
body
|
||||
block body
|
||||
.container
|
||||
block content
|
||||
6
tests/sample_data/pug/test/cases/auxiliary/dialog.pug
Normal file
6
tests/sample_data/pug/test/cases/auxiliary/dialog.pug
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
extends window.pug
|
||||
|
||||
block window-content
|
||||
.dialog
|
||||
block content
|
||||
@@ -0,0 +1,2 @@
|
||||
block test
|
||||
|
||||
3
tests/sample_data/pug/test/cases/auxiliary/escapes.html
Normal file
3
tests/sample_data/pug/test/cases/auxiliary/escapes.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<script>
|
||||
console.log("foo\nbar")
|
||||
</script>
|
||||
@@ -0,0 +1,5 @@
|
||||
extends empty-block.pug
|
||||
|
||||
block test
|
||||
div test1
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
extends empty-block.pug
|
||||
|
||||
block test
|
||||
div test2
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
extends /auxiliary/layout.pug
|
||||
|
||||
block content
|
||||
include /auxiliary/include-from-root.pug
|
||||
@@ -0,0 +1,4 @@
|
||||
extends ../../cases/auxiliary/layout
|
||||
|
||||
block content
|
||||
include ../../cases/auxiliary/include-from-root
|
||||
@@ -0,0 +1,8 @@
|
||||
html
|
||||
head
|
||||
style(type="text/css")
|
||||
:less
|
||||
@pad: 15px;
|
||||
body {
|
||||
padding: @pad;
|
||||
}
|
||||
8
tests/sample_data/pug/test/cases/auxiliary/includable.js
Normal file
8
tests/sample_data/pug/test/cases/auxiliary/includable.js
Normal file
@@ -0,0 +1,8 @@
|
||||
var STRING_SUBSTITUTIONS = {
|
||||
// table of character substitutions
|
||||
'\t': '\\t',
|
||||
'\r': '\\r',
|
||||
'\n': '\\n',
|
||||
'"': '\\"',
|
||||
'\\': '\\\\',
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
h1 hello
|
||||
@@ -0,0 +1,11 @@
|
||||
mixin article()
|
||||
article
|
||||
block
|
||||
|
||||
html
|
||||
head
|
||||
title My Application
|
||||
block head
|
||||
body
|
||||
+article
|
||||
block content
|
||||
@@ -0,0 +1,2 @@
|
||||
h1 grand-grandparent
|
||||
block grand-grandparent
|
||||
@@ -0,0 +1,6 @@
|
||||
extends inheritance.extend.recursive-grand-grandparent.pug
|
||||
|
||||
block grand-grandparent
|
||||
h2 grandparent
|
||||
block grandparent
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
extends inheritance.extend.recursive-grandparent.pug
|
||||
|
||||
block grandparent
|
||||
h3 parent
|
||||
block parent
|
||||
@@ -0,0 +1,7 @@
|
||||
html
|
||||
head
|
||||
title My Application
|
||||
block head
|
||||
body
|
||||
block content
|
||||
include window.pug
|
||||
6
tests/sample_data/pug/test/cases/auxiliary/layout.pug
Normal file
6
tests/sample_data/pug/test/cases/auxiliary/layout.pug
Normal file
@@ -0,0 +1,6 @@
|
||||
html
|
||||
head
|
||||
title My Application
|
||||
block head
|
||||
body
|
||||
block content
|
||||
@@ -0,0 +1,3 @@
|
||||
mixin slide
|
||||
section.slide
|
||||
block
|
||||
3
tests/sample_data/pug/test/cases/auxiliary/mixins.pug
Normal file
3
tests/sample_data/pug/test/cases/auxiliary/mixins.pug
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
mixin foo()
|
||||
p bar
|
||||
3
tests/sample_data/pug/test/cases/auxiliary/pet.pug
Normal file
3
tests/sample_data/pug/test/cases/auxiliary/pet.pug
Normal file
@@ -0,0 +1,3 @@
|
||||
.pet
|
||||
h1 {{name}}
|
||||
p {{name}} is a {{species}} that is {{age}} old
|
||||
1
tests/sample_data/pug/test/cases/auxiliary/smile.html
Normal file
1
tests/sample_data/pug/test/cases/auxiliary/smile.html
Normal file
@@ -0,0 +1 @@
|
||||
<p>:)</p>
|
||||
4
tests/sample_data/pug/test/cases/auxiliary/window.pug
Normal file
4
tests/sample_data/pug/test/cases/auxiliary/window.pug
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
.window
|
||||
a(href='#').close Close
|
||||
block window-content
|
||||
10
tests/sample_data/pug/test/cases/auxiliary/yield-nested.pug
Normal file
10
tests/sample_data/pug/test/cases/auxiliary/yield-nested.pug
Normal file
@@ -0,0 +1,10 @@
|
||||
html
|
||||
head
|
||||
title
|
||||
body
|
||||
h1 Page
|
||||
#content
|
||||
#content-wrapper
|
||||
yield
|
||||
#footer
|
||||
stuff
|
||||
Reference in New Issue
Block a user