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,201 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Include",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 1,
|
||||
"filename": "include-extends-from-root.pug",
|
||||
"path": "/auxiliary/extends-from-root.pug",
|
||||
"fullPath": "auxiliary/extends-from-root.pug",
|
||||
"str": "extends /auxiliary/layout.pug\n\nblock content\n include /auxiliary/include-from-root.pug\n",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Extends",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"path": "/auxiliary/layout.pug",
|
||||
"line": 1,
|
||||
"filename": "auxiliary/extends-from-root.pug",
|
||||
"fullPath": "auxiliary/layout.pug",
|
||||
"str": "html\n head\n title My Application\n block head\n body\n block content",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "html",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "head",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "title",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "My Application",
|
||||
"line": 3,
|
||||
"filename": "auxiliary/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "auxiliary/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 3,
|
||||
"filename": "auxiliary/layout.pug"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [],
|
||||
"line": 4,
|
||||
"filename": "auxiliary/layout.pug",
|
||||
"name": "head",
|
||||
"mode": "replace"
|
||||
}
|
||||
],
|
||||
"line": 2,
|
||||
"filename": "auxiliary/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 2,
|
||||
"filename": "auxiliary/layout.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "body",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [],
|
||||
"line": 6,
|
||||
"filename": "auxiliary/layout.pug",
|
||||
"name": "content",
|
||||
"mode": "replace"
|
||||
}
|
||||
],
|
||||
"line": 5,
|
||||
"filename": "auxiliary/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "auxiliary/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 1,
|
||||
"filename": "auxiliary/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 1,
|
||||
"filename": "auxiliary/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "auxiliary/layout.pug"
|
||||
}
|
||||
},
|
||||
"line": 1,
|
||||
"filename": "auxiliary/extends-from-root.pug"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Include",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 4,
|
||||
"filename": "auxiliary/extends-from-root.pug",
|
||||
"path": "/auxiliary/include-from-root.pug",
|
||||
"fullPath": "auxiliary/include-from-root.pug",
|
||||
"str": "h1 hello",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "h1",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "hello",
|
||||
"line": 1,
|
||||
"filename": "auxiliary/include-from-root.pug"
|
||||
}
|
||||
],
|
||||
"line": 1,
|
||||
"filename": "auxiliary/include-from-root.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 1,
|
||||
"filename": "auxiliary/include-from-root.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "auxiliary/include-from-root.pug"
|
||||
}
|
||||
},
|
||||
"line": 4,
|
||||
"filename": "auxiliary/extends-from-root.pug",
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 4,
|
||||
"filename": "auxiliary/extends-from-root.pug"
|
||||
}
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "auxiliary/extends-from-root.pug",
|
||||
"name": "content",
|
||||
"mode": "replace"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "auxiliary/extends-from-root.pug"
|
||||
}
|
||||
},
|
||||
"line": 1,
|
||||
"filename": "include-extends-from-root.pug",
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 1,
|
||||
"filename": "include-extends-from-root.pug"
|
||||
}
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "include-extends-from-root.pug"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Include",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 1,
|
||||
"filename": "include-extends-relative.pug",
|
||||
"path": "../cases-src/auxiliary/extends-relative.pug",
|
||||
"fullPath": "../cases-src/auxiliary/extends-relative.pug",
|
||||
"str": "extends ../../cases-src/auxiliary/layout\n\nblock content\n include ../../cases-src/auxiliary/include-from-root\n",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Extends",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"path": "../../cases-src/auxiliary/layout",
|
||||
"line": 1,
|
||||
"filename": "../cases-src/auxiliary/extends-relative.pug",
|
||||
"fullPath": "../cases-src/auxiliary/layout.pug",
|
||||
"str": "html\n head\n title My Application\n block head\n body\n block content",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "html",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "head",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "title",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "My Application",
|
||||
"line": 3,
|
||||
"filename": "../cases-src/auxiliary/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "../cases-src/auxiliary/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 3,
|
||||
"filename": "../cases-src/auxiliary/layout.pug"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [],
|
||||
"line": 4,
|
||||
"filename": "../cases-src/auxiliary/layout.pug",
|
||||
"name": "head",
|
||||
"mode": "replace"
|
||||
}
|
||||
],
|
||||
"line": 2,
|
||||
"filename": "../cases-src/auxiliary/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 2,
|
||||
"filename": "../cases-src/auxiliary/layout.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "body",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [],
|
||||
"line": 6,
|
||||
"filename": "../cases-src/auxiliary/layout.pug",
|
||||
"name": "content",
|
||||
"mode": "replace"
|
||||
}
|
||||
],
|
||||
"line": 5,
|
||||
"filename": "../cases-src/auxiliary/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "../cases-src/auxiliary/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 1,
|
||||
"filename": "../cases-src/auxiliary/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 1,
|
||||
"filename": "../cases-src/auxiliary/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "../cases-src/auxiliary/layout.pug"
|
||||
}
|
||||
},
|
||||
"line": 1,
|
||||
"filename": "../cases-src/auxiliary/extends-relative.pug"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "RawInclude",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 4,
|
||||
"filename": "../cases-src/auxiliary/extends-relative.pug",
|
||||
"path": "../../cases-src/auxiliary/include-from-root",
|
||||
"fullPath": "../cases-src/auxiliary/include-from-root.pug",
|
||||
"str": "h1 hello"
|
||||
},
|
||||
"line": 4,
|
||||
"filename": "../cases-src/auxiliary/extends-relative.pug",
|
||||
"filters": []
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "../cases-src/auxiliary/extends-relative.pug",
|
||||
"name": "content",
|
||||
"mode": "replace"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "../cases-src/auxiliary/extends-relative.pug"
|
||||
}
|
||||
},
|
||||
"line": 1,
|
||||
"filename": "include-extends-relative.pug",
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 1,
|
||||
"filename": "include-extends-relative.pug"
|
||||
}
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "include-extends-relative.pug"
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "style",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "RawInclude",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 2,
|
||||
"filename": "include-filter-stylus.pug",
|
||||
"path": "some.styl",
|
||||
"fullPath": "some.styl",
|
||||
"str": "@import \"some-included\"\n"
|
||||
},
|
||||
"line": 2,
|
||||
"filename": "include-filter-stylus.pug",
|
||||
"filters": [
|
||||
{
|
||||
"type": "IncludeFilter",
|
||||
"name": "stylus",
|
||||
"attrs": [],
|
||||
"line": 2,
|
||||
"filename": "include-filter-stylus.pug"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"line": 1,
|
||||
"filename": "include-filter-stylus.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "type",
|
||||
"val": "\"text/css\"",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 1,
|
||||
"filename": "include-filter-stylus.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "include-filter-stylus.pug"
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "html",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "body",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "RawInclude",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 3,
|
||||
"filename": "include-filter.pug",
|
||||
"path": "some.md",
|
||||
"fullPath": "some.md",
|
||||
"str": "Just _some_ markdown **tests**.\n\nWith new line.\n"
|
||||
},
|
||||
"line": 3,
|
||||
"filename": "include-filter.pug",
|
||||
"filters": [
|
||||
{
|
||||
"type": "IncludeFilter",
|
||||
"name": "markdown-it",
|
||||
"attrs": [],
|
||||
"line": 3,
|
||||
"filename": "include-filter.pug"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "RawInclude",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 5,
|
||||
"filename": "include-filter.pug",
|
||||
"path": "include-filter-coffee.coffee",
|
||||
"fullPath": "include-filter-coffee.coffee",
|
||||
"str": "math =\n square: (value) -> value * value\n"
|
||||
},
|
||||
"line": 5,
|
||||
"filename": "include-filter.pug",
|
||||
"filters": [
|
||||
{
|
||||
"type": "IncludeFilter",
|
||||
"name": "coffee-script",
|
||||
"attrs": [
|
||||
{
|
||||
"name": "minify",
|
||||
"val": "true",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"line": 5,
|
||||
"filename": "include-filter.pug"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"line": 4,
|
||||
"filename": "include-filter.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 4,
|
||||
"filename": "include-filter.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "RawInclude",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 7,
|
||||
"filename": "include-filter.pug",
|
||||
"path": "include-filter-coffee.coffee",
|
||||
"fullPath": "include-filter-coffee.coffee",
|
||||
"str": "math =\n square: (value) -> value * value\n"
|
||||
},
|
||||
"line": 7,
|
||||
"filename": "include-filter.pug",
|
||||
"filters": [
|
||||
{
|
||||
"type": "IncludeFilter",
|
||||
"name": "coffee-script",
|
||||
"attrs": [
|
||||
{
|
||||
"name": "minify",
|
||||
"val": "false",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"line": 7,
|
||||
"filename": "include-filter.pug"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"line": 6,
|
||||
"filename": "include-filter.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 6,
|
||||
"filename": "include-filter.pug"
|
||||
}
|
||||
],
|
||||
"line": 2,
|
||||
"filename": "include-filter.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 2,
|
||||
"filename": "include-filter.pug"
|
||||
}
|
||||
],
|
||||
"line": 1,
|
||||
"filename": "include-filter.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 1,
|
||||
"filename": "include-filter.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "include-filter.pug"
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "The message is \"",
|
||||
"line": 1,
|
||||
"filename": "include-only-text-body.pug"
|
||||
},
|
||||
{
|
||||
"type": "YieldBlock",
|
||||
"line": 2,
|
||||
"filename": "include-only-text-body.pug"
|
||||
},
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "\"",
|
||||
"line": 3,
|
||||
"filename": "include-only-text-body.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "include-only-text-body.pug"
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "html",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "body",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "p",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Include",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 4,
|
||||
"filename": "include-only-text.pug",
|
||||
"path": "include-only-text-body.pug",
|
||||
"fullPath": "include-only-text-body.pug",
|
||||
"str": "| The message is \"\nyield\n| \"\n",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "The message is \"",
|
||||
"line": 1,
|
||||
"filename": "include-only-text-body.pug"
|
||||
},
|
||||
{
|
||||
"type": "YieldBlock",
|
||||
"line": 2,
|
||||
"filename": "include-only-text-body.pug"
|
||||
},
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "\"",
|
||||
"line": 3,
|
||||
"filename": "include-only-text-body.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "include-only-text-body.pug"
|
||||
}
|
||||
},
|
||||
"line": 4,
|
||||
"filename": "include-only-text.pug",
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "em",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "hello world",
|
||||
"line": 5,
|
||||
"filename": "include-only-text.pug"
|
||||
}
|
||||
],
|
||||
"line": 5,
|
||||
"filename": "include-only-text.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": true,
|
||||
"line": 5,
|
||||
"filename": "include-only-text.pug"
|
||||
}
|
||||
],
|
||||
"line": 5,
|
||||
"filename": "include-only-text.pug"
|
||||
}
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "include-only-text.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 3,
|
||||
"filename": "include-only-text.pug"
|
||||
}
|
||||
],
|
||||
"line": 2,
|
||||
"filename": "include-only-text.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 2,
|
||||
"filename": "include-only-text.pug"
|
||||
}
|
||||
],
|
||||
"line": 1,
|
||||
"filename": "include-only-text.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 1,
|
||||
"filename": "include-only-text.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "include-only-text.pug"
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "head",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "alert('hello world');",
|
||||
"line": 3
|
||||
}
|
||||
],
|
||||
"line": 2,
|
||||
"filename": "include-with-text-head.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "type",
|
||||
"val": "'text/javascript'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 2,
|
||||
"filename": "include-with-text-head.pug",
|
||||
"textOnly": true
|
||||
}
|
||||
],
|
||||
"line": 1,
|
||||
"filename": "include-with-text-head.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 1,
|
||||
"filename": "include-with-text-head.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "include-with-text-head.pug"
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "html",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Include",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 2,
|
||||
"filename": "include-with-text.pug",
|
||||
"path": "include-with-text-head.pug",
|
||||
"fullPath": "include-with-text-head.pug",
|
||||
"str": "head\n script(type='text/javascript').\n alert('hello world');\n",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "head",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "alert('hello world');",
|
||||
"line": 3
|
||||
}
|
||||
],
|
||||
"line": 2,
|
||||
"filename": "include-with-text-head.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "type",
|
||||
"val": "'text/javascript'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 2,
|
||||
"filename": "include-with-text-head.pug",
|
||||
"textOnly": true
|
||||
}
|
||||
],
|
||||
"line": 1,
|
||||
"filename": "include-with-text-head.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 1,
|
||||
"filename": "include-with-text-head.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "include-with-text-head.pug"
|
||||
}
|
||||
},
|
||||
"line": 2,
|
||||
"filename": "include-with-text.pug",
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 3,
|
||||
"filename": "include-with-text.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'/caustic.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 3,
|
||||
"filename": "include-with-text.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 4,
|
||||
"filename": "include-with-text.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'/app.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 4,
|
||||
"filename": "include-with-text.pug"
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "include-with-text.pug"
|
||||
}
|
||||
}
|
||||
],
|
||||
"line": 1,
|
||||
"filename": "include-with-text.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 1,
|
||||
"filename": "include-with-text.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "include-with-text.pug"
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Include",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 2,
|
||||
"filename": "include.script.pug",
|
||||
"path": "auxiliary/pet.pug",
|
||||
"fullPath": "auxiliary/pet.pug",
|
||||
"str": ".pet\n h1 {{name}}\n p {{name}} is a {{species}} that is {{age}} old",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "div",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "h1",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "{{name}}",
|
||||
"line": 2,
|
||||
"filename": "auxiliary/pet.pug"
|
||||
}
|
||||
],
|
||||
"line": 2,
|
||||
"filename": "auxiliary/pet.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 2,
|
||||
"filename": "auxiliary/pet.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "p",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "{{name}} is a {{species}} that is {{age}} old",
|
||||
"line": 3,
|
||||
"filename": "auxiliary/pet.pug"
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "auxiliary/pet.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 3,
|
||||
"filename": "auxiliary/pet.pug"
|
||||
}
|
||||
],
|
||||
"line": 1,
|
||||
"filename": "auxiliary/pet.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "class",
|
||||
"val": "'pet'",
|
||||
"mustEscape": false
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 1,
|
||||
"filename": "auxiliary/pet.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "auxiliary/pet.pug"
|
||||
}
|
||||
},
|
||||
"line": 2,
|
||||
"filename": "include.script.pug",
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 2,
|
||||
"filename": "include.script.pug"
|
||||
}
|
||||
}
|
||||
],
|
||||
"line": 1,
|
||||
"filename": "include.script.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "id",
|
||||
"val": "'pet-template'",
|
||||
"mustEscape": false
|
||||
},
|
||||
{
|
||||
"name": "type",
|
||||
"val": "'text/x-template'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 1,
|
||||
"filename": "include.script.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "include.script.pug"
|
||||
}
|
||||
@@ -0,0 +1,260 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Include",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 2,
|
||||
"filename": "include.yield.nested.pug",
|
||||
"path": "auxiliary/yield-nested.pug",
|
||||
"fullPath": "auxiliary/yield-nested.pug",
|
||||
"str": "html\n head\n title\n body\n h1 Page\n #content\n #content-wrapper\n yield\n #footer\n stuff",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "html",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "head",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "title",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 3,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 3,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
}
|
||||
],
|
||||
"line": 2,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 2,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "body",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "h1",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "Page",
|
||||
"line": 5,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
}
|
||||
],
|
||||
"line": 5,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "div",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "div",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "YieldBlock",
|
||||
"line": 8,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
}
|
||||
],
|
||||
"line": 7,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "id",
|
||||
"val": "'content-wrapper'",
|
||||
"mustEscape": false
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 7,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
}
|
||||
],
|
||||
"line": 6,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "id",
|
||||
"val": "'content'",
|
||||
"mustEscape": false
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 6,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "div",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "stuff",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 10,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 10,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
}
|
||||
],
|
||||
"line": 9,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "id",
|
||||
"val": "'footer'",
|
||||
"mustEscape": false
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 9,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
}
|
||||
],
|
||||
"line": 4,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 4,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
}
|
||||
],
|
||||
"line": 1,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 1,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "auxiliary/yield-nested.pug"
|
||||
}
|
||||
},
|
||||
"line": 2,
|
||||
"filename": "include.yield.nested.pug",
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "p",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "some content",
|
||||
"line": 3,
|
||||
"filename": "include.yield.nested.pug"
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "include.yield.nested.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 3,
|
||||
"filename": "include.yield.nested.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "p",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "and some more",
|
||||
"line": 4,
|
||||
"filename": "include.yield.nested.pug"
|
||||
}
|
||||
],
|
||||
"line": 4,
|
||||
"filename": "include.yield.nested.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 4,
|
||||
"filename": "include.yield.nested.pug"
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "include.yield.nested.pug"
|
||||
}
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "include.yield.nested.pug"
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "pre",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "code",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "RawInclude",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 3,
|
||||
"filename": "includes-with-ext-js.pug",
|
||||
"path": "javascript-new-lines.js",
|
||||
"fullPath": "javascript-new-lines.js",
|
||||
"str": "var x = \"\\n here is some \\n new lined text\";\n"
|
||||
},
|
||||
"line": 3,
|
||||
"filename": "includes-with-ext-js.pug",
|
||||
"filters": []
|
||||
}
|
||||
],
|
||||
"line": 2,
|
||||
"filename": "includes-with-ext-js.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": true,
|
||||
"line": 2,
|
||||
"filename": "includes-with-ext-js.pug"
|
||||
}
|
||||
],
|
||||
"line": 1,
|
||||
"filename": "includes-with-ext-js.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 1,
|
||||
"filename": "includes-with-ext-js.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "includes-with-ext-js.pug"
|
||||
}
|
||||
172
tests/sample_data/pug-linker/test/cases/includes.input.json
Normal file
172
tests/sample_data/pug-linker/test/cases/includes.input.json
Normal file
@@ -0,0 +1,172 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Include",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 2,
|
||||
"filename": "includes.pug",
|
||||
"path": "auxiliary/mixins.pug",
|
||||
"fullPath": "auxiliary/mixins.pug",
|
||||
"str": "\nmixin foo()\n p bar",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Mixin",
|
||||
"name": "foo",
|
||||
"args": null,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "p",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "bar",
|
||||
"line": 3,
|
||||
"filename": "auxiliary/mixins.pug"
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "auxiliary/mixins.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 3,
|
||||
"filename": "auxiliary/mixins.pug"
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "auxiliary/mixins.pug"
|
||||
},
|
||||
"call": false,
|
||||
"line": 2,
|
||||
"filename": "auxiliary/mixins.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "auxiliary/mixins.pug"
|
||||
}
|
||||
},
|
||||
"line": 2,
|
||||
"filename": "includes.pug",
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 2,
|
||||
"filename": "includes.pug"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Mixin",
|
||||
"name": "foo",
|
||||
"args": null,
|
||||
"block": null,
|
||||
"call": true,
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"line": 4,
|
||||
"filename": "includes.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "body",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "RawInclude",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 7,
|
||||
"filename": "includes.pug",
|
||||
"path": "auxiliary/smile.html",
|
||||
"fullPath": "auxiliary/smile.html",
|
||||
"str": "<p>:)</p>\n"
|
||||
},
|
||||
"line": 7,
|
||||
"filename": "includes.pug",
|
||||
"filters": []
|
||||
},
|
||||
{
|
||||
"type": "RawInclude",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 8,
|
||||
"filename": "includes.pug",
|
||||
"path": "auxiliary/escapes.html",
|
||||
"fullPath": "auxiliary/escapes.html",
|
||||
"str": "<script>\n console.log(\"foo\\nbar\")\n</script>\n"
|
||||
},
|
||||
"line": 8,
|
||||
"filename": "includes.pug",
|
||||
"filters": []
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "RawInclude",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"line": 10,
|
||||
"filename": "includes.pug",
|
||||
"path": "auxiliary/includable.js",
|
||||
"fullPath": "auxiliary/includable.js",
|
||||
"str": "var STRING_SUBSTITUTIONS = { // table of character substitutions\n '\\t': '\\\\t',\n '\\r': '\\\\r',\n '\\n': '\\\\n',\n '\"' : '\\\\\"',\n '\\\\': '\\\\\\\\'\n};"
|
||||
},
|
||||
"line": 10,
|
||||
"filename": "includes.pug",
|
||||
"filters": [
|
||||
{
|
||||
"type": "IncludeFilter",
|
||||
"name": "verbatim",
|
||||
"attrs": [],
|
||||
"line": 10,
|
||||
"filename": "includes.pug"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"line": 9,
|
||||
"filename": "includes.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "type",
|
||||
"val": "\"text/javascript\"",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 9,
|
||||
"filename": "includes.pug"
|
||||
}
|
||||
],
|
||||
"line": 6,
|
||||
"filename": "includes.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 6,
|
||||
"filename": "includes.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "includes.pug"
|
||||
}
|
||||
226
tests/sample_data/pug-linker/test/cases/layout.append.input.json
Normal file
226
tests/sample_data/pug-linker/test/cases/layout.append.input.json
Normal file
@@ -0,0 +1,226 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Extends",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"path": "../fixtures/append/app-layout.pug",
|
||||
"line": 2,
|
||||
"filename": "layout.append.pug",
|
||||
"fullPath": "../fixtures/append/app-layout.pug",
|
||||
"str": "\nextends layout\n\nblock append head\n script(src='app.js')",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Extends",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"path": "layout",
|
||||
"line": 2,
|
||||
"filename": "../fixtures/append/app-layout.pug",
|
||||
"fullPath": "../fixtures/append/layout.pug",
|
||||
"str": "\nhtml\n block head\n script(src='vendor/jquery.js')\n script(src='vendor/caustic.js')\n body\n block body",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "html",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 4,
|
||||
"filename": "../fixtures/append/layout.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'vendor/jquery.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 4,
|
||||
"filename": "../fixtures/append/layout.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 5,
|
||||
"filename": "../fixtures/append/layout.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'vendor/caustic.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "../fixtures/append/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "../fixtures/append/layout.pug",
|
||||
"name": "head",
|
||||
"mode": "replace"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "body",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [],
|
||||
"line": 7,
|
||||
"filename": "../fixtures/append/layout.pug",
|
||||
"name": "body",
|
||||
"mode": "replace"
|
||||
}
|
||||
],
|
||||
"line": 6,
|
||||
"filename": "../fixtures/append/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 6,
|
||||
"filename": "../fixtures/append/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 2,
|
||||
"filename": "../fixtures/append/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 2,
|
||||
"filename": "../fixtures/append/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "../fixtures/append/layout.pug"
|
||||
}
|
||||
},
|
||||
"line": 2,
|
||||
"filename": "../fixtures/append/app-layout.pug"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 5,
|
||||
"filename": "../fixtures/append/app-layout.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'app.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "../fixtures/append/app-layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 4,
|
||||
"filename": "../fixtures/append/app-layout.pug",
|
||||
"name": "head",
|
||||
"mode": "append"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "../fixtures/append/app-layout.pug"
|
||||
}
|
||||
},
|
||||
"line": 2,
|
||||
"filename": "layout.append.pug"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 5,
|
||||
"filename": "layout.append.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'foo.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "layout.append.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 6,
|
||||
"filename": "layout.append.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'bar.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 6,
|
||||
"filename": "layout.append.pug"
|
||||
}
|
||||
],
|
||||
"line": 4,
|
||||
"filename": "layout.append.pug",
|
||||
"name": "head",
|
||||
"mode": "append"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "layout.append.pug"
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Extends",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"path": "../fixtures/append-without-block/app-layout.pug",
|
||||
"line": 2,
|
||||
"filename": "layout.append.without-block.pug",
|
||||
"fullPath": "../fixtures/append-without-block/app-layout.pug",
|
||||
"str": "\nextends layout.pug\n\nappend head\n script(src='app.js')\n",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Extends",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"path": "layout.pug",
|
||||
"line": 2,
|
||||
"filename": "../fixtures/append-without-block/app-layout.pug",
|
||||
"fullPath": "../fixtures/append-without-block/layout.pug",
|
||||
"str": "\nhtml\n block head\n script(src='vendor/jquery.js')\n script(src='vendor/caustic.js')\n body\n block body",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "html",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 4,
|
||||
"filename": "../fixtures/append-without-block/layout.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'vendor/jquery.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 4,
|
||||
"filename": "../fixtures/append-without-block/layout.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 5,
|
||||
"filename": "../fixtures/append-without-block/layout.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'vendor/caustic.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "../fixtures/append-without-block/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "../fixtures/append-without-block/layout.pug",
|
||||
"name": "head",
|
||||
"mode": "replace"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "body",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [],
|
||||
"line": 7,
|
||||
"filename": "../fixtures/append-without-block/layout.pug",
|
||||
"name": "body",
|
||||
"mode": "replace"
|
||||
}
|
||||
],
|
||||
"line": 6,
|
||||
"filename": "../fixtures/append-without-block/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 6,
|
||||
"filename": "../fixtures/append-without-block/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 2,
|
||||
"filename": "../fixtures/append-without-block/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 2,
|
||||
"filename": "../fixtures/append-without-block/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "../fixtures/append-without-block/layout.pug"
|
||||
}
|
||||
},
|
||||
"line": 2,
|
||||
"filename": "../fixtures/append-without-block/app-layout.pug"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 5,
|
||||
"filename": "../fixtures/append-without-block/app-layout.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'app.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "../fixtures/append-without-block/app-layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 4,
|
||||
"filename": "../fixtures/append-without-block/app-layout.pug",
|
||||
"name": "head",
|
||||
"mode": "append"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "../fixtures/append-without-block/app-layout.pug"
|
||||
}
|
||||
},
|
||||
"line": 2,
|
||||
"filename": "layout.append.without-block.pug"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 5,
|
||||
"filename": "layout.append.without-block.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'foo.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "layout.append.without-block.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 6,
|
||||
"filename": "layout.append.without-block.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'bar.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 6,
|
||||
"filename": "layout.append.without-block.pug"
|
||||
}
|
||||
],
|
||||
"line": 4,
|
||||
"filename": "layout.append.without-block.pug",
|
||||
"name": "head",
|
||||
"mode": "append"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "layout.append.without-block.pug"
|
||||
}
|
||||
@@ -0,0 +1,365 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Extends",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"path": "../fixtures/multi-append-prepend-block/redefine.pug",
|
||||
"line": 1,
|
||||
"filename": "layout.multi.append.prepend.block.pug",
|
||||
"fullPath": "../fixtures/multi-append-prepend-block/redefine.pug",
|
||||
"str": "extends root.pug\n\nblock content\n\t.content\n\t\t| Defined content\n",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Extends",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"path": "root.pug",
|
||||
"line": 1,
|
||||
"filename": "../fixtures/multi-append-prepend-block/redefine.pug",
|
||||
"fullPath": "../fixtures/multi-append-prepend-block/root.pug",
|
||||
"str": "block content\n\t| default content\n\nblock head\n\tscript(src='/app.js')",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "default content",
|
||||
"line": 2,
|
||||
"filename": "../fixtures/multi-append-prepend-block/root.pug"
|
||||
}
|
||||
],
|
||||
"line": 1,
|
||||
"filename": "../fixtures/multi-append-prepend-block/root.pug",
|
||||
"name": "content",
|
||||
"mode": "replace"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 5,
|
||||
"filename": "../fixtures/multi-append-prepend-block/root.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'/app.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "../fixtures/multi-append-prepend-block/root.pug"
|
||||
}
|
||||
],
|
||||
"line": 4,
|
||||
"filename": "../fixtures/multi-append-prepend-block/root.pug",
|
||||
"name": "head",
|
||||
"mode": "replace"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "../fixtures/multi-append-prepend-block/root.pug"
|
||||
}
|
||||
},
|
||||
"line": 1,
|
||||
"filename": "../fixtures/multi-append-prepend-block/redefine.pug"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "div",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "Defined content",
|
||||
"line": 5,
|
||||
"filename": "../fixtures/multi-append-prepend-block/redefine.pug"
|
||||
}
|
||||
],
|
||||
"line": 4,
|
||||
"filename": "../fixtures/multi-append-prepend-block/redefine.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "class",
|
||||
"val": "'content'",
|
||||
"mustEscape": false
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 4,
|
||||
"filename": "../fixtures/multi-append-prepend-block/redefine.pug"
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "../fixtures/multi-append-prepend-block/redefine.pug",
|
||||
"name": "content",
|
||||
"mode": "replace"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "../fixtures/multi-append-prepend-block/redefine.pug"
|
||||
}
|
||||
},
|
||||
"line": 1,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "p",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "Something appended to content",
|
||||
"line": 4,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
}
|
||||
],
|
||||
"line": 4,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "class",
|
||||
"val": "'first'",
|
||||
"mustEscape": false
|
||||
},
|
||||
{
|
||||
"name": "class",
|
||||
"val": "'append'",
|
||||
"mustEscape": false
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 4,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "layout.multi.append.prepend.block.pug",
|
||||
"name": "content",
|
||||
"mode": "append"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "p",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "Something prepended to content",
|
||||
"line": 7,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
}
|
||||
],
|
||||
"line": 7,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "class",
|
||||
"val": "'first'",
|
||||
"mustEscape": false
|
||||
},
|
||||
{
|
||||
"name": "class",
|
||||
"val": "'prepend'",
|
||||
"mustEscape": false
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 7,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
}
|
||||
],
|
||||
"line": 6,
|
||||
"filename": "layout.multi.append.prepend.block.pug",
|
||||
"name": "content",
|
||||
"mode": "prepend"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "p",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "Last append must be most last",
|
||||
"line": 10,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
}
|
||||
],
|
||||
"line": 10,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "class",
|
||||
"val": "'last'",
|
||||
"mustEscape": false
|
||||
},
|
||||
{
|
||||
"name": "class",
|
||||
"val": "'append'",
|
||||
"mustEscape": false
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 10,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
}
|
||||
],
|
||||
"line": 9,
|
||||
"filename": "layout.multi.append.prepend.block.pug",
|
||||
"name": "content",
|
||||
"mode": "append"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "p",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Text",
|
||||
"val": "Last prepend must appear at top",
|
||||
"line": 13,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
}
|
||||
],
|
||||
"line": 13,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "class",
|
||||
"val": "'last'",
|
||||
"mustEscape": false
|
||||
},
|
||||
{
|
||||
"name": "class",
|
||||
"val": "'prepend'",
|
||||
"mustEscape": false
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 13,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
}
|
||||
],
|
||||
"line": 12,
|
||||
"filename": "layout.multi.append.prepend.block.pug",
|
||||
"name": "content",
|
||||
"mode": "prepend"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 16,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'jquery.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 16,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
}
|
||||
],
|
||||
"line": 15,
|
||||
"filename": "layout.multi.append.prepend.block.pug",
|
||||
"name": "head",
|
||||
"mode": "append"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 19,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'foo.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 19,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
}
|
||||
],
|
||||
"line": 18,
|
||||
"filename": "layout.multi.append.prepend.block.pug",
|
||||
"name": "head",
|
||||
"mode": "prepend"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "layout.multi.append.prepend.block.pug"
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Extends",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"path": "../fixtures/prepend/app-layout.pug",
|
||||
"line": 2,
|
||||
"filename": "layout.prepend.pug",
|
||||
"fullPath": "../fixtures/prepend/app-layout.pug",
|
||||
"str": "\nextends layout.pug\n\nblock prepend head\n script(src='app.js')\n",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Extends",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"path": "layout.pug",
|
||||
"line": 2,
|
||||
"filename": "../fixtures/prepend/app-layout.pug",
|
||||
"fullPath": "../fixtures/prepend/layout.pug",
|
||||
"str": "\nhtml\n block head\n script(src='vendor/jquery.js')\n script(src='vendor/caustic.js')\n body\n block body",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "html",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 4,
|
||||
"filename": "../fixtures/prepend/layout.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'vendor/jquery.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 4,
|
||||
"filename": "../fixtures/prepend/layout.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 5,
|
||||
"filename": "../fixtures/prepend/layout.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'vendor/caustic.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "../fixtures/prepend/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "../fixtures/prepend/layout.pug",
|
||||
"name": "head",
|
||||
"mode": "replace"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "body",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [],
|
||||
"line": 7,
|
||||
"filename": "../fixtures/prepend/layout.pug",
|
||||
"name": "body",
|
||||
"mode": "replace"
|
||||
}
|
||||
],
|
||||
"line": 6,
|
||||
"filename": "../fixtures/prepend/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 6,
|
||||
"filename": "../fixtures/prepend/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 2,
|
||||
"filename": "../fixtures/prepend/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 2,
|
||||
"filename": "../fixtures/prepend/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "../fixtures/prepend/layout.pug"
|
||||
}
|
||||
},
|
||||
"line": 2,
|
||||
"filename": "../fixtures/prepend/app-layout.pug"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 5,
|
||||
"filename": "../fixtures/prepend/app-layout.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'app.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "../fixtures/prepend/app-layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 4,
|
||||
"filename": "../fixtures/prepend/app-layout.pug",
|
||||
"name": "head",
|
||||
"mode": "prepend"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "../fixtures/prepend/app-layout.pug"
|
||||
}
|
||||
},
|
||||
"line": 2,
|
||||
"filename": "layout.prepend.pug"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 5,
|
||||
"filename": "layout.prepend.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'foo.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "layout.prepend.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 6,
|
||||
"filename": "layout.prepend.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'bar.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 6,
|
||||
"filename": "layout.prepend.pug"
|
||||
}
|
||||
],
|
||||
"line": 4,
|
||||
"filename": "layout.prepend.pug",
|
||||
"name": "head",
|
||||
"mode": "prepend"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "layout.prepend.pug"
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Extends",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"path": "../fixtures/prepend-without-block/app-layout.pug",
|
||||
"line": 2,
|
||||
"filename": "layout.prepend.without-block.pug",
|
||||
"fullPath": "../fixtures/prepend-without-block/app-layout.pug",
|
||||
"str": "\nextends layout.pug\n\nprepend head\n script(src='app.js')\n",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Extends",
|
||||
"file": {
|
||||
"type": "FileReference",
|
||||
"path": "layout.pug",
|
||||
"line": 2,
|
||||
"filename": "../fixtures/prepend-without-block/app-layout.pug",
|
||||
"fullPath": "../fixtures/prepend-without-block/layout.pug",
|
||||
"str": "\nhtml\n block head\n script(src='vendor/jquery.js')\n script(src='vendor/caustic.js')\n body\n block body",
|
||||
"ast": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "html",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 4,
|
||||
"filename": "../fixtures/prepend-without-block/layout.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'vendor/jquery.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 4,
|
||||
"filename": "../fixtures/prepend-without-block/layout.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 5,
|
||||
"filename": "../fixtures/prepend-without-block/layout.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'vendor/caustic.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "../fixtures/prepend-without-block/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 3,
|
||||
"filename": "../fixtures/prepend-without-block/layout.pug",
|
||||
"name": "head",
|
||||
"mode": "replace"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "body",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [],
|
||||
"line": 7,
|
||||
"filename": "../fixtures/prepend-without-block/layout.pug",
|
||||
"name": "body",
|
||||
"mode": "replace"
|
||||
}
|
||||
],
|
||||
"line": 6,
|
||||
"filename": "../fixtures/prepend-without-block/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 6,
|
||||
"filename": "../fixtures/prepend-without-block/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 2,
|
||||
"filename": "../fixtures/prepend-without-block/layout.pug"
|
||||
},
|
||||
"attrs": [],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 2,
|
||||
"filename": "../fixtures/prepend-without-block/layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "../fixtures/prepend-without-block/layout.pug"
|
||||
}
|
||||
},
|
||||
"line": 2,
|
||||
"filename": "../fixtures/prepend-without-block/app-layout.pug"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 5,
|
||||
"filename": "../fixtures/prepend-without-block/app-layout.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'app.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "../fixtures/prepend-without-block/app-layout.pug"
|
||||
}
|
||||
],
|
||||
"line": 4,
|
||||
"filename": "../fixtures/prepend-without-block/app-layout.pug",
|
||||
"name": "head",
|
||||
"mode": "prepend"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "../fixtures/prepend-without-block/app-layout.pug"
|
||||
}
|
||||
},
|
||||
"line": 2,
|
||||
"filename": "layout.prepend.without-block.pug"
|
||||
},
|
||||
{
|
||||
"type": "NamedBlock",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 5,
|
||||
"filename": "layout.prepend.without-block.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'foo.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 5,
|
||||
"filename": "layout.prepend.without-block.pug"
|
||||
},
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "script",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 6,
|
||||
"filename": "layout.prepend.without-block.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "src",
|
||||
"val": "'bar.js'",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 6,
|
||||
"filename": "layout.prepend.without-block.pug"
|
||||
}
|
||||
],
|
||||
"line": 4,
|
||||
"filename": "layout.prepend.without-block.pug",
|
||||
"name": "head",
|
||||
"mode": "prepend"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "layout.prepend.without-block.pug"
|
||||
}
|
||||
Reference in New Issue
Block a user