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
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
extends window.pug
|
||||
|
||||
block window-content
|
||||
.dialog
|
||||
block content
|
||||
@@ -0,0 +1,2 @@
|
||||
block test
|
||||
|
||||
@@ -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-src/auxiliary/layout
|
||||
|
||||
block content
|
||||
include ../../cases-src/auxiliary/include-from-root
|
||||
@@ -0,0 +1,8 @@
|
||||
html
|
||||
head
|
||||
style(type="text/css")
|
||||
:less
|
||||
@pad: 15px;
|
||||
body {
|
||||
padding: @pad;
|
||||
}
|
||||
@@ -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
|
||||
@@ -0,0 +1,6 @@
|
||||
html
|
||||
head
|
||||
title My Application
|
||||
block head
|
||||
body
|
||||
block content
|
||||
@@ -0,0 +1,3 @@
|
||||
mixin slide
|
||||
section.slide
|
||||
block
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
mixin foo()
|
||||
p bar
|
||||
@@ -0,0 +1,3 @@
|
||||
.pet
|
||||
h1 {{name}}
|
||||
p {{name}} is a {{species}} that is {{age}} old
|
||||
@@ -0,0 +1 @@
|
||||
<p>:)</p>
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
.window
|
||||
a(href='#').close Close
|
||||
block window-content
|
||||
@@ -0,0 +1,10 @@
|
||||
html
|
||||
head
|
||||
title
|
||||
body
|
||||
h1 Page
|
||||
#content
|
||||
#content-wrapper
|
||||
yield
|
||||
#footer
|
||||
stuff
|
||||
@@ -0,0 +1 @@
|
||||
include /auxiliary/extends-from-root.pug
|
||||
@@ -0,0 +1,2 @@
|
||||
include auxiliary/extends-empty-block-1.pug
|
||||
include auxiliary/extends-empty-block-2.pug
|
||||
@@ -0,0 +1 @@
|
||||
include ../cases-src/auxiliary/extends-relative.pug
|
||||
@@ -0,0 +1,2 @@
|
||||
math =
|
||||
square: (value) -> value * value
|
||||
@@ -0,0 +1,2 @@
|
||||
style(type="text/css")
|
||||
include:stylus some.styl
|
||||
@@ -0,0 +1,7 @@
|
||||
html
|
||||
body
|
||||
include:markdown-it some.md
|
||||
script
|
||||
include:coffee-script(minify=true) include-filter-coffee.coffee
|
||||
script
|
||||
include:coffee-script(minify=false) include-filter-coffee.coffee
|
||||
@@ -0,0 +1,3 @@
|
||||
| The message is "
|
||||
yield
|
||||
| "
|
||||
@@ -0,0 +1,5 @@
|
||||
html
|
||||
body
|
||||
p
|
||||
include include-only-text-body.pug
|
||||
em hello world
|
||||
@@ -0,0 +1,3 @@
|
||||
head
|
||||
script(type='text/javascript').
|
||||
alert('hello world');
|
||||
@@ -0,0 +1,4 @@
|
||||
html
|
||||
include include-with-text-head.pug
|
||||
script(src='/caustic.js')
|
||||
script(src='/app.js')
|
||||
@@ -0,0 +1,2 @@
|
||||
script#pet-template(type='text/x-template')
|
||||
include auxiliary/pet.pug
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
include auxiliary/yield-nested.pug
|
||||
p some content
|
||||
p and some more
|
||||
@@ -0,0 +1,3 @@
|
||||
pre
|
||||
code
|
||||
include javascript-new-lines.js
|
||||
10
tests/sample_data/pug-linker/test/cases-src/includes.pug
Normal file
10
tests/sample_data/pug-linker/test/cases-src/includes.pug
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
include auxiliary/mixins.pug
|
||||
|
||||
+foo
|
||||
|
||||
body
|
||||
include auxiliary/smile.html
|
||||
include auxiliary/escapes.html
|
||||
script(type="text/javascript")
|
||||
include:verbatim auxiliary/includable.js
|
||||
@@ -0,0 +1 @@
|
||||
var x = '\n here is some \n new lined text';
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
extends ../fixtures/append/app-layout.pug
|
||||
|
||||
block append head
|
||||
script(src='foo.js')
|
||||
script(src='bar.js')
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
extends ../fixtures/append-without-block/app-layout.pug
|
||||
|
||||
append head
|
||||
script(src='foo.js')
|
||||
script(src='bar.js')
|
||||
@@ -0,0 +1,19 @@
|
||||
extends ../fixtures/multi-append-prepend-block/redefine.pug
|
||||
|
||||
append content
|
||||
p.first.append Something appended to content
|
||||
|
||||
prepend content
|
||||
p.first.prepend Something prepended to content
|
||||
|
||||
append content
|
||||
p.last.append Last append must be most last
|
||||
|
||||
prepend content
|
||||
p.last.prepend Last prepend must appear at top
|
||||
|
||||
append head
|
||||
script(src='jquery.js')
|
||||
|
||||
prepend head
|
||||
script(src='foo.js')
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
extends ../fixtures/prepend/app-layout.pug
|
||||
|
||||
block prepend head
|
||||
script(src='foo.js')
|
||||
script(src='bar.js')
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
extends ../fixtures/prepend-without-block/app-layout.pug
|
||||
|
||||
prepend head
|
||||
script(src='foo.js')
|
||||
script(src='bar.js')
|
||||
@@ -0,0 +1,2 @@
|
||||
body
|
||||
padding 10px
|
||||
3
tests/sample_data/pug-linker/test/cases-src/some.md
Normal file
3
tests/sample_data/pug-linker/test/cases-src/some.md
Normal file
@@ -0,0 +1,3 @@
|
||||
Just _some_ markdown **tests**.
|
||||
|
||||
With new line.
|
||||
1
tests/sample_data/pug-linker/test/cases-src/some.styl
Normal file
1
tests/sample_data/pug-linker/test/cases-src/some.styl
Normal file
@@ -0,0 +1 @@
|
||||
@import "some-included"
|
||||
Reference in New Issue
Block a user