pixsy/node_modules/pug-lexer/test/__snapshots__/index.test.js.snap

18711 lines
271 KiB
Plaintext

exports[`test attr-es2015.pug 1`] = `
Array [
Object {
"buffer": false,
"col": 1,
"line": 1,
"mustEscape": false,
"type": "code",
"val": "var avatar = \'219b77f9d21de75e81851b6b886057c7\'",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "div",
},
Object {
"col": 4,
"line": 3,
"type": "class",
"val": "avatar-div",
},
Object {
"col": 15,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 16,
"line": 3,
"mustEscape": true,
"name": "style",
"type": "attribute",
"val": "\`background-image: url(https://www.gravatar.com/avatar/\${avatar})\`",
},
Object {
"col": 88,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"type": "eos",
},
]
`;
exports[`test attribute-invalid-expression.pug 1`] = `
Object {
"code": "PUG:SYNTAX_ERROR",
"column": 5,
"line": 2,
"msg": "Syntax Error: Unterminated string constant",
}
`;
exports[`test attrs.js.pug 1`] = `
Array [
Object {
"buffer": false,
"col": 1,
"line": 1,
"mustEscape": false,
"type": "code",
"val": "var id = 5",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 2,
"mustEscape": false,
"type": "code",
"val": "function answer() { return 42; }",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 3,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'/user/\' + id",
},
Object {
"col": 23,
"line": 3,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\'button\'",
},
Object {
"col": 37,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 4,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'/user/\' + id",
},
Object {
"col": 27,
"line": 4,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\'button\'",
},
Object {
"col": 45,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 1,
"line": 5,
"type": "tag",
"val": "meta",
},
Object {
"col": 5,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 6,
"line": 5,
"mustEscape": true,
"name": "key",
"type": "attribute",
"val": "\'answer\'",
},
Object {
"col": 20,
"line": 5,
"mustEscape": true,
"name": "value",
"type": "attribute",
"val": "answer()",
},
Object {
"col": 34,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 1,
"line": 6,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 6,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "[\'class1\', \'class2\']",
},
Object {
"col": 31,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 1,
"line": 7,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 7,
"type": "class",
"val": "tag-class",
},
Object {
"col": 12,
"line": 7,
"type": "start-attributes",
},
Object {
"col": 13,
"line": 7,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "[\'class1\', \'class2\']",
},
Object {
"col": 41,
"line": 7,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 1,
"line": 9,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 9,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 9,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'/user/\' + id",
},
Object {
"col": 22,
"line": 9,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\'button\'",
},
Object {
"col": 36,
"line": 9,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 10,
"type": "newline",
},
Object {
"col": 1,
"line": 10,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 10,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 10,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'/user/\' + id",
},
Object {
"col": 26,
"line": 10,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\'button\'",
},
Object {
"col": 44,
"line": 10,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 11,
"type": "newline",
},
Object {
"col": 1,
"line": 11,
"type": "tag",
"val": "meta",
},
Object {
"col": 5,
"line": 11,
"type": "start-attributes",
},
Object {
"col": 6,
"line": 11,
"mustEscape": true,
"name": "key",
"type": "attribute",
"val": "\'answer\'",
},
Object {
"col": 19,
"line": 11,
"mustEscape": true,
"name": "value",
"type": "attribute",
"val": "answer()",
},
Object {
"col": 33,
"line": 11,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 12,
"type": "newline",
},
Object {
"col": 1,
"line": 12,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 12,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 12,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "[\'class1\', \'class2\']",
},
Object {
"col": 31,
"line": 12,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 13,
"type": "newline",
},
Object {
"col": 1,
"line": 13,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 13,
"type": "class",
"val": "tag-class",
},
Object {
"col": 12,
"line": 13,
"type": "start-attributes",
},
Object {
"col": 13,
"line": 13,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "[\'class1\', \'class2\']",
},
Object {
"col": 41,
"line": 13,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 15,
"type": "newline",
},
Object {
"col": 1,
"line": 15,
"type": "tag",
"val": "div",
},
Object {
"col": 4,
"line": 15,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 15,
"mustEscape": true,
"name": "id",
"type": "attribute",
"val": "id",
},
Object {
"col": 10,
"line": 15,
"type": "end-attributes",
},
Object {
"col": 11,
"line": 15,
"type": "&attributes",
"val": "{foo: \'bar\'}",
},
Object {
"col": 1,
"line": 16,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 16,
"mustEscape": false,
"type": "code",
"val": "var bar = null",
},
Object {
"col": 1,
"line": 17,
"type": "newline",
},
Object {
"col": 1,
"line": 17,
"type": "tag",
"val": "div",
},
Object {
"col": 4,
"line": 17,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 17,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": "null",
},
Object {
"col": 14,
"line": 17,
"mustEscape": true,
"name": "bar",
"type": "attribute",
"val": "bar",
},
Object {
"col": 21,
"line": 17,
"type": "end-attributes",
},
Object {
"col": 22,
"line": 17,
"type": "&attributes",
"val": "{baz: \'baz\'}",
},
Object {
"col": 1,
"line": 18,
"type": "newline",
},
Object {
"col": 1,
"line": 18,
"type": "eos",
},
]
`;
exports[`test attrs.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 1,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 1,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'/contact\'",
},
Object {
"col": 18,
"line": 1,
"type": "end-attributes",
},
Object {
"col": 20,
"line": 1,
"type": "text",
"val": "contact",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 2,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'/save\'",
},
Object {
"col": 15,
"line": 2,
"type": "end-attributes",
},
Object {
"col": 16,
"line": 2,
"type": "class",
"val": "button",
},
Object {
"col": 24,
"line": 2,
"type": "text",
"val": "save",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 3,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": true,
},
Object {
"col": 8,
"line": 3,
"mustEscape": false,
"name": "bar",
"type": "attribute",
"val": true,
},
Object {
"col": 13,
"line": 3,
"mustEscape": false,
"name": "baz",
"type": "attribute",
"val": true,
},
Object {
"col": 16,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 4,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": "\'foo, bar, baz\'",
},
Object {
"col": 24,
"line": 4,
"mustEscape": true,
"name": "bar",
"type": "attribute",
"val": "1",
},
Object {
"col": 29,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 1,
"line": 5,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 5,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": "\'((foo))\'",
},
Object {
"col": 18,
"line": 5,
"mustEscape": true,
"name": "bar",
"type": "attribute",
"val": "(1) ? 1 : 0",
},
Object {
"col": 35,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 1,
"line": 6,
"type": "tag",
"val": "select",
},
Object {
"col": 1,
"line": 7,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 7,
"type": "tag",
"val": "option",
},
Object {
"col": 9,
"line": 7,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 7,
"mustEscape": true,
"name": "value",
"type": "attribute",
"val": "\'foo\'",
},
Object {
"col": 23,
"line": 7,
"mustEscape": false,
"name": "selected",
"type": "attribute",
"val": true,
},
Object {
"col": 31,
"line": 7,
"type": "end-attributes",
},
Object {
"col": 33,
"line": 7,
"type": "text",
"val": "Foo",
},
Object {
"col": 1,
"line": 8,
"type": "newline",
},
Object {
"col": 3,
"line": 8,
"type": "tag",
"val": "option",
},
Object {
"col": 9,
"line": 8,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 8,
"mustEscape": true,
"name": "selected",
"type": "attribute",
"val": true,
},
Object {
"col": 20,
"line": 8,
"mustEscape": true,
"name": "value",
"type": "attribute",
"val": "\'bar\'",
},
Object {
"col": 31,
"line": 8,
"type": "end-attributes",
},
Object {
"col": 33,
"line": 8,
"type": "text",
"val": "Bar",
},
Object {
"col": 1,
"line": 9,
"type": "outdent",
},
Object {
"col": 1,
"line": 9,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 9,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 9,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": "\"class:\"",
},
Object {
"col": 15,
"line": 9,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 10,
"type": "newline",
},
Object {
"col": 1,
"line": 10,
"type": "tag",
"val": "input",
},
Object {
"col": 6,
"line": 10,
"type": "start-attributes",
},
Object {
"col": 7,
"line": 10,
"mustEscape": true,
"name": "pattern",
"type": "attribute",
"val": "\'\\\\S+\'",
},
Object {
"col": 21,
"line": 10,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 12,
"type": "newline",
},
Object {
"col": 1,
"line": 12,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 12,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 12,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'/contact\'",
},
Object {
"col": 18,
"line": 12,
"type": "end-attributes",
},
Object {
"col": 20,
"line": 12,
"type": "text",
"val": "contact",
},
Object {
"col": 1,
"line": 13,
"type": "newline",
},
Object {
"col": 1,
"line": 13,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 13,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 13,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'/save\'",
},
Object {
"col": 15,
"line": 13,
"type": "end-attributes",
},
Object {
"col": 16,
"line": 13,
"type": "class",
"val": "button",
},
Object {
"col": 24,
"line": 13,
"type": "text",
"val": "save",
},
Object {
"col": 1,
"line": 14,
"type": "newline",
},
Object {
"col": 1,
"line": 14,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 14,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 14,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": true,
},
Object {
"col": 7,
"line": 14,
"mustEscape": false,
"name": "bar",
"type": "attribute",
"val": true,
},
Object {
"col": 11,
"line": 14,
"mustEscape": false,
"name": "baz",
"type": "attribute",
"val": true,
},
Object {
"col": 14,
"line": 14,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 15,
"type": "newline",
},
Object {
"col": 1,
"line": 15,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 15,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 15,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": "\'foo, bar, baz\'",
},
Object {
"col": 23,
"line": 15,
"mustEscape": true,
"name": "bar",
"type": "attribute",
"val": "1",
},
Object {
"col": 28,
"line": 15,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 16,
"type": "newline",
},
Object {
"col": 1,
"line": 16,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 16,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 16,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": "\'((foo))\'",
},
Object {
"col": 17,
"line": 16,
"mustEscape": true,
"name": "bar",
"type": "attribute",
"val": "(1) ? 1 : 0",
},
Object {
"col": 34,
"line": 16,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 17,
"type": "newline",
},
Object {
"col": 1,
"line": 17,
"type": "tag",
"val": "select",
},
Object {
"col": 1,
"line": 18,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 18,
"type": "tag",
"val": "option",
},
Object {
"col": 9,
"line": 18,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 18,
"mustEscape": true,
"name": "value",
"type": "attribute",
"val": "\'foo\'",
},
Object {
"col": 22,
"line": 18,
"mustEscape": false,
"name": "selected",
"type": "attribute",
"val": true,
},
Object {
"col": 30,
"line": 18,
"type": "end-attributes",
},
Object {
"col": 32,
"line": 18,
"type": "text",
"val": "Foo",
},
Object {
"col": 1,
"line": 19,
"type": "newline",
},
Object {
"col": 3,
"line": 19,
"type": "tag",
"val": "option",
},
Object {
"col": 9,
"line": 19,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 19,
"mustEscape": true,
"name": "selected",
"type": "attribute",
"val": true,
},
Object {
"col": 19,
"line": 19,
"mustEscape": true,
"name": "value",
"type": "attribute",
"val": "\'bar\'",
},
Object {
"col": 30,
"line": 19,
"type": "end-attributes",
},
Object {
"col": 32,
"line": 19,
"type": "text",
"val": "Bar",
},
Object {
"col": 1,
"line": 20,
"type": "outdent",
},
Object {
"col": 1,
"line": 20,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 20,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 20,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": "\"class:\"",
},
Object {
"col": 15,
"line": 20,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 21,
"type": "newline",
},
Object {
"col": 1,
"line": 21,
"type": "tag",
"val": "input",
},
Object {
"col": 6,
"line": 21,
"type": "start-attributes",
},
Object {
"col": 7,
"line": 21,
"mustEscape": true,
"name": "pattern",
"type": "attribute",
"val": "\'\\\\S+\'",
},
Object {
"col": 21,
"line": 21,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 22,
"type": "newline",
},
Object {
"col": 1,
"line": 22,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 22,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 22,
"mustEscape": true,
"name": "terse",
"type": "attribute",
"val": "\"true\"",
},
Object {
"col": 17,
"line": 22,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 23,
"type": "newline",
},
Object {
"col": 1,
"line": 23,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 23,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 23,
"mustEscape": true,
"name": "date",
"type": "attribute",
"val": "new Date(0)",
},
Object {
"col": 21,
"line": 23,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 25,
"type": "newline",
},
Object {
"col": 1,
"line": 25,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 25,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 25,
"mustEscape": true,
"name": "abc",
"type": "attribute",
"val": true,
},
Object {
"col": 5,
"line": 26,
"mustEscape": false,
"name": "def",
"type": "attribute",
"val": true,
},
Object {
"col": 8,
"line": 26,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 27,
"type": "newline",
},
Object {
"col": 1,
"line": 27,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 27,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 27,
"mustEscape": true,
"name": "abc",
"type": "attribute",
"val": true,
},
Object {
"col": 5,
"line": 28,
"mustEscape": false,
"name": "def",
"type": "attribute",
"val": true,
},
Object {
"col": 8,
"line": 28,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 29,
"type": "newline",
},
Object {
"col": 1,
"line": 29,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 29,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 29,
"mustEscape": true,
"name": "abc",
"type": "attribute",
"val": true,
},
Object {
"col": 3,
"line": 30,
"mustEscape": false,
"name": "def",
"type": "attribute",
"val": true,
},
Object {
"col": 6,
"line": 30,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 31,
"type": "newline",
},
Object {
"col": 1,
"line": 31,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 31,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 31,
"mustEscape": true,
"name": "abc",
"type": "attribute",
"val": true,
},
Object {
"col": 4,
"line": 32,
"mustEscape": false,
"name": "def",
"type": "attribute",
"val": true,
},
Object {
"col": 7,
"line": 32,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 33,
"type": "newline",
},
Object {
"col": 1,
"line": 33,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 33,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 33,
"mustEscape": true,
"name": "abc",
"type": "attribute",
"val": true,
},
Object {
"col": 3,
"line": 34,
"mustEscape": false,
"name": "def",
"type": "attribute",
"val": true,
},
Object {
"col": 6,
"line": 34,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 35,
"type": "newline",
},
Object {
"col": 1,
"line": 35,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 35,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 35,
"mustEscape": true,
"name": "abc",
"type": "attribute",
"val": true,
},
Object {
"col": 5,
"line": 36,
"mustEscape": false,
"name": "def",
"type": "attribute",
"val": true,
},
Object {
"col": 8,
"line": 36,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 38,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 38,
"mustEscape": false,
"type": "code",
"val": "var attrs = {foo: \'bar\', bar: \'<baz>\'}",
},
Object {
"col": 1,
"line": 40,
"type": "newline",
},
Object {
"col": 1,
"line": 40,
"type": "tag",
"val": "div",
},
Object {
"col": 4,
"line": 40,
"type": "&attributes",
"val": "attrs",
},
Object {
"col": 1,
"line": 42,
"type": "newline",
},
Object {
"col": 1,
"line": 42,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 42,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 42,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": "\'foo\'",
},
Object {
"col": 14,
"line": 42,
"mustEscape": true,
"name": "bar",
"type": "attribute",
"val": "\"bar\"",
},
Object {
"col": 24,
"line": 42,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 43,
"type": "newline",
},
Object {
"col": 1,
"line": 43,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 43,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 43,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": "\'foo\'",
},
Object {
"col": 14,
"line": 43,
"mustEscape": true,
"name": "bar",
"type": "attribute",
"val": "\'bar\'",
},
Object {
"col": 24,
"line": 43,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 44,
"type": "newline",
},
Object {
"col": 1,
"line": 44,
"type": "eos",
},
]
`;
exports[`test attrs.unescaped.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "script",
},
Object {
"col": 7,
"line": 1,
"type": "start-attributes",
},
Object {
"col": 8,
"line": 1,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'text/x-template\'",
},
Object {
"col": 30,
"line": 1,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "div",
},
Object {
"col": 6,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 7,
"line": 2,
"mustEscape": false,
"name": "id",
"type": "attribute",
"val": "\'user-<%= user.id %>\'",
},
Object {
"col": 32,
"line": 2,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "tag",
"val": "h1",
},
Object {
"col": 8,
"line": 3,
"type": "text",
"val": "<%= user.title %>",
},
Object {
"col": 25,
"line": 3,
"type": "outdent",
},
Object {
"col": 25,
"line": 3,
"type": "outdent",
},
Object {
"col": 25,
"line": 3,
"type": "eos",
},
]
`;
exports[`test attrs-data.pug 1`] = `
Array [
Object {
"buffer": false,
"col": 1,
"line": 1,
"mustEscape": false,
"type": "code",
"val": "var user = { name: \'tobi\' }",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 2,
"mustEscape": true,
"name": "data-user",
"type": "attribute",
"val": "user",
},
Object {
"col": 19,
"line": 2,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 3,
"mustEscape": true,
"name": "data-items",
"type": "attribute",
"val": "[1,2,3]",
},
Object {
"col": 23,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 4,
"mustEscape": true,
"name": "data-username",
"type": "attribute",
"val": "\'tobi\'",
},
Object {
"col": 25,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 1,
"line": 5,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 5,
"mustEscape": true,
"name": "data-escaped",
"type": "attribute",
"val": "{message: \"Let\'s rock!\"}",
},
Object {
"col": 42,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 1,
"line": 6,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 6,
"mustEscape": true,
"name": "data-ampersand",
"type": "attribute",
"val": "{message: \"a quote: &quot; this & that\"}",
},
Object {
"col": 60,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 1,
"line": 7,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 7,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 7,
"mustEscape": true,
"name": "data-epoc",
"type": "attribute",
"val": "new Date(0)",
},
Object {
"col": 26,
"line": 7,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 8,
"type": "newline",
},
Object {
"col": 1,
"line": 8,
"type": "eos",
},
]
`;
exports[`test basic.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "tag",
"val": "h1",
},
Object {
"col": 8,
"line": 3,
"type": "text",
"val": "Title",
},
Object {
"col": 13,
"line": 3,
"type": "outdent",
},
Object {
"col": 13,
"line": 3,
"type": "outdent",
},
Object {
"col": 13,
"line": 3,
"type": "eos",
},
]
`;
exports[`test blanks.pug 1`] = `
Array [
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 4,
"type": "tag",
"val": "li",
},
Object {
"col": 6,
"line": 4,
"type": "text",
"val": "foo",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 3,
"line": 6,
"type": "tag",
"val": "li",
},
Object {
"col": 6,
"line": 6,
"type": "text",
"val": "bar",
},
Object {
"col": 1,
"line": 8,
"type": "newline",
},
Object {
"col": 3,
"line": 8,
"type": "tag",
"val": "li",
},
Object {
"col": 6,
"line": 8,
"type": "text",
"val": "baz",
},
Object {
"col": 1,
"line": 9,
"type": "outdent",
},
Object {
"col": 1,
"line": 9,
"type": "eos",
},
]
`;
exports[`test block-code.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "blockcode",
},
Object {
"col": 2,
"line": 1,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 2,
"type": "text",
"val": "list = [\"uno\", \"dos\", \"tres\",",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 3,
"line": 3,
"type": "text",
"val": " \"cuatro\", \"cinco\", \"seis\"];",
},
Object {
"col": 38,
"line": 3,
"type": "end-pipeless-text",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 4,
"type": "comment",
"val": " Without a block, the element is accepted and no code is generated",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 1,
"line": 5,
"type": "blockcode",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"code": "list",
"col": 1,
"key": null,
"line": 6,
"type": "each",
"val": "item",
},
Object {
"col": 1,
"line": 7,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 7,
"type": "blockcode",
},
Object {
"col": 4,
"line": 7,
"type": "start-pipeless-text",
},
Object {
"col": 5,
"line": 8,
"type": "text",
"val": "string = item.charAt(0)",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 5,
"line": 9,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 10,
"type": "newline",
},
Object {
"col": 5,
"line": 10,
"type": "text",
"val": " .toUpperCase() +",
},
Object {
"col": 1,
"line": 11,
"type": "newline",
},
Object {
"col": 5,
"line": 11,
"type": "text",
"val": "item.slice(1);",
},
Object {
"col": 19,
"line": 11,
"type": "end-pipeless-text",
},
Object {
"col": 1,
"line": 12,
"type": "newline",
},
Object {
"col": 3,
"line": 12,
"type": "tag",
"val": "li",
},
Object {
"buffer": true,
"col": 5,
"line": 12,
"mustEscape": true,
"type": "code",
"val": "string",
},
Object {
"col": 1,
"line": 13,
"type": "outdent",
},
Object {
"col": 1,
"line": 13,
"type": "eos",
},
]
`;
exports[`test block-expansion.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "li",
},
Object {
"col": 5,
"line": 2,
"type": ":",
},
Object {
"col": 7,
"line": 2,
"type": "tag",
"val": "a",
},
Object {
"col": 8,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 9,
"line": 2,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'#\'",
},
Object {
"col": 17,
"line": 2,
"type": "end-attributes",
},
Object {
"col": 19,
"line": 2,
"type": "text",
"val": "foo",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 3,
"line": 3,
"type": "tag",
"val": "li",
},
Object {
"col": 5,
"line": 3,
"type": ":",
},
Object {
"col": 7,
"line": 3,
"type": "tag",
"val": "a",
},
Object {
"col": 8,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 9,
"line": 3,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'#\'",
},
Object {
"col": 17,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 19,
"line": 3,
"type": "text",
"val": "bar",
},
Object {
"col": 1,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 5,
"type": "text",
"val": "baz",
},
Object {
"col": 6,
"line": 5,
"type": "eos",
},
]
`;
exports[`test block-expansion.shorthands.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "li",
},
Object {
"col": 5,
"line": 2,
"type": "class",
"val": "list-item",
},
Object {
"col": 15,
"line": 2,
"type": ":",
},
Object {
"col": 17,
"line": 2,
"type": "class",
"val": "foo",
},
Object {
"col": 21,
"line": 2,
"type": ":",
},
Object {
"col": 23,
"line": 2,
"type": "id",
"val": "bar",
},
Object {
"col": 28,
"line": 2,
"type": "text",
"val": "baz",
},
Object {
"col": 31,
"line": 2,
"type": "outdent",
},
Object {
"col": 31,
"line": 2,
"type": "eos",
},
]
`;
exports[`test blockquote.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "figure",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "blockquote",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 7,
"line": 3,
"type": "text",
"val": "Try to define yourself by what you do, and you&#8217;ll burnout every time. You are. That is enough. I rest in that.",
},
Object {
"col": 3,
"line": 4,
"type": "outdent",
},
Object {
"col": 3,
"line": 4,
"type": "tag",
"val": "figcaption",
},
Object {
"col": 14,
"line": 4,
"type": "text",
"val": "from @thefray at 1:43pm on May 10",
},
Object {
"col": 47,
"line": 4,
"type": "outdent",
},
Object {
"col": 47,
"line": 4,
"type": "eos",
},
]
`;
exports[`test blocks-in-blocks.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "extends",
},
Object {
"col": 9,
"line": 1,
"type": "path",
"val": "./auxiliary/blocks-in-blocks-layout.pug",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"mode": "replace",
"type": "block",
"val": "body",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 4,
"type": "tag",
"val": "h1",
},
Object {
"col": 6,
"line": 4,
"type": "text",
"val": "Page 2",
},
Object {
"col": 1,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "eos",
},
]
`;
exports[`test blocks-in-if.pug 1`] = `
Array [
Object {
"buffer": false,
"col": 1,
"line": 1,
"type": "comment",
"val": " see https://github.com/pugjs/pug/issues/1589",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 3,
"mustEscape": false,
"type": "code",
"val": "var ajax = true",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 5,
"mustEscape": false,
"type": "code",
"val": "if( ajax )",
},
Object {
"col": 1,
"line": 6,
"type": "indent",
"val": 4,
},
Object {
"buffer": false,
"col": 5,
"line": 6,
"type": "comment",
"val": " return only contents if ajax requests",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 5,
"line": 7,
"mode": "replace",
"type": "block",
"val": "contents",
},
Object {
"col": 1,
"line": 8,
"type": "indent",
"val": 8,
},
Object {
"col": 9,
"line": 8,
"type": "tag",
"val": "p",
},
Object {
"col": 11,
"line": 8,
"type": "text",
"val": "ajax contents",
},
Object {
"col": 5,
"line": 10,
"type": "outdent",
},
Object {
"col": 1,
"line": 10,
"type": "outdent",
},
Object {
"buffer": false,
"col": 1,
"line": 10,
"mustEscape": false,
"type": "code",
"val": "else",
},
Object {
"col": 1,
"line": 11,
"type": "indent",
"val": 4,
},
Object {
"buffer": false,
"col": 5,
"line": 11,
"type": "comment",
"val": " return all html",
},
Object {
"col": 1,
"line": 12,
"type": "newline",
},
Object {
"col": 5,
"line": 12,
"type": "doctype",
"val": "html",
},
Object {
"col": 1,
"line": 13,
"type": "newline",
},
Object {
"col": 5,
"line": 13,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 14,
"type": "indent",
"val": 8,
},
Object {
"col": 9,
"line": 14,
"type": "tag",
"val": "head",
},
Object {
"col": 1,
"line": 15,
"type": "indent",
"val": 12,
},
Object {
"col": 13,
"line": 15,
"type": "tag",
"val": "meta",
},
Object {
"col": 17,
"line": 15,
"type": "start-attributes",
},
Object {
"col": 19,
"line": 15,
"mustEscape": true,
"name": "charset",
"type": "attribute",
"val": "\'utf8\'",
},
Object {
"col": 34,
"line": 15,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 16,
"type": "newline",
},
Object {
"col": 13,
"line": 16,
"type": "tag",
"val": "title",
},
Object {
"col": 19,
"line": 16,
"type": "text",
"val": "sample",
},
Object {
"col": 1,
"line": 17,
"type": "newline",
},
Object {
"col": 13,
"line": 17,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 18,
"type": "indent",
"val": 16,
},
Object {
"col": 17,
"line": 18,
"mode": "replace",
"type": "block",
"val": "contents",
},
Object {
"col": 1,
"line": 19,
"type": "indent",
"val": 20,
},
Object {
"col": 21,
"line": 19,
"type": "tag",
"val": "p",
},
Object {
"col": 23,
"line": 19,
"type": "text",
"val": "all contetns",
},
Object {
"col": 17,
"line": 20,
"type": "outdent",
},
Object {
"col": 13,
"line": 20,
"type": "outdent",
},
Object {
"col": 9,
"line": 20,
"type": "outdent",
},
Object {
"col": 5,
"line": 20,
"type": "outdent",
},
Object {
"col": 1,
"line": 20,
"type": "outdent",
},
Object {
"col": 1,
"line": 20,
"type": "eos",
},
]
`;
exports[`test case.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"buffer": false,
"col": 5,
"line": 3,
"mustEscape": false,
"type": "code",
"val": "var friends = 1",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 5,
"line": 4,
"type": "case",
"val": "friends",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 5,
"type": "when",
"val": "0",
},
Object {
"col": 13,
"line": 5,
"type": ":",
},
Object {
"col": 15,
"line": 5,
"type": "tag",
"val": "p",
},
Object {
"col": 17,
"line": 5,
"type": "text",
"val": "you have no friends",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 7,
"line": 6,
"type": "when",
"val": "1",
},
Object {
"col": 13,
"line": 6,
"type": ":",
},
Object {
"col": 15,
"line": 6,
"type": "tag",
"val": "p",
},
Object {
"col": 17,
"line": 6,
"type": "text",
"val": "you have a friend",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 7,
"line": 7,
"type": "default",
},
Object {
"col": 14,
"line": 7,
"type": ":",
},
Object {
"col": 16,
"line": 7,
"type": "tag",
"val": "p",
},
Object {
"col": 18,
"line": 7,
"type": "text",
"val": "you have ",
},
Object {
"buffer": true,
"col": 27,
"line": 7,
"mustEscape": true,
"type": "interpolated-code",
"val": "friends",
},
Object {
"col": 37,
"line": 7,
"type": "text",
"val": " friends",
},
Object {
"col": 5,
"line": 8,
"type": "outdent",
},
Object {
"buffer": false,
"col": 5,
"line": 8,
"mustEscape": false,
"type": "code",
"val": "var friends = 0",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 5,
"line": 9,
"type": "case",
"val": "friends",
},
Object {
"col": 1,
"line": 10,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 10,
"type": "when",
"val": "0",
},
Object {
"col": 1,
"line": 11,
"type": "newline",
},
Object {
"col": 7,
"line": 11,
"type": "when",
"val": "1",
},
Object {
"col": 1,
"line": 12,
"type": "indent",
"val": 8,
},
Object {
"col": 9,
"line": 12,
"type": "tag",
"val": "p",
},
Object {
"col": 11,
"line": 12,
"type": "text",
"val": "you have very few friends",
},
Object {
"col": 7,
"line": 13,
"type": "outdent",
},
Object {
"col": 7,
"line": 13,
"type": "default",
},
Object {
"col": 1,
"line": 14,
"type": "indent",
"val": 8,
},
Object {
"col": 9,
"line": 14,
"type": "tag",
"val": "p",
},
Object {
"col": 11,
"line": 14,
"type": "text",
"val": "you have ",
},
Object {
"buffer": true,
"col": 20,
"line": 14,
"mustEscape": true,
"type": "interpolated-code",
"val": "friends",
},
Object {
"col": 30,
"line": 14,
"type": "text",
"val": " friends",
},
Object {
"col": 7,
"line": 16,
"type": "outdent",
},
Object {
"col": 5,
"line": 16,
"type": "outdent",
},
Object {
"buffer": false,
"col": 5,
"line": 16,
"mustEscape": false,
"type": "code",
"val": "var friend = \'Tim:G\'",
},
Object {
"col": 1,
"line": 17,
"type": "newline",
},
Object {
"col": 5,
"line": 17,
"type": "case",
"val": "friend",
},
Object {
"col": 1,
"line": 18,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 18,
"type": "when",
"val": "\'Tim:G\'",
},
Object {
"col": 19,
"line": 18,
"type": ":",
},
Object {
"col": 24,
"line": 18,
"type": "tag",
"val": "p",
},
Object {
"col": 26,
"line": 18,
"type": "text",
"val": "Friend is a string",
},
Object {
"col": 1,
"line": 19,
"type": "newline",
},
Object {
"col": 7,
"line": 19,
"type": "when",
"val": "{tim: \'g\'}",
},
Object {
"col": 22,
"line": 19,
"type": ":",
},
Object {
"col": 24,
"line": 19,
"type": "tag",
"val": "p",
},
Object {
"col": 26,
"line": 19,
"type": "text",
"val": "Friend is an object",
},
Object {
"col": 5,
"line": 20,
"type": "outdent",
},
Object {
"col": 3,
"line": 20,
"type": "outdent",
},
Object {
"col": 1,
"line": 20,
"type": "outdent",
},
Object {
"col": 1,
"line": 20,
"type": "eos",
},
]
`;
exports[`test case-blocks.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"buffer": false,
"col": 5,
"line": 3,
"mustEscape": false,
"type": "code",
"val": "var friends = 1",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 5,
"line": 4,
"type": "case",
"val": "friends",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 5,
"type": "when",
"val": "0",
},
Object {
"col": 1,
"line": 6,
"type": "indent",
"val": 8,
},
Object {
"col": 9,
"line": 6,
"type": "tag",
"val": "p",
},
Object {
"col": 11,
"line": 6,
"type": "text",
"val": "you have no friends",
},
Object {
"col": 7,
"line": 7,
"type": "outdent",
},
Object {
"col": 7,
"line": 7,
"type": "when",
"val": "1",
},
Object {
"col": 1,
"line": 8,
"type": "indent",
"val": 8,
},
Object {
"col": 9,
"line": 8,
"type": "tag",
"val": "p",
},
Object {
"col": 11,
"line": 8,
"type": "text",
"val": "you have a friend",
},
Object {
"col": 7,
"line": 9,
"type": "outdent",
},
Object {
"col": 7,
"line": 9,
"type": "default",
},
Object {
"col": 1,
"line": 10,
"type": "indent",
"val": 8,
},
Object {
"col": 9,
"line": 10,
"type": "tag",
"val": "p",
},
Object {
"col": 11,
"line": 10,
"type": "text",
"val": "you have ",
},
Object {
"buffer": true,
"col": 20,
"line": 10,
"mustEscape": true,
"type": "interpolated-code",
"val": "friends",
},
Object {
"col": 30,
"line": 10,
"type": "text",
"val": " friends",
},
Object {
"col": 38,
"line": 10,
"type": "outdent",
},
Object {
"col": 38,
"line": 10,
"type": "outdent",
},
Object {
"col": 38,
"line": 10,
"type": "outdent",
},
Object {
"col": 38,
"line": 10,
"type": "outdent",
},
Object {
"col": 38,
"line": 10,
"type": "eos",
},
]
`;
exports[`test case-with-invalid-expression.pug 1`] = `
Object {
"code": "PUG:SYNTAX_ERROR",
"column": 22,
"line": 1,
"msg": "Syntax Error: Unexpected token",
}
`;
exports[`test case-with-no-expression.pug 1`] = `
Object {
"code": "PUG:NO_CASE_EXPRESSION",
"column": 5,
"line": 1,
"msg": "missing expression for case",
}
`;
exports[`test classes.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 1,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 1,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "[\'foo\', \'bar\', \'baz\']",
},
Object {
"col": 30,
"line": 1,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 1,
"line": 5,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 5,
"type": "class",
"val": "foo",
},
Object {
"col": 6,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 7,
"line": 5,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\'bar\'",
},
Object {
"col": 18,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 19,
"line": 5,
"type": "class",
"val": "baz",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 1,
"line": 9,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 9,
"type": "class",
"val": "foo-bar_baz",
},
Object {
"col": 1,
"line": 11,
"type": "newline",
},
Object {
"col": 1,
"line": 11,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 11,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 11,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "{foo: true, bar: false, baz: true}",
},
Object {
"col": 43,
"line": 11,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 12,
"type": "newline",
},
Object {
"col": 1,
"line": 12,
"type": "eos",
},
]
`;
exports[`test classes-empty.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 1,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 1,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\'\'",
},
Object {
"col": 11,
"line": 1,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 2,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "null",
},
Object {
"col": 13,
"line": 2,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 3,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "undefined",
},
Object {
"col": 18,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 19,
"line": 3,
"type": "eos",
},
]
`;
exports[`test code.conditionals.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 2,
"mustEscape": false,
"type": "code",
"val": "if (true)",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 3,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 3,
"type": "text",
"val": "foo",
},
Object {
"col": 1,
"line": 4,
"type": "outdent",
},
Object {
"buffer": false,
"col": 1,
"line": 4,
"mustEscape": false,
"type": "code",
"val": "else",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 5,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 5,
"type": "text",
"val": "bar",
},
Object {
"col": 1,
"line": 7,
"type": "outdent",
},
Object {
"buffer": false,
"col": 1,
"line": 7,
"mustEscape": false,
"type": "code",
"val": "if (true) {",
},
Object {
"col": 1,
"line": 8,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 8,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 8,
"type": "text",
"val": "foo",
},
Object {
"col": 1,
"line": 9,
"type": "outdent",
},
Object {
"buffer": false,
"col": 1,
"line": 9,
"mustEscape": false,
"type": "code",
"val": "} else {",
},
Object {
"col": 1,
"line": 10,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 10,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 10,
"type": "text",
"val": "bar",
},
Object {
"col": 1,
"line": 11,
"type": "outdent",
},
Object {
"buffer": false,
"col": 1,
"line": 11,
"mustEscape": false,
"type": "code",
"val": "}",
},
Object {
"col": 1,
"line": 13,
"type": "newline",
},
Object {
"col": 1,
"line": 13,
"type": "if",
"val": "true",
},
Object {
"col": 1,
"line": 14,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 14,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 14,
"type": "text",
"val": "foo",
},
Object {
"col": 1,
"line": 15,
"type": "newline",
},
Object {
"col": 3,
"line": 15,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 15,
"type": "text",
"val": "bar",
},
Object {
"col": 1,
"line": 16,
"type": "newline",
},
Object {
"col": 3,
"line": 16,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 16,
"type": "text",
"val": "baz",
},
Object {
"col": 1,
"line": 17,
"type": "outdent",
},
Object {
"col": 1,
"line": 17,
"type": "else",
"val": "",
},
Object {
"col": 1,
"line": 18,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 18,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 18,
"type": "text",
"val": "bar",
},
Object {
"col": 1,
"line": 20,
"type": "outdent",
},
Object {
"col": 1,
"line": 20,
"type": "if",
"val": "!(true)",
},
Object {
"col": 1,
"line": 21,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 21,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 21,
"type": "text",
"val": "foo",
},
Object {
"col": 1,
"line": 22,
"type": "outdent",
},
Object {
"col": 1,
"line": 22,
"type": "else",
"val": "",
},
Object {
"col": 1,
"line": 23,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 23,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 23,
"type": "text",
"val": "bar",
},
Object {
"col": 1,
"line": 25,
"type": "outdent",
},
Object {
"col": 1,
"line": 25,
"type": "if",
"val": "\'nested\'",
},
Object {
"col": 1,
"line": 26,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 26,
"type": "if",
"val": "\'works\'",
},
Object {
"col": 1,
"line": 27,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 27,
"type": "tag",
"val": "p",
},
Object {
"col": 7,
"line": 27,
"type": "text",
"val": "yay",
},
Object {
"col": 3,
"line": 29,
"type": "outdent",
},
Object {
"col": 1,
"line": 29,
"type": "outdent",
},
Object {
"buffer": false,
"col": 1,
"line": 29,
"type": "comment",
"val": " allow empty blocks",
},
Object {
"col": 1,
"line": 30,
"type": "newline",
},
Object {
"col": 1,
"line": 30,
"type": "if",
"val": "false",
},
Object {
"col": 1,
"line": 31,
"type": "newline",
},
Object {
"col": 1,
"line": 31,
"type": "else",
"val": "",
},
Object {
"col": 1,
"line": 32,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 32,
"type": "class",
"val": "bar",
},
Object {
"col": 1,
"line": 33,
"type": "outdent",
},
Object {
"col": 1,
"line": 33,
"type": "if",
"val": "true",
},
Object {
"col": 1,
"line": 34,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 34,
"type": "class",
"val": "bar",
},
Object {
"col": 1,
"line": 35,
"type": "outdent",
},
Object {
"col": 1,
"line": 35,
"type": "else",
"val": "",
},
Object {
"col": 1,
"line": 36,
"type": "newline",
},
Object {
"col": 1,
"line": 36,
"type": "class",
"val": "bing",
},
Object {
"col": 1,
"line": 38,
"type": "newline",
},
Object {
"col": 1,
"line": 38,
"type": "if",
"val": "false",
},
Object {
"col": 1,
"line": 39,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 39,
"type": "class",
"val": "bing",
},
Object {
"col": 1,
"line": 40,
"type": "outdent",
},
Object {
"col": 1,
"line": 40,
"type": "else-if",
"val": "false",
},
Object {
"col": 1,
"line": 41,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 41,
"type": "class",
"val": "bar",
},
Object {
"col": 1,
"line": 42,
"type": "outdent",
},
Object {
"col": 1,
"line": 42,
"type": "else",
"val": "",
},
Object {
"col": 1,
"line": 43,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 43,
"type": "class",
"val": "foo",
},
Object {
"col": 7,
"line": 43,
"type": "outdent",
},
Object {
"col": 7,
"line": 43,
"type": "eos",
},
]
`;
exports[`test code.escape.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "p",
},
Object {
"buffer": true,
"col": 2,
"line": 1,
"mustEscape": true,
"type": "code",
"val": "\'<script>\'",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "p",
},
Object {
"buffer": true,
"col": 2,
"line": 2,
"mustEscape": false,
"type": "code",
"val": "\'<script>\'",
},
Object {
"col": 15,
"line": 2,
"type": "eos",
},
]
`;
exports[`test code.iteration.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 2,
"mustEscape": false,
"type": "code",
"val": "var items = [1,2,3]",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 2,
},
Object {
"buffer": false,
"col": 3,
"line": 5,
"mustEscape": false,
"type": "code",
"val": "items.forEach(function(item){",
},
Object {
"col": 1,
"line": 6,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 6,
"type": "tag",
"val": "li",
},
Object {
"buffer": true,
"col": 7,
"line": 6,
"mustEscape": true,
"type": "code",
"val": "item",
},
Object {
"col": 3,
"line": 7,
"type": "outdent",
},
Object {
"buffer": false,
"col": 3,
"line": 7,
"mustEscape": false,
"type": "code",
"val": "})",
},
Object {
"col": 1,
"line": 9,
"type": "outdent",
},
Object {
"buffer": false,
"col": 1,
"line": 9,
"mustEscape": false,
"type": "code",
"val": "var items = [1,2,3]",
},
Object {
"col": 1,
"line": 11,
"type": "newline",
},
Object {
"col": 1,
"line": 11,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 12,
"type": "indent",
"val": 2,
},
Object {
"code": "items",
"col": 3,
"key": "i",
"line": 12,
"type": "each",
"val": "item",
},
Object {
"col": 1,
"line": 13,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 13,
"type": "tag",
"val": "li",
},
Object {
"col": 7,
"line": 13,
"type": "start-attributes",
},
Object {
"col": 8,
"line": 13,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\'item-\' + i",
},
Object {
"col": 25,
"line": 13,
"type": "end-attributes",
},
Object {
"buffer": true,
"col": 26,
"line": 13,
"mustEscape": true,
"type": "code",
"val": "item",
},
Object {
"col": 3,
"line": 15,
"type": "outdent",
},
Object {
"col": 1,
"line": 15,
"type": "outdent",
},
Object {
"col": 1,
"line": 15,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 16,
"type": "indent",
"val": 2,
},
Object {
"code": "items",
"col": 3,
"key": "i",
"line": 16,
"type": "each",
"val": "item",
},
Object {
"col": 1,
"line": 17,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 17,
"type": "tag",
"val": "li",
},
Object {
"buffer": true,
"col": 7,
"line": 17,
"mustEscape": true,
"type": "code",
"val": "item",
},
Object {
"col": 3,
"line": 19,
"type": "outdent",
},
Object {
"col": 1,
"line": 19,
"type": "outdent",
},
Object {
"col": 1,
"line": 19,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 20,
"type": "indent",
"val": 2,
},
Object {
"code": "items",
"col": 3,
"key": null,
"line": 20,
"type": "each",
"val": "$item",
},
Object {
"col": 1,
"line": 21,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 21,
"type": "tag",
"val": "li",
},
Object {
"buffer": true,
"col": 7,
"line": 21,
"mustEscape": true,
"type": "code",
"val": "$item",
},
Object {
"col": 3,
"line": 23,
"type": "outdent",
},
Object {
"col": 1,
"line": 23,
"type": "outdent",
},
Object {
"buffer": false,
"col": 1,
"line": 23,
"mustEscape": false,
"type": "code",
"val": "var nums = [1, 2, 3]",
},
Object {
"col": 1,
"line": 24,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 24,
"mustEscape": false,
"type": "code",
"val": "var letters = [\'a\', \'b\', \'c\']",
},
Object {
"col": 1,
"line": 26,
"type": "newline",
},
Object {
"col": 1,
"line": 26,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 27,
"type": "indent",
"val": 2,
},
Object {
"code": "letters",
"col": 3,
"key": null,
"line": 27,
"type": "each",
"val": "l",
},
Object {
"col": 1,
"line": 28,
"type": "indent",
"val": 4,
},
Object {
"code": "nums",
"col": 5,
"key": null,
"line": 28,
"type": "each",
"val": "n",
},
Object {
"col": 1,
"line": 29,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 29,
"type": "tag",
"val": "li",
},
Object {
"buffer": true,
"col": 10,
"line": 29,
"mustEscape": true,
"type": "interpolated-code",
"val": "n",
},
Object {
"col": 14,
"line": 29,
"type": "text",
"val": ": ",
},
Object {
"buffer": true,
"col": 16,
"line": 29,
"mustEscape": true,
"type": "interpolated-code",
"val": "l",
},
Object {
"col": 5,
"line": 31,
"type": "outdent",
},
Object {
"col": 3,
"line": 31,
"type": "outdent",
},
Object {
"col": 1,
"line": 31,
"type": "outdent",
},
Object {
"buffer": false,
"col": 1,
"line": 31,
"mustEscape": false,
"type": "code",
"val": "var count = 1",
},
Object {
"col": 1,
"line": 32,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 32,
"mustEscape": false,
"type": "code",
"val": "var counter = function() { return [count++, count++, count++] }",
},
Object {
"col": 1,
"line": 33,
"type": "newline",
},
Object {
"col": 1,
"line": 33,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 34,
"type": "indent",
"val": 2,
},
Object {
"code": "counter()",
"col": 3,
"key": null,
"line": 34,
"type": "each",
"val": "n",
},
Object {
"col": 1,
"line": 35,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 35,
"type": "tag",
"val": "li",
},
Object {
"buffer": true,
"col": 8,
"line": 35,
"mustEscape": true,
"type": "interpolated-code",
"val": "n",
},
Object {
"col": 3,
"line": 36,
"type": "outdent",
},
Object {
"col": 1,
"line": 36,
"type": "outdent",
},
Object {
"col": 1,
"line": 36,
"type": "eos",
},
]
`;
exports[`test code.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "p",
},
Object {
"buffer": true,
"col": 2,
"line": 1,
"mustEscape": true,
"type": "code",
"val": "null",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "p",
},
Object {
"buffer": true,
"col": 2,
"line": 2,
"mustEscape": true,
"type": "code",
"val": "undefined",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "p",
},
Object {
"buffer": true,
"col": 2,
"line": 3,
"mustEscape": true,
"type": "code",
"val": "\'\'",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"type": "tag",
"val": "p",
},
Object {
"buffer": true,
"col": 2,
"line": 4,
"mustEscape": true,
"type": "code",
"val": "0",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 1,
"line": 5,
"type": "tag",
"val": "p",
},
Object {
"buffer": true,
"col": 2,
"line": 5,
"mustEscape": true,
"type": "code",
"val": "false",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 1,
"line": 6,
"type": "tag",
"val": "p",
},
Object {
"col": 2,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 6,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": "null",
},
Object {
"col": 11,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 1,
"line": 7,
"type": "tag",
"val": "p",
},
Object {
"col": 2,
"line": 7,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 7,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": "undefined",
},
Object {
"col": 16,
"line": 7,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 8,
"type": "newline",
},
Object {
"col": 1,
"line": 8,
"type": "tag",
"val": "p",
},
Object {
"col": 2,
"line": 8,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 8,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": "\'\'",
},
Object {
"col": 9,
"line": 8,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 1,
"line": 9,
"type": "tag",
"val": "p",
},
Object {
"col": 2,
"line": 9,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 9,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": "0",
},
Object {
"col": 8,
"line": 9,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 10,
"type": "newline",
},
Object {
"col": 1,
"line": 10,
"type": "tag",
"val": "p",
},
Object {
"col": 2,
"line": 10,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 10,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": "false",
},
Object {
"col": 12,
"line": 10,
"type": "end-attributes",
},
Object {
"col": 13,
"line": 10,
"type": "eos",
},
]
`;
exports[`test comments.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"buffer": true,
"col": 1,
"line": 2,
"type": "comment",
"val": " foo",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 2,
},
Object {
"buffer": true,
"col": 3,
"line": 4,
"type": "comment",
"val": " bar",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 3,
"line": 5,
"type": "tag",
"val": "li",
},
Object {
"col": 6,
"line": 5,
"type": "text",
"val": "one",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"buffer": true,
"col": 3,
"line": 6,
"type": "comment",
"val": " baz",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 3,
"line": 7,
"type": "tag",
"val": "li",
},
Object {
"col": 6,
"line": 7,
"type": "text",
"val": "two",
},
Object {
"col": 1,
"line": 9,
"type": "outdent",
},
Object {
"buffer": true,
"col": 1,
"line": 9,
"type": "comment",
"val": "",
},
Object {
"col": 3,
"line": 9,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 10,
"type": "text",
"val": "ul",
},
Object {
"col": 1,
"line": 11,
"type": "newline",
},
Object {
"col": 3,
"line": 11,
"type": "text",
"val": " li foo",
},
Object {
"col": 1,
"line": 12,
"type": "newline",
},
Object {
"col": 3,
"line": 12,
"type": "text",
"val": "",
},
Object {
"col": 3,
"line": 12,
"type": "end-pipeless-text",
},
Object {
"col": 1,
"line": 13,
"type": "newline",
},
Object {
"buffer": true,
"col": 1,
"line": 13,
"type": "comment",
"val": " block",
},
Object {
"col": 9,
"line": 13,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 14,
"type": "text",
"val": "// inline follow",
},
Object {
"col": 1,
"line": 15,
"type": "newline",
},
Object {
"col": 3,
"line": 15,
"type": "text",
"val": "li three",
},
Object {
"col": 1,
"line": 16,
"type": "newline",
},
Object {
"col": 3,
"line": 16,
"type": "text",
"val": "",
},
Object {
"col": 3,
"line": 16,
"type": "end-pipeless-text",
},
Object {
"col": 1,
"line": 17,
"type": "newline",
},
Object {
"buffer": true,
"col": 1,
"line": 17,
"type": "comment",
"val": " block",
},
Object {
"col": 9,
"line": 17,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 18,
"type": "text",
"val": "// inline followed by tags",
},
Object {
"col": 1,
"line": 19,
"type": "newline",
},
Object {
"col": 3,
"line": 19,
"type": "text",
"val": "ul",
},
Object {
"col": 1,
"line": 20,
"type": "newline",
},
Object {
"col": 3,
"line": 20,
"type": "text",
"val": " li four",
},
Object {
"col": 1,
"line": 21,
"type": "newline",
},
Object {
"col": 3,
"line": 21,
"type": "text",
"val": "",
},
Object {
"col": 3,
"line": 21,
"type": "end-pipeless-text",
},
Object {
"col": 1,
"line": 22,
"type": "newline",
},
Object {
"buffer": true,
"col": 1,
"line": 22,
"type": "comment",
"val": "if IE lt 9",
},
Object {
"col": 13,
"line": 22,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 23,
"type": "text",
"val": "// inline",
},
Object {
"col": 1,
"line": 24,
"type": "newline",
},
Object {
"col": 3,
"line": 24,
"type": "text",
"val": "script(src=\'/lame.js\')",
},
Object {
"col": 1,
"line": 25,
"type": "newline",
},
Object {
"col": 3,
"line": 25,
"type": "text",
"val": "// end-inline",
},
Object {
"col": 1,
"line": 26,
"type": "newline",
},
Object {
"col": 3,
"line": 26,
"type": "text",
"val": "",
},
Object {
"col": 3,
"line": 26,
"type": "end-pipeless-text",
},
Object {
"col": 1,
"line": 27,
"type": "newline",
},
Object {
"col": 1,
"line": 27,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 27,
"type": "text",
"val": "five",
},
Object {
"col": 1,
"line": 29,
"type": "newline",
},
Object {
"col": 1,
"line": 29,
"type": "class",
"val": "foo",
},
Object {
"col": 6,
"line": 29,
"type": "text",
"val": "// not a comment",
},
Object {
"col": 22,
"line": 29,
"type": "eos",
},
]
`;
exports[`test comments.source.pug 1`] = `
Array [
Object {
"buffer": false,
"col": 1,
"line": 1,
"type": "comment",
"val": "",
},
Object {
"col": 4,
"line": 1,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 2,
"type": "text",
"val": "s/s.",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 3,
"line": 3,
"type": "text",
"val": "",
},
Object {
"col": 3,
"line": 3,
"type": "end-pipeless-text",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 4,
"type": "comment",
"val": " test/cases/comments.source.pug",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 6,
"type": "comment",
"val": "",
},
Object {
"col": 4,
"line": 6,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 7,
"type": "text",
"val": "test/cases/comments.source.pug",
},
Object {
"col": 1,
"line": 8,
"type": "newline",
},
Object {
"col": 3,
"line": 8,
"type": "text",
"val": "when",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 3,
"line": 9,
"type": "text",
"val": "()",
},
Object {
"col": 5,
"line": 9,
"type": "end-pipeless-text",
},
Object {
"col": 5,
"line": 9,
"type": "eos",
},
]
`;
exports[`test comments-in-case.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "doctype",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 3,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 3,
},
Object {
"buffer": false,
"col": 4,
"line": 4,
"mustEscape": false,
"type": "code",
"val": "var s = \'this\'",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 4,
"line": 5,
"type": "case",
"val": "s",
},
Object {
"col": 1,
"line": 6,
"type": "indent",
"val": 5,
},
Object {
"buffer": false,
"col": 6,
"line": 6,
"type": "comment",
"val": " Comment",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 6,
"line": 7,
"type": "when",
"val": "\'this\'",
},
Object {
"col": 1,
"line": 8,
"type": "indent",
"val": 7,
},
Object {
"col": 8,
"line": 8,
"type": "tag",
"val": "p",
},
Object {
"col": 10,
"line": 8,
"type": "text",
"val": "It\'s this!",
},
Object {
"col": 6,
"line": 9,
"type": "outdent",
},
Object {
"col": 6,
"line": 9,
"type": "when",
"val": "\'that\'",
},
Object {
"col": 1,
"line": 10,
"type": "indent",
"val": 7,
},
Object {
"col": 8,
"line": 10,
"type": "tag",
"val": "p",
},
Object {
"col": 10,
"line": 10,
"type": "text",
"val": "It\'s that!",
},
Object {
"col": 20,
"line": 10,
"type": "outdent",
},
Object {
"col": 20,
"line": 10,
"type": "outdent",
},
Object {
"col": 20,
"line": 10,
"type": "outdent",
},
Object {
"col": 20,
"line": 10,
"type": "outdent",
},
Object {
"col": 20,
"line": 10,
"type": "eos",
},
]
`;
exports[`test default-with-expression.pug 1`] = `
Object {
"code": "PUG:DEFAULT_WITH_EXPRESSION",
"column": 8,
"line": 1,
"msg": "default should not have an expression",
}
`;
exports[`test doctype.custom.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "doctype",
"val": "custom stuff",
},
Object {
"col": 21,
"line": 1,
"type": "eos",
},
]
`;
exports[`test doctype.default.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "doctype",
"val": "",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 3,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 4,
"type": "tag",
"val": "h1",
},
Object {
"col": 8,
"line": 4,
"type": "text",
"val": "Title",
},
Object {
"col": 13,
"line": 4,
"type": "outdent",
},
Object {
"col": 13,
"line": 4,
"type": "outdent",
},
Object {
"col": 13,
"line": 4,
"type": "eos",
},
]
`;
exports[`test doctype.keyword.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "doctype",
"val": "html",
},
Object {
"col": 13,
"line": 1,
"type": "eos",
},
]
`;
exports[`test each.else.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 2,
"mustEscape": false,
"type": "code",
"val": "var users = []",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 2,
},
Object {
"code": "users",
"col": 3,
"key": null,
"line": 5,
"type": "each",
"val": "user",
},
Object {
"col": 1,
"line": 6,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 6,
"type": "tag",
"val": "li",
},
Object {
"buffer": true,
"col": 7,
"line": 6,
"mustEscape": true,
"type": "code",
"val": "user.name",
},
Object {
"col": 3,
"line": 7,
"type": "outdent",
},
Object {
"col": 3,
"line": 7,
"type": "else",
"val": "",
},
Object {
"col": 1,
"line": 8,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 8,
"type": "tag",
"val": "li",
},
Object {
"col": 8,
"line": 8,
"type": "text",
"val": "no users!",
},
Object {
"col": 3,
"line": 11,
"type": "outdent",
},
Object {
"col": 1,
"line": 11,
"type": "outdent",
},
Object {
"buffer": false,
"col": 1,
"line": 11,
"mustEscape": false,
"type": "code",
"val": "var users = [{ name: \'tobi\', friends: [\'loki\'] }, { name: \'loki\' }]",
},
Object {
"col": 1,
"line": 13,
"type": "newline",
},
Object {
"col": 1,
"line": 13,
"type": "if",
"val": "users",
},
Object {
"col": 1,
"line": 14,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 14,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 15,
"type": "indent",
"val": 4,
},
Object {
"code": "users",
"col": 5,
"key": null,
"line": 15,
"type": "each",
"val": "user",
},
Object {
"col": 1,
"line": 16,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 16,
"type": "tag",
"val": "li",
},
Object {
"buffer": true,
"col": 9,
"line": 16,
"mustEscape": true,
"type": "code",
"val": "user.name",
},
Object {
"col": 5,
"line": 17,
"type": "outdent",
},
Object {
"col": 5,
"line": 17,
"type": "else",
"val": "",
},
Object {
"col": 1,
"line": 18,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 18,
"type": "tag",
"val": "li",
},
Object {
"col": 10,
"line": 18,
"type": "text",
"val": "no users!",
},
Object {
"col": 5,
"line": 20,
"type": "outdent",
},
Object {
"col": 3,
"line": 20,
"type": "outdent",
},
Object {
"col": 1,
"line": 20,
"type": "outdent",
},
Object {
"buffer": false,
"col": 1,
"line": 20,
"mustEscape": false,
"type": "code",
"val": "var user = { name: \'tobi\', age: 10 }",
},
Object {
"col": 1,
"line": 22,
"type": "newline",
},
Object {
"col": 1,
"line": 22,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 23,
"type": "indent",
"val": 2,
},
Object {
"code": "user",
"col": 3,
"key": "key",
"line": 23,
"type": "each",
"val": "val",
},
Object {
"col": 1,
"line": 24,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 24,
"type": "tag",
"val": "li",
},
Object {
"buffer": true,
"col": 8,
"line": 24,
"mustEscape": true,
"type": "interpolated-code",
"val": "key",
},
Object {
"col": 14,
"line": 24,
"type": "text",
"val": ": ",
},
Object {
"buffer": true,
"col": 16,
"line": 24,
"mustEscape": true,
"type": "interpolated-code",
"val": "val",
},
Object {
"col": 3,
"line": 25,
"type": "outdent",
},
Object {
"col": 3,
"line": 25,
"type": "else",
"val": "",
},
Object {
"col": 1,
"line": 26,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 26,
"type": "tag",
"val": "li",
},
Object {
"col": 8,
"line": 26,
"type": "text",
"val": "user has no details!",
},
Object {
"col": 3,
"line": 28,
"type": "outdent",
},
Object {
"col": 1,
"line": 28,
"type": "outdent",
},
Object {
"buffer": false,
"col": 1,
"line": 28,
"mustEscape": false,
"type": "code",
"val": "var user = {}",
},
Object {
"col": 1,
"line": 30,
"type": "newline",
},
Object {
"col": 1,
"line": 30,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 31,
"type": "indent",
"val": 2,
},
Object {
"code": "user",
"col": 3,
"key": "key",
"line": 31,
"type": "each",
"val": "prop",
},
Object {
"col": 1,
"line": 32,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 32,
"type": "tag",
"val": "li",
},
Object {
"buffer": true,
"col": 8,
"line": 32,
"mustEscape": true,
"type": "interpolated-code",
"val": "key",
},
Object {
"col": 14,
"line": 32,
"type": "text",
"val": ": ",
},
Object {
"buffer": true,
"col": 16,
"line": 32,
"mustEscape": true,
"type": "interpolated-code",
"val": "val",
},
Object {
"col": 3,
"line": 33,
"type": "outdent",
},
Object {
"col": 3,
"line": 33,
"type": "else",
"val": "",
},
Object {
"col": 1,
"line": 34,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 34,
"type": "tag",
"val": "li",
},
Object {
"col": 8,
"line": 34,
"type": "text",
"val": "user has no details!",
},
Object {
"col": 3,
"line": 36,
"type": "outdent",
},
Object {
"col": 1,
"line": 36,
"type": "outdent",
},
Object {
"buffer": false,
"col": 1,
"line": 36,
"mustEscape": false,
"type": "code",
"val": "var user = Object.create(null)",
},
Object {
"col": 1,
"line": 37,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 37,
"mustEscape": false,
"type": "code",
"val": "user.name = \'tobi\'",
},
Object {
"col": 1,
"line": 39,
"type": "newline",
},
Object {
"col": 1,
"line": 39,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 40,
"type": "indent",
"val": 2,
},
Object {
"code": "user",
"col": 3,
"key": "key",
"line": 40,
"type": "each",
"val": "val",
},
Object {
"col": 1,
"line": 41,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 41,
"type": "tag",
"val": "li",
},
Object {
"buffer": true,
"col": 8,
"line": 41,
"mustEscape": true,
"type": "interpolated-code",
"val": "key",
},
Object {
"col": 14,
"line": 41,
"type": "text",
"val": ": ",
},
Object {
"buffer": true,
"col": 16,
"line": 41,
"mustEscape": true,
"type": "interpolated-code",
"val": "val",
},
Object {
"col": 3,
"line": 42,
"type": "outdent",
},
Object {
"col": 3,
"line": 42,
"type": "else",
"val": "",
},
Object {
"col": 1,
"line": 43,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 43,
"type": "tag",
"val": "li",
},
Object {
"col": 8,
"line": 43,
"type": "text",
"val": "user has no details!",
},
Object {
"col": 3,
"line": 44,
"type": "outdent",
},
Object {
"col": 1,
"line": 44,
"type": "outdent",
},
Object {
"col": 1,
"line": 44,
"type": "eos",
},
]
`;
exports[`test else-with-condition.pug 1`] = `
Object {
"code": "PUG:ELSE_CONDITION",
"column": 6,
"line": 3,
"msg": "\`else\` cannot have a condition, perhaps you meant \`else if\`",
}
`;
exports[`test escape-chars.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "script",
},
Object {
"col": 7,
"line": 1,
"type": "dot",
},
Object {
"col": 8,
"line": 1,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 2,
"type": "text",
"val": "var re = /\\d+/;",
},
Object {
"col": 18,
"line": 2,
"type": "end-pipeless-text",
},
Object {
"col": 18,
"line": 2,
"type": "eos",
},
]
`;
exports[`test escape-test.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "doctype",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "tag",
"val": "head",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 8,
},
Object {
"col": 9,
"line": 4,
"type": "tag",
"val": "title",
},
Object {
"col": 15,
"line": 4,
"type": "text",
"val": "escape-test",
},
Object {
"col": 5,
"line": 5,
"type": "outdent",
},
Object {
"col": 5,
"line": 5,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 6,
"type": "indent",
"val": 8,
},
Object {
"col": 9,
"line": 6,
"type": "tag",
"val": "textarea",
},
Object {
"col": 1,
"line": 7,
"type": "indent",
"val": 12,
},
Object {
"buffer": false,
"col": 13,
"line": 7,
"mustEscape": false,
"type": "code",
"val": "var txt = \'<param name=\"flashvars\" value=\"a=&quot;value_a&quot;&b=&quot;value_b&quot;&c=3\"/>\'",
},
Object {
"col": 1,
"line": 8,
"type": "newline",
},
Object {
"buffer": true,
"col": 15,
"line": 8,
"mustEscape": true,
"type": "interpolated-code",
"val": "txt",
},
Object {
"col": 9,
"line": 9,
"type": "outdent",
},
Object {
"col": 5,
"line": 9,
"type": "outdent",
},
Object {
"col": 1,
"line": 9,
"type": "outdent",
},
Object {
"col": 1,
"line": 9,
"type": "eos",
},
]
`;
exports[`test escaping-class-attribute.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 1,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 1,
"mustEscape": true,
"name": "attr",
"type": "attribute",
"val": "\"<%= bar %>\"",
},
Object {
"col": 22,
"line": 1,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 2,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\"<%= bar %>\"",
},
Object {
"col": 23,
"line": 2,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 3,
"mustEscape": false,
"name": "attr",
"type": "attribute",
"val": "\"<%= bar %>\"",
},
Object {
"col": 23,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 4,
"mustEscape": false,
"name": "class",
"type": "attribute",
"val": "\"<%= bar %>\"",
},
Object {
"col": 24,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 1,
"line": 5,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 5,
"mustEscape": false,
"name": "class",
"type": "attribute",
"val": "\"<%= bar %> lol rofl\"",
},
Object {
"col": 33,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 1,
"line": 6,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 6,
"mustEscape": false,
"name": "class",
"type": "attribute",
"val": "\"<%= bar %> lol rofl <%= lmao %>\"",
},
Object {
"col": 45,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 1,
"line": 7,
"type": "eos",
},
]
`;
exports[`test extends-no-path.pug 1`] = `
Object {
"code": "PUG:NO_EXTENDS_PATH",
"column": 8,
"line": 1,
"msg": "missing path for extends",
}
`;
exports[`test filter-in-include.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "include",
},
Object {
"col": 9,
"line": 1,
"type": "path",
"val": "./auxiliary/filter-in-include.pug",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "eos",
},
]
`;
exports[`test filters.coffeescript.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "script",
},
Object {
"col": 7,
"line": 1,
"type": "start-attributes",
},
Object {
"col": 8,
"line": 1,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'text/javascript\'",
},
Object {
"col": 30,
"line": 1,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "filter",
"val": "coffee-script",
},
Object {
"col": 17,
"line": 2,
"type": "start-pipeless-text",
},
Object {
"col": 5,
"line": 3,
"type": "text",
"val": "regexp = /\\n/",
},
Object {
"col": 18,
"line": 3,
"type": "end-pipeless-text",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 3,
"line": 4,
"type": "filter",
"val": "coffee-script",
},
Object {
"col": 17,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 18,
"line": 4,
"mustEscape": true,
"name": "minify",
"type": "attribute",
"val": "true",
},
Object {
"col": 29,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 30,
"line": 4,
"type": "start-pipeless-text",
},
Object {
"col": 5,
"line": 5,
"type": "text",
"val": "math =",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 5,
"line": 6,
"type": "text",
"val": " square: (value) -> value * value",
},
Object {
"col": 39,
"line": 6,
"type": "end-pipeless-text",
},
Object {
"col": 39,
"line": 6,
"type": "outdent",
},
Object {
"col": 39,
"line": 6,
"type": "eos",
},
]
`;
exports[`test filters.custom.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "filter",
"val": "custom",
},
Object {
"col": 12,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 13,
"line": 3,
"mustEscape": true,
"name": "opt",
"type": "attribute",
"val": "\'val\'",
},
Object {
"col": 23,
"line": 3,
"mustEscape": true,
"name": "num",
"type": "attribute",
"val": "2",
},
Object {
"col": 28,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 29,
"line": 3,
"type": "start-pipeless-text",
},
Object {
"col": 7,
"line": 4,
"type": "text",
"val": "Line 1",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 7,
"line": 5,
"type": "text",
"val": "Line 2",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 7,
"line": 6,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 7,
"line": 7,
"type": "text",
"val": "Line 4",
},
Object {
"col": 13,
"line": 7,
"type": "end-pipeless-text",
},
Object {
"col": 13,
"line": 7,
"type": "outdent",
},
Object {
"col": 13,
"line": 7,
"type": "outdent",
},
Object {
"col": 13,
"line": 7,
"type": "eos",
},
]
`;
exports[`test filters.include.custom.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "tag",
"val": "pre",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 4,
"type": "include",
},
Object {
"col": 14,
"line": 4,
"type": "filter",
"val": "custom",
},
Object {
"col": 21,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 22,
"line": 4,
"mustEscape": true,
"name": "opt",
"type": "attribute",
"val": "\'val\'",
},
Object {
"col": 32,
"line": 4,
"mustEscape": true,
"name": "num",
"type": "attribute",
"val": "2",
},
Object {
"col": 37,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 39,
"line": 4,
"type": "path",
"val": "filters.include.custom.pug",
},
Object {
"col": 5,
"line": 5,
"type": "outdent",
},
Object {
"col": 3,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "eos",
},
]
`;
exports[`test filters.include.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "include",
},
Object {
"col": 12,
"line": 3,
"type": "filter",
"val": "markdown-it",
},
Object {
"col": 25,
"line": 3,
"type": "path",
"val": "some.md",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 5,
"line": 4,
"type": "tag",
"val": "script",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 5,
"type": "include",
},
Object {
"col": 14,
"line": 5,
"type": "filter",
"val": "coffee-script",
},
Object {
"col": 28,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 29,
"line": 5,
"mustEscape": true,
"name": "minify",
"type": "attribute",
"val": "true",
},
Object {
"col": 40,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 42,
"line": 5,
"type": "path",
"val": "include-filter-coffee.coffee",
},
Object {
"col": 5,
"line": 6,
"type": "outdent",
},
Object {
"col": 5,
"line": 6,
"type": "tag",
"val": "script",
},
Object {
"col": 1,
"line": 7,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 7,
"type": "include",
},
Object {
"col": 14,
"line": 7,
"type": "filter",
"val": "coffee-script",
},
Object {
"col": 28,
"line": 7,
"type": "start-attributes",
},
Object {
"col": 29,
"line": 7,
"mustEscape": true,
"name": "minify",
"type": "attribute",
"val": "false",
},
Object {
"col": 41,
"line": 7,
"type": "end-attributes",
},
Object {
"col": 43,
"line": 7,
"type": "path",
"val": "include-filter-coffee.coffee",
},
Object {
"col": 5,
"line": 8,
"type": "outdent",
},
Object {
"col": 3,
"line": 8,
"type": "outdent",
},
Object {
"col": 1,
"line": 8,
"type": "outdent",
},
Object {
"col": 1,
"line": 8,
"type": "eos",
},
]
`;
exports[`test filters.inline.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 1,
"type": "text",
"val": "before ",
},
Object {
"col": 10,
"line": 1,
"type": "start-pug-interpolation",
},
Object {
"col": 12,
"line": 1,
"type": "filter",
"val": "cdata",
},
Object {
"col": 19,
"line": 1,
"type": "text",
"val": "inside",
},
Object {
"col": 25,
"line": 1,
"type": "end-pug-interpolation",
},
Object {
"col": 26,
"line": 1,
"type": "text",
"val": " after",
},
Object {
"col": 32,
"line": 1,
"type": "eos",
},
]
`;
exports[`test filters.less.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "head",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "tag",
"val": "style",
},
Object {
"col": 10,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 11,
"line": 3,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\"text/css\"",
},
Object {
"col": 26,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 4,
"type": "filter",
"val": "less",
},
Object {
"col": 12,
"line": 4,
"type": "start-pipeless-text",
},
Object {
"col": 9,
"line": 5,
"type": "text",
"val": "@pad: 15px;",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 9,
"line": 6,
"type": "text",
"val": "body {",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 9,
"line": 7,
"type": "text",
"val": " padding: @pad;",
},
Object {
"col": 1,
"line": 8,
"type": "newline",
},
Object {
"col": 9,
"line": 8,
"type": "text",
"val": "}",
},
Object {
"col": 10,
"line": 8,
"type": "end-pipeless-text",
},
Object {
"col": 10,
"line": 8,
"type": "outdent",
},
Object {
"col": 10,
"line": 8,
"type": "outdent",
},
Object {
"col": 10,
"line": 8,
"type": "outdent",
},
Object {
"col": 10,
"line": 8,
"type": "eos",
},
]
`;
exports[`test filters.markdown.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "filter",
"val": "markdown-it",
},
Object {
"col": 17,
"line": 3,
"type": "start-pipeless-text",
},
Object {
"col": 7,
"line": 4,
"type": "text",
"val": "This is _some_ awesome **markdown**",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 7,
"line": 5,
"type": "text",
"val": "whoop.",
},
Object {
"col": 13,
"line": 5,
"type": "end-pipeless-text",
},
Object {
"col": 13,
"line": 5,
"type": "outdent",
},
Object {
"col": 13,
"line": 5,
"type": "outdent",
},
Object {
"col": 13,
"line": 5,
"type": "eos",
},
]
`;
exports[`test filters.nested.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "script",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "filter",
"val": "cdata",
},
Object {
"col": 9,
"line": 2,
"type": "filter",
"val": "uglify-js",
},
Object {
"col": 19,
"line": 2,
"type": "start-pipeless-text",
},
Object {
"col": 5,
"line": 3,
"type": "text",
"val": "(function() {",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 5,
"line": 4,
"type": "text",
"val": " console.log(\'test\')",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 5,
"line": 5,
"type": "text",
"val": "})()",
},
Object {
"col": 9,
"line": 5,
"type": "end-pipeless-text",
},
Object {
"col": 1,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "tag",
"val": "script",
},
Object {
"col": 1,
"line": 7,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 7,
"type": "filter",
"val": "cdata",
},
Object {
"col": 9,
"line": 7,
"type": "filter",
"val": "uglify-js",
},
Object {
"col": 19,
"line": 7,
"type": "filter",
"val": "coffee-script",
},
Object {
"col": 33,
"line": 7,
"type": "start-pipeless-text",
},
Object {
"col": 5,
"line": 8,
"type": "text",
"val": "(->",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 5,
"line": 9,
"type": "text",
"val": " console.log \'test\'",
},
Object {
"col": 1,
"line": 10,
"type": "newline",
},
Object {
"col": 5,
"line": 10,
"type": "text",
"val": ")()",
},
Object {
"col": 8,
"line": 10,
"type": "end-pipeless-text",
},
Object {
"col": 8,
"line": 10,
"type": "outdent",
},
Object {
"col": 8,
"line": 10,
"type": "eos",
},
]
`;
exports[`test filters.stylus.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "head",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "tag",
"val": "style",
},
Object {
"col": 10,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 11,
"line": 3,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\"text/css\"",
},
Object {
"col": 26,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 4,
"type": "filter",
"val": "stylus",
},
Object {
"col": 14,
"line": 4,
"type": "start-pipeless-text",
},
Object {
"col": 9,
"line": 5,
"type": "text",
"val": "body",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 9,
"line": 6,
"type": "text",
"val": " padding: 50px",
},
Object {
"col": 24,
"line": 6,
"type": "end-pipeless-text",
},
Object {
"col": 5,
"line": 7,
"type": "outdent",
},
Object {
"col": 3,
"line": 7,
"type": "outdent",
},
Object {
"col": 3,
"line": 7,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 8,
"type": "outdent",
},
Object {
"col": 1,
"line": 8,
"type": "eos",
},
]
`;
exports[`test filters.verbatim.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 1,
},
Object {
"col": 2,
"line": 2,
"type": "tag",
"val": "div",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 3,
"type": "filter",
"val": "verbatim",
},
Object {
"col": 12,
"line": 3,
"type": "start-pipeless-text",
},
Object {
"col": 5,
"line": 4,
"type": "text",
"val": "filters are applied at compile time",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 5,
"line": 5,
"type": "text",
"val": "with no #[b interpolation] at #{all}",
},
Object {
"col": 41,
"line": 5,
"type": "end-pipeless-text",
},
Object {
"col": 41,
"line": 5,
"type": "outdent",
},
Object {
"col": 41,
"line": 5,
"type": "outdent",
},
Object {
"col": 41,
"line": 5,
"type": "eos",
},
]
`;
exports[`test filters-empty.pug 1`] = `
Array [
Object {
"buffer": false,
"col": 1,
"line": 1,
"mustEscape": false,
"type": "code",
"val": "var users = [{ name: \'tobi\', age: 2 }]",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "fb:users",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 2,
},
Object {
"code": "users",
"col": 3,
"key": null,
"line": 4,
"type": "each",
"val": "user",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 5,
"type": "tag",
"val": "fb:user",
},
Object {
"col": 12,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 13,
"line": 5,
"mustEscape": true,
"name": "age",
"type": "attribute",
"val": "user.age",
},
Object {
"col": 25,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 6,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 6,
"type": "filter",
"val": "cdata",
},
Object {
"col": 5,
"line": 7,
"type": "outdent",
},
Object {
"col": 3,
"line": 7,
"type": "outdent",
},
Object {
"col": 1,
"line": 7,
"type": "outdent",
},
Object {
"col": 1,
"line": 7,
"type": "eos",
},
]
`;
exports[`test html.pug 1`] = `
Array [
Object {
"buffer": false,
"col": 1,
"line": 1,
"mustEscape": false,
"type": "code",
"val": "var version = 1449104952939",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "text-html",
"val": "<ul>",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 4,
"type": "text-html",
"val": "<li>foo</li>",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 3,
"line": 5,
"type": "text-html",
"val": "<li>bar</li>",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 3,
"line": 6,
"type": "text-html",
"val": "<li>baz</li>",
},
Object {
"col": 1,
"line": 7,
"type": "outdent",
},
Object {
"col": 1,
"line": 7,
"type": "text-html",
"val": "</ul>",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 1,
"line": 9,
"type": "text-html",
"val": "<!--build:js /js/app.min.js?v=",
},
Object {
"buffer": true,
"col": 31,
"line": 9,
"mustEscape": true,
"type": "interpolated-code",
"val": "version",
},
Object {
"col": 41,
"line": 9,
"type": "text-html",
"val": "-->",
},
Object {
"col": 1,
"line": 10,
"type": "newline",
},
Object {
"col": 1,
"line": 10,
"type": "text-html",
"val": "<!--endbuild-->",
},
Object {
"col": 1,
"line": 12,
"type": "newline",
},
Object {
"col": 1,
"line": 12,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 12,
"type": "text",
"val": "You can <em>embed</em> html as well.",
},
Object {
"col": 1,
"line": 13,
"type": "newline",
},
Object {
"col": 1,
"line": 13,
"type": "tag",
"val": "p",
},
Object {
"col": 2,
"line": 13,
"type": ":",
},
Object {
"col": 4,
"line": 13,
"type": "text-html",
"val": "<strong>Even</strong> as the body of a block expansion.",
},
Object {
"col": 1,
"line": 14,
"type": "newline",
},
Object {
"col": 1,
"line": 14,
"type": "eos",
},
]
`;
exports[`test html5.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "doctype",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "input",
},
Object {
"col": 6,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 7,
"line": 2,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'checkbox\'",
},
Object {
"col": 24,
"line": 2,
"mustEscape": false,
"name": "checked",
"type": "attribute",
"val": true,
},
Object {
"col": 31,
"line": 2,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "input",
},
Object {
"col": 6,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 7,
"line": 3,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'checkbox\'",
},
Object {
"col": 24,
"line": 3,
"mustEscape": true,
"name": "checked",
"type": "attribute",
"val": "true",
},
Object {
"col": 36,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"type": "tag",
"val": "input",
},
Object {
"col": 6,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 7,
"line": 4,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'checkbox\'",
},
Object {
"col": 24,
"line": 4,
"mustEscape": true,
"name": "checked",
"type": "attribute",
"val": "false",
},
Object {
"col": 37,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 38,
"line": 4,
"type": "eos",
},
]
`;
exports[`test include.script.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "script",
},
Object {
"col": 7,
"line": 1,
"type": "id",
"val": "pet-template",
},
Object {
"col": 20,
"line": 1,
"type": "start-attributes",
},
Object {
"col": 21,
"line": 1,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'text/x-template\'",
},
Object {
"col": 43,
"line": 1,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "include",
},
Object {
"col": 11,
"line": 2,
"type": "path",
"val": "auxiliary/pet.pug",
},
Object {
"col": 1,
"line": 3,
"type": "outdent",
},
Object {
"col": 1,
"line": 3,
"type": "eos",
},
]
`;
exports[`test include.yield.nested.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "include",
},
Object {
"col": 9,
"line": 2,
"type": "path",
"val": "auxiliary/yield-nested.pug",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 3,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 3,
"type": "text",
"val": "some content",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 3,
"line": 4,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 4,
"type": "text",
"val": "and some more",
},
Object {
"col": 1,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "eos",
},
]
`;
exports[`test include-extends-from-root.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "include",
},
Object {
"col": 9,
"line": 1,
"type": "path",
"val": "/auxiliary/extends-from-root.pug",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "eos",
},
]
`;
exports[`test include-extends-of-common-template.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "include",
},
Object {
"col": 9,
"line": 1,
"type": "path",
"val": "auxiliary/extends-empty-block-1.pug",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "include",
},
Object {
"col": 9,
"line": 2,
"type": "path",
"val": "auxiliary/extends-empty-block-2.pug",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "eos",
},
]
`;
exports[`test include-extends-relative.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "include",
},
Object {
"col": 9,
"line": 1,
"type": "path",
"val": "../cases/auxiliary/extends-relative.pug",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "eos",
},
]
`;
exports[`test include-filter-no-path.pug 1`] = `
Object {
"code": "PUG:NO_INCLUDE_PATH",
"column": 12,
"line": 1,
"msg": "missing path for include",
}
`;
exports[`test include-filter-no-path-2.pug 1`] = `
Object {
"code": "PUG:NO_INCLUDE_PATH",
"column": 12,
"line": 1,
"msg": "missing path for include",
}
`;
exports[`test include-filter-no-space.pug 1`] = `
Object {
"code": "PUG:UNEXPECTED_TEXT",
"column": 14,
"line": 1,
"msg": "unexpected text \"foo.£\"",
}
`;
exports[`test include-no-path.pug 1`] = `
Object {
"code": "PUG:NO_INCLUDE_PATH",
"column": 8,
"line": 1,
"msg": "missing path for include",
}
`;
exports[`test include-only-text.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "tag",
"val": "p",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 4,
"type": "include",
},
Object {
"col": 15,
"line": 4,
"type": "path",
"val": "include-only-text-body.pug",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 8,
},
Object {
"col": 9,
"line": 5,
"type": "tag",
"val": "em",
},
Object {
"col": 12,
"line": 5,
"type": "text",
"val": "hello world",
},
Object {
"col": 7,
"line": 6,
"type": "outdent",
},
Object {
"col": 5,
"line": 6,
"type": "outdent",
},
Object {
"col": 3,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "eos",
},
]
`;
exports[`test include-only-text-body.pug 1`] = `
Array [
Object {
"col": 3,
"line": 1,
"type": "text",
"val": "The message is \"",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "yield",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 3,
"line": 3,
"type": "text",
"val": "\"",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"type": "eos",
},
]
`;
exports[`test include-with-text.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "include",
},
Object {
"col": 11,
"line": 2,
"type": "path",
"val": "include-with-text-head.pug",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "tag",
"val": "script",
},
Object {
"col": 11,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 12,
"line": 3,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'/caustic.js\'",
},
Object {
"col": 29,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 5,
"line": 4,
"type": "tag",
"val": "script",
},
Object {
"col": 11,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 12,
"line": 4,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'/app.js\'",
},
Object {
"col": 25,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 3,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "eos",
},
]
`;
exports[`test include-with-text-head.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "head",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 2,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'text/javascript\'",
},
Object {
"col": 32,
"line": 2,
"type": "end-attributes",
},
Object {
"col": 33,
"line": 2,
"type": "dot",
},
Object {
"col": 34,
"line": 2,
"type": "start-pipeless-text",
},
Object {
"col": 5,
"line": 3,
"type": "text",
"val": "alert(\'hello world\');",
},
Object {
"col": 26,
"line": 3,
"type": "end-pipeless-text",
},
Object {
"col": 26,
"line": 3,
"type": "outdent",
},
Object {
"col": 26,
"line": 3,
"type": "eos",
},
]
`;
exports[`test includes.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "include",
},
Object {
"col": 9,
"line": 2,
"type": "path",
"val": "auxiliary/mixins.pug",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"args": null,
"col": 1,
"line": 4,
"type": "call",
"val": "foo",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 1,
"line": 6,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 7,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 7,
"type": "include",
},
Object {
"col": 11,
"line": 7,
"type": "path",
"val": "auxiliary/smile.html",
},
Object {
"col": 1,
"line": 8,
"type": "newline",
},
Object {
"col": 3,
"line": 8,
"type": "include",
},
Object {
"col": 11,
"line": 8,
"type": "path",
"val": "auxiliary/escapes.html",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 3,
"line": 9,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 9,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 9,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\"text/javascript\"",
},
Object {
"col": 32,
"line": 9,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 10,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 10,
"type": "include",
},
Object {
"col": 12,
"line": 10,
"type": "filter",
"val": "verbatim",
},
Object {
"col": 22,
"line": 10,
"type": "path",
"val": "auxiliary/includable.js",
},
Object {
"col": 3,
"line": 11,
"type": "outdent",
},
Object {
"col": 1,
"line": 11,
"type": "outdent",
},
Object {
"col": 1,
"line": 11,
"type": "eos",
},
]
`;
exports[`test includes-with-ext-js.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "pre",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "code",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "include",
},
Object {
"col": 13,
"line": 3,
"type": "path",
"val": "javascript-new-lines.js",
},
Object {
"col": 3,
"line": 4,
"type": "outdent",
},
Object {
"col": 1,
"line": 4,
"type": "outdent",
},
Object {
"col": 1,
"line": 4,
"type": "eos",
},
]
`;
exports[`test inconsistent-indentation.pug 1`] = `
Object {
"code": "PUG:INCONSISTENT_INDENTATION",
"column": 1,
"line": 4,
"msg": "Inconsistent indentation. Expecting either 2 or 6 spaces/tabs.",
}
`;
exports[`test inheritance.alert-dialog.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "extends",
},
Object {
"col": 9,
"line": 2,
"type": "path",
"val": "auxiliary/dialog.pug",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"mode": "replace",
"type": "block",
"val": "content",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 5,
"type": "tag",
"val": "h1",
},
Object {
"col": 6,
"line": 5,
"type": "text",
"val": "Alert!",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 3,
"line": 6,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 6,
"type": "text",
"val": "I\'m an alert!",
},
Object {
"col": 1,
"line": 7,
"type": "outdent",
},
Object {
"col": 1,
"line": 7,
"type": "eos",
},
]
`;
exports[`test inheritance.defaults.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "head",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"mode": "replace",
"type": "block",
"val": "head",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 4,
"type": "tag",
"val": "script",
},
Object {
"col": 13,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 14,
"line": 4,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'jquery.js\'",
},
Object {
"col": 29,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 7,
"line": 5,
"type": "tag",
"val": "script",
},
Object {
"col": 13,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 14,
"line": 5,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'keymaster.js\'",
},
Object {
"col": 32,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 7,
"line": 6,
"type": "tag",
"val": "script",
},
Object {
"col": 13,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 14,
"line": 6,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'caustic.js\'",
},
Object {
"col": 30,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 31,
"line": 6,
"type": "outdent",
},
Object {
"col": 31,
"line": 6,
"type": "outdent",
},
Object {
"col": 31,
"line": 6,
"type": "outdent",
},
Object {
"col": 31,
"line": 6,
"type": "eos",
},
]
`;
exports[`test inheritance.extend.include.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "extends",
},
Object {
"col": 8,
"line": 2,
"type": "path",
"val": "auxiliary/layout.include.pug",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"mode": "replace",
"type": "block",
"val": "head",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 5,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 5,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'jquery.js\'",
},
Object {
"col": 25,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 7,
"type": "outdent",
},
Object {
"col": 1,
"line": 7,
"mode": "replace",
"type": "block",
"val": "content",
},
Object {
"col": 1,
"line": 8,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 8,
"type": "tag",
"val": "h2",
},
Object {
"col": 6,
"line": 8,
"type": "text",
"val": "Page",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 3,
"line": 9,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 9,
"type": "text",
"val": "Some content",
},
Object {
"col": 1,
"line": 11,
"type": "outdent",
},
Object {
"col": 1,
"line": 11,
"mode": "replace",
"type": "block",
"val": "window-content",
},
Object {
"col": 1,
"line": 12,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 12,
"type": "tag",
"val": "h2",
},
Object {
"col": 6,
"line": 12,
"type": "text",
"val": "Awesome",
},
Object {
"col": 1,
"line": 13,
"type": "newline",
},
Object {
"col": 3,
"line": 13,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 13,
"type": "text",
"val": "Now we can extend included blocks!",
},
Object {
"col": 1,
"line": 14,
"type": "outdent",
},
Object {
"col": 1,
"line": 14,
"type": "eos",
},
]
`;
exports[`test inheritance.extend.mixins.block.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "extends",
},
Object {
"col": 8,
"line": 1,
"type": "path",
"val": "auxiliary/inheritance.extend.mixin.block.pug",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"mode": "replace",
"type": "block",
"val": "content",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 4,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 4,
"type": "text",
"val": "Hello World!",
},
Object {
"col": 1,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "eos",
},
]
`;
exports[`test inheritance.extend.mixins.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "extends",
},
Object {
"col": 8,
"line": 2,
"type": "path",
"val": "auxiliary/layout.pug",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"args": "title",
"col": 1,
"line": 4,
"type": "mixin",
"val": "article",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 5,
"type": "if",
"val": "title",
},
Object {
"col": 1,
"line": 6,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 6,
"type": "tag",
"val": "h1",
},
Object {
"buffer": true,
"col": 7,
"line": 6,
"mustEscape": true,
"type": "code",
"val": "title",
},
Object {
"col": 3,
"line": 7,
"type": "outdent",
},
Object {
"col": 3,
"line": 7,
"type": "mixin-block",
},
Object {
"col": 1,
"line": 9,
"type": "outdent",
},
Object {
"col": 1,
"line": 9,
"mode": "replace",
"type": "block",
"val": "content",
},
Object {
"col": 1,
"line": 10,
"type": "indent",
"val": 2,
},
Object {
"args": "\"The meaning of life\"",
"col": 3,
"line": 10,
"type": "call",
"val": "article",
},
Object {
"col": 1,
"line": 11,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 11,
"type": "tag",
"val": "p",
},
Object {
"col": 7,
"line": 11,
"type": "text",
"val": "Foo bar baz!",
},
Object {
"col": 3,
"line": 12,
"type": "outdent",
},
Object {
"col": 1,
"line": 12,
"type": "outdent",
},
Object {
"col": 1,
"line": 12,
"type": "eos",
},
]
`;
exports[`test inheritance.extend.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "extends",
},
Object {
"col": 8,
"line": 2,
"type": "path",
"val": "auxiliary/layout.pug",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"mode": "replace",
"type": "block",
"val": "head",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 5,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 5,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'jquery.js\'",
},
Object {
"col": 25,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 7,
"type": "outdent",
},
Object {
"col": 1,
"line": 7,
"mode": "replace",
"type": "block",
"val": "content",
},
Object {
"col": 1,
"line": 8,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 8,
"type": "tag",
"val": "h2",
},
Object {
"col": 6,
"line": 8,
"type": "text",
"val": "Page",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 3,
"line": 9,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 9,
"type": "text",
"val": "Some content",
},
Object {
"col": 1,
"line": 10,
"type": "outdent",
},
Object {
"col": 1,
"line": 10,
"type": "eos",
},
]
`;
exports[`test inheritance.extend.recursive.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "extends",
},
Object {
"col": 9,
"line": 1,
"type": "path",
"val": "/auxiliary/inheritance.extend.recursive-parent.pug",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"mode": "replace",
"type": "block",
"val": "parent",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 4,
"type": "tag",
"val": "h4",
},
Object {
"col": 8,
"line": 4,
"type": "text",
"val": "child",
},
Object {
"col": 13,
"line": 4,
"type": "outdent",
},
Object {
"col": 13,
"line": 4,
"type": "eos",
},
]
`;
exports[`test inheritance.extend.whitespace.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "extends",
},
Object {
"col": 8,
"line": 2,
"type": "path",
"val": "auxiliary/layout.pug",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"mode": "replace",
"type": "block",
"val": "head",
},
Object {
"col": 1,
"line": 6,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 6,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 6,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'jquery.js\'",
},
Object {
"col": 25,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 8,
"type": "outdent",
},
Object {
"col": 1,
"line": 8,
"mode": "replace",
"type": "block",
"val": "content",
},
Object {
"col": 1,
"line": 12,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 12,
"type": "tag",
"val": "h2",
},
Object {
"col": 6,
"line": 12,
"type": "text",
"val": "Page",
},
Object {
"col": 1,
"line": 13,
"type": "newline",
},
Object {
"col": 3,
"line": 13,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 13,
"type": "text",
"val": "Some content",
},
Object {
"col": 1,
"line": 14,
"type": "outdent",
},
Object {
"col": 1,
"line": 14,
"type": "eos",
},
]
`;
exports[`test inheritance.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "extends",
},
Object {
"col": 9,
"line": 2,
"type": "path",
"val": "auxiliary/layout.pug",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"mode": "replace",
"type": "block",
"val": "head",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 5,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 5,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'jquery.js\'",
},
Object {
"col": 25,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 7,
"type": "outdent",
},
Object {
"col": 1,
"line": 7,
"mode": "replace",
"type": "block",
"val": "content",
},
Object {
"col": 1,
"line": 8,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 8,
"type": "tag",
"val": "h2",
},
Object {
"col": 6,
"line": 8,
"type": "text",
"val": "Page",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 3,
"line": 9,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 9,
"type": "text",
"val": "Some content",
},
Object {
"col": 1,
"line": 10,
"type": "outdent",
},
Object {
"col": 1,
"line": 10,
"type": "eos",
},
]
`;
exports[`test inline-block-comment.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"mode": "replace",
"type": "block",
"val": "content",
},
Object {
"buffer": true,
"col": 1,
"line": 1,
"type": "comment",
"val": " Main content goes here",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"mode": "append",
"type": "block",
"val": "content",
},
Object {
"buffer": true,
"col": 1,
"line": 2,
"type": "comment",
"val": " adding something to content",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"mode": "prepend",
"type": "block",
"val": "content",
},
Object {
"buffer": true,
"col": 1,
"line": 3,
"type": "comment",
"val": " adding something to other end of content",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"type": "eos",
},
]
`;
exports[`test inline-tag.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 1,
"type": "text",
"val": "bing ",
},
Object {
"col": 8,
"line": 1,
"type": "start-pug-interpolation",
},
Object {
"col": 10,
"line": 1,
"type": "tag",
"val": "strong",
},
Object {
"col": 17,
"line": 1,
"type": "text",
"val": "foo",
},
Object {
"col": 20,
"line": 1,
"type": "end-pug-interpolation",
},
Object {
"col": 21,
"line": 1,
"type": "text",
"val": " bong",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "p",
},
Object {
"col": 2,
"line": 3,
"type": "dot",
},
Object {
"col": 3,
"line": 3,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 4,
"type": "text",
"val": "bing",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 3,
"line": 5,
"type": "text",
"val": "",
},
Object {
"col": 3,
"line": 5,
"type": "start-pug-interpolation",
},
Object {
"col": 5,
"line": 5,
"type": "tag",
"val": "strong",
},
Object {
"col": 12,
"line": 5,
"type": "text",
"val": "foo",
},
Object {
"col": 15,
"line": 5,
"type": "end-pug-interpolation",
},
Object {
"col": 16,
"line": 5,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 3,
"line": 6,
"type": "text",
"val": "",
},
Object {
"col": 3,
"line": 6,
"type": "start-pug-interpolation",
},
Object {
"col": 5,
"line": 6,
"type": "tag",
"val": "strong",
},
Object {
"buffer": true,
"col": 11,
"line": 6,
"mustEscape": true,
"type": "code",
"val": "\'[foo]\'",
},
Object {
"col": 20,
"line": 6,
"type": "end-pug-interpolation",
},
Object {
"col": 21,
"line": 6,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 3,
"line": 7,
"type": "text",
"val": "",
},
Object {
"col": 3,
"line": 7,
"type": "start-pug-interpolation",
},
Object {
"buffer": false,
"col": 5,
"line": 7,
"mustEscape": false,
"type": "code",
"val": "var foo = \'foo]\'",
},
Object {
"col": 23,
"line": 7,
"type": "end-pug-interpolation",
},
Object {
"col": 24,
"line": 7,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 8,
"type": "newline",
},
Object {
"col": 3,
"line": 8,
"type": "text",
"val": "bong",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 3,
"line": 9,
"type": "text",
"val": "",
},
Object {
"col": 3,
"line": 9,
"type": "end-pipeless-text",
},
Object {
"col": 1,
"line": 10,
"type": "newline",
},
Object {
"col": 1,
"line": 10,
"type": "tag",
"val": "p",
},
Object {
"col": 1,
"line": 11,
"type": "indent",
"val": 2,
},
Object {
"col": 5,
"line": 11,
"type": "text",
"val": "bing",
},
Object {
"col": 1,
"line": 12,
"type": "newline",
},
Object {
"col": 5,
"line": 12,
"type": "text",
"val": "",
},
Object {
"col": 5,
"line": 12,
"type": "start-pug-interpolation",
},
Object {
"col": 7,
"line": 12,
"type": "tag",
"val": "strong",
},
Object {
"col": 14,
"line": 12,
"type": "text",
"val": "foo",
},
Object {
"col": 17,
"line": 12,
"type": "end-pug-interpolation",
},
Object {
"col": 18,
"line": 12,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 13,
"type": "newline",
},
Object {
"col": 5,
"line": 13,
"type": "text",
"val": "",
},
Object {
"col": 5,
"line": 13,
"type": "start-pug-interpolation",
},
Object {
"col": 7,
"line": 13,
"type": "tag",
"val": "strong",
},
Object {
"buffer": true,
"col": 13,
"line": 13,
"mustEscape": true,
"type": "code",
"val": "\'[foo]\'",
},
Object {
"col": 22,
"line": 13,
"type": "end-pug-interpolation",
},
Object {
"col": 23,
"line": 13,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 14,
"type": "newline",
},
Object {
"col": 5,
"line": 14,
"type": "text",
"val": "",
},
Object {
"col": 5,
"line": 14,
"type": "start-pug-interpolation",
},
Object {
"buffer": false,
"col": 7,
"line": 14,
"mustEscape": false,
"type": "code",
"val": "var foo = \'foo]\'",
},
Object {
"col": 25,
"line": 14,
"type": "end-pug-interpolation",
},
Object {
"col": 26,
"line": 14,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 15,
"type": "newline",
},
Object {
"col": 5,
"line": 15,
"type": "text",
"val": "bong",
},
Object {
"col": 1,
"line": 17,
"type": "outdent",
},
Object {
"col": 1,
"line": 17,
"type": "tag",
"val": "p",
},
Object {
"col": 2,
"line": 17,
"type": "dot",
},
Object {
"col": 3,
"line": 17,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 18,
"type": "text",
"val": "#[strong escaped]",
},
Object {
"col": 1,
"line": 19,
"type": "newline",
},
Object {
"col": 3,
"line": 19,
"type": "text",
"val": "#[",
},
Object {
"col": 6,
"line": 19,
"type": "start-pug-interpolation",
},
Object {
"col": 8,
"line": 19,
"type": "tag",
"val": "strong",
},
Object {
"col": 15,
"line": 19,
"type": "text",
"val": "escaped",
},
Object {
"col": 22,
"line": 19,
"type": "end-pug-interpolation",
},
Object {
"col": 23,
"line": 19,
"type": "text",
"val": "",
},
Object {
"col": 23,
"line": 19,
"type": "end-pipeless-text",
},
Object {
"col": 23,
"line": 19,
"type": "eos",
},
]
`;
exports[`test intepolated-elements.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 1,
"type": "text",
"val": "",
},
Object {
"col": 3,
"line": 1,
"type": "start-pug-interpolation",
},
Object {
"col": 5,
"line": 1,
"type": "tag",
"val": "a",
},
Object {
"col": 6,
"line": 1,
"type": "class",
"val": "rho",
},
Object {
"col": 10,
"line": 1,
"type": "start-attributes",
},
Object {
"col": 11,
"line": 1,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'#\'",
},
Object {
"col": 21,
"line": 1,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\'rho--modifier\'",
},
Object {
"col": 42,
"line": 1,
"type": "end-attributes",
},
Object {
"col": 44,
"line": 1,
"type": "text",
"val": "with inline link",
},
Object {
"col": 60,
"line": 1,
"type": "end-pug-interpolation",
},
Object {
"col": 61,
"line": 1,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 2,
"type": "text",
"val": "Some text ",
},
Object {
"col": 13,
"line": 2,
"type": "start-pug-interpolation",
},
Object {
"col": 15,
"line": 2,
"type": "tag",
"val": "a",
},
Object {
"col": 16,
"line": 2,
"type": "class",
"val": "rho",
},
Object {
"col": 20,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 21,
"line": 2,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'#\'",
},
Object {
"col": 31,
"line": 2,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\'rho--modifier\'",
},
Object {
"col": 52,
"line": 2,
"type": "end-attributes",
},
Object {
"col": 53,
"line": 2,
"type": "end-pug-interpolation",
},
Object {
"col": 54,
"line": 2,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 3,
"type": "text",
"val": "Some text ",
},
Object {
"col": 13,
"line": 3,
"type": "start-pug-interpolation",
},
Object {
"col": 15,
"line": 3,
"type": "tag",
"val": "a",
},
Object {
"col": 16,
"line": 3,
"type": "class",
"val": "rho",
},
Object {
"col": 20,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 21,
"line": 3,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'#\'",
},
Object {
"col": 31,
"line": 3,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\'rho--modifier\'",
},
Object {
"col": 52,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 54,
"line": 3,
"type": "text",
"val": "with inline link",
},
Object {
"col": 70,
"line": 3,
"type": "end-pug-interpolation",
},
Object {
"col": 71,
"line": 3,
"type": "text",
"val": "",
},
Object {
"col": 71,
"line": 3,
"type": "eos",
},
]
`;
exports[`test interpolated-call.pug 1`] = `
Object {
"code": "PUG:BRACKET_MISMATCH",
"column": 11,
"line": 5,
"msg": "Mismatched Bracket: ]",
}
`;
exports[`test interpolated-mixin.pug 1`] = `
Array [
Object {
"args": "url",
"col": 1,
"line": 1,
"type": "mixin",
"val": "linkit",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "a",
},
Object {
"col": 4,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 2,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "url",
},
Object {
"col": 13,
"line": 2,
"type": "end-attributes",
},
Object {
"buffer": true,
"col": 14,
"line": 2,
"mustEscape": true,
"type": "code",
"val": "url",
},
Object {
"col": 1,
"line": 4,
"type": "outdent",
},
Object {
"col": 1,
"line": 4,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 4,
"type": "text",
"val": "This also works ",
},
Object {
"col": 19,
"line": 4,
"type": "start-pug-interpolation",
},
Object {
"args": "\'http://www.bing.com\'",
"col": 21,
"line": 4,
"type": "call",
"val": "linkit",
},
Object {
"col": 51,
"line": 4,
"type": "end-pug-interpolation",
},
Object {
"col": 52,
"line": 4,
"type": "text",
"val": " so hurrah for Pug",
},
Object {
"col": 70,
"line": 4,
"type": "eos",
},
]
`;
exports[`test interpolation.escape.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 2,
"mustEscape": false,
"type": "code",
"val": "var id = 42;",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "foo",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 2,
},
Object {
"col": 5,
"line": 4,
"type": "text",
"val": "some",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 5,
"line": 5,
"type": "text",
"val": "#{text}",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 5,
"line": 6,
"type": "text",
"val": "here",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 5,
"line": 7,
"type": "text",
"val": "My ID ",
},
Object {
"buffer": true,
"col": 11,
"line": 7,
"mustEscape": true,
"type": "interpolated-code",
"val": "\"is {\" + id + \"}\"",
},
Object {
"col": 31,
"line": 7,
"type": "outdent",
},
Object {
"col": 31,
"line": 7,
"type": "eos",
},
]
`;
exports[`test invalid-class-name-1.pug 1`] = `
Object {
"code": "PUG:INVALID_CLASS_NAME",
"column": 1,
"line": 1,
"msg": "Class names must begin with \"-\", \"_\" or a letter.",
}
`;
exports[`test invalid-class-name-2.pug 1`] = `
Object {
"code": "PUG:INVALID_CLASS_NAME",
"column": 1,
"line": 1,
"msg": "If a class name begins with a \"-\" or \"--\", it must be followed by a letter or underscore.",
}
`;
exports[`test invalid-class-name-3.pug 1`] = `
Object {
"code": "PUG:INVALID_CLASS_NAME",
"column": 1,
"line": 1,
"msg": "\"ä\" is not a valid class name. Class names must begin with \"-\", \"_\" or a letter and can only contain \"_\", \"-\", a-z and 0-9.",
}
`;
exports[`test invalid-id.pug 1`] = `
Object {
"code": "PUG:INVALID_ID",
"column": 1,
"line": 1,
"msg": "\"ä\" is not a valid ID.",
}
`;
exports[`test layout.append.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "extends",
},
Object {
"col": 9,
"line": 2,
"type": "path",
"val": "../fixtures/append/app-layout.pug",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"mode": "append",
"type": "block",
"val": "head",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 5,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 5,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'foo.js\'",
},
Object {
"col": 22,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 3,
"line": 6,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 6,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'bar.js\'",
},
Object {
"col": 22,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 7,
"type": "outdent",
},
Object {
"col": 1,
"line": 7,
"type": "eos",
},
]
`;
exports[`test layout.append.without-block.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "extends",
},
Object {
"col": 9,
"line": 2,
"type": "path",
"val": "../fixtures/append-without-block/app-layout.pug",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"mode": "append",
"type": "block",
"val": "head",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 5,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 5,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'foo.js\'",
},
Object {
"col": 22,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 3,
"line": 6,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 6,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'bar.js\'",
},
Object {
"col": 22,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 7,
"type": "outdent",
},
Object {
"col": 1,
"line": 7,
"type": "eos",
},
]
`;
exports[`test layout.multi.append.prepend.block.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "extends",
},
Object {
"col": 9,
"line": 1,
"type": "path",
"val": "../fixtures/multi-append-prepend-block/redefine.pug",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"mode": "append",
"type": "block",
"val": "content",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 1,
},
Object {
"col": 2,
"line": 4,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 4,
"type": "class",
"val": "first",
},
Object {
"col": 9,
"line": 4,
"type": "class",
"val": "append",
},
Object {
"col": 17,
"line": 4,
"type": "text",
"val": "Something appended to content",
},
Object {
"col": 1,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"mode": "prepend",
"type": "block",
"val": "content",
},
Object {
"col": 1,
"line": 7,
"type": "indent",
"val": 1,
},
Object {
"col": 2,
"line": 7,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 7,
"type": "class",
"val": "first",
},
Object {
"col": 9,
"line": 7,
"type": "class",
"val": "prepend",
},
Object {
"col": 18,
"line": 7,
"type": "text",
"val": "Something prepended to content",
},
Object {
"col": 1,
"line": 9,
"type": "outdent",
},
Object {
"col": 1,
"line": 9,
"mode": "append",
"type": "block",
"val": "content",
},
Object {
"col": 1,
"line": 10,
"type": "indent",
"val": 1,
},
Object {
"col": 2,
"line": 10,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 10,
"type": "class",
"val": "last",
},
Object {
"col": 8,
"line": 10,
"type": "class",
"val": "append",
},
Object {
"col": 16,
"line": 10,
"type": "text",
"val": "Last append must be most last",
},
Object {
"col": 1,
"line": 12,
"type": "outdent",
},
Object {
"col": 1,
"line": 12,
"mode": "prepend",
"type": "block",
"val": "content",
},
Object {
"col": 1,
"line": 13,
"type": "indent",
"val": 1,
},
Object {
"col": 2,
"line": 13,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 13,
"type": "class",
"val": "last",
},
Object {
"col": 8,
"line": 13,
"type": "class",
"val": "prepend",
},
Object {
"col": 17,
"line": 13,
"type": "text",
"val": "Last prepend must appear at top",
},
Object {
"col": 1,
"line": 15,
"type": "outdent",
},
Object {
"col": 1,
"line": 15,
"mode": "append",
"type": "block",
"val": "head",
},
Object {
"col": 1,
"line": 16,
"type": "indent",
"val": 1,
},
Object {
"col": 2,
"line": 16,
"type": "tag",
"val": "script",
},
Object {
"col": 8,
"line": 16,
"type": "start-attributes",
},
Object {
"col": 9,
"line": 16,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'jquery.js\'",
},
Object {
"col": 24,
"line": 16,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 18,
"type": "outdent",
},
Object {
"col": 1,
"line": 18,
"mode": "prepend",
"type": "block",
"val": "head",
},
Object {
"col": 1,
"line": 19,
"type": "indent",
"val": 1,
},
Object {
"col": 2,
"line": 19,
"type": "tag",
"val": "script",
},
Object {
"col": 8,
"line": 19,
"type": "start-attributes",
},
Object {
"col": 9,
"line": 19,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'foo.js\'",
},
Object {
"col": 21,
"line": 19,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 20,
"type": "outdent",
},
Object {
"col": 1,
"line": 20,
"type": "eos",
},
]
`;
exports[`test layout.prepend.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "extends",
},
Object {
"col": 9,
"line": 2,
"type": "path",
"val": "../fixtures/prepend/app-layout.pug",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"mode": "prepend",
"type": "block",
"val": "head",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 5,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 5,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'foo.js\'",
},
Object {
"col": 22,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 3,
"line": 6,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 6,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'bar.js\'",
},
Object {
"col": 22,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 7,
"type": "outdent",
},
Object {
"col": 1,
"line": 7,
"type": "eos",
},
]
`;
exports[`test layout.prepend.without-block.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "extends",
},
Object {
"col": 9,
"line": 2,
"type": "path",
"val": "../fixtures/prepend-without-block/app-layout.pug",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 1,
"line": 4,
"mode": "prepend",
"type": "block",
"val": "head",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 5,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 5,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'foo.js\'",
},
Object {
"col": 22,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 3,
"line": 6,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 6,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'bar.js\'",
},
Object {
"col": 22,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 7,
"type": "outdent",
},
Object {
"col": 1,
"line": 7,
"type": "eos",
},
]
`;
exports[`test malformed-each.pug 1`] = `
Object {
"code": "PUG:MALFORMED_EACH",
"column": 5,
"line": 1,
"msg": "malformed each",
}
`;
exports[`test malformed-extend.pug 1`] = `
Object {
"code": "PUG:MALFORMED_EXTENDS",
"column": 7,
"line": 1,
"msg": "malformed extends",
}
`;
exports[`test malformed-include.pug 1`] = `
Object {
"code": "PUG:MALFORMED_INCLUDE",
"column": 8,
"line": 1,
"msg": "malformed include",
}
`;
exports[`test mismatched-inline-tag.pug 1`] = `
Object {
"code": "PUG:NO_END_BRACKET",
"column": 14,
"line": 2,
"msg": "End of line was reached with no closing bracket for interpolation.",
}
`;
exports[`test mismatched-tag-interpolation.pug 1`] = `
Object {
"code": "PUG:NO_END_BRACKET",
"column": 1,
"line": 3,
"msg": "The end of the string reached with no closing bracket } found.",
}
`;
exports[`test mixin.attrs.pug 1`] = `
Array [
Object {
"args": "title",
"col": 1,
"line": 1,
"type": "mixin",
"val": "centered",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "div",
},
Object {
"col": 6,
"line": 2,
"type": "class",
"val": "centered",
},
Object {
"col": 15,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 16,
"line": 2,
"mustEscape": true,
"name": "id",
"type": "attribute",
"val": "attributes.id",
},
Object {
"col": 32,
"line": 2,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"buffer": false,
"col": 5,
"line": 3,
"mustEscape": false,
"type": "code",
"val": "if (title)",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 4,
"type": "tag",
"val": "h1",
},
Object {
"col": 9,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 4,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "attributes.class",
},
Object {
"col": 32,
"line": 4,
"type": "end-attributes",
},
Object {
"buffer": true,
"col": 33,
"line": 4,
"mustEscape": true,
"type": "code",
"val": "title",
},
Object {
"col": 5,
"line": 5,
"type": "outdent",
},
Object {
"col": 5,
"line": 5,
"type": "mixin-block",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"buffer": false,
"col": 5,
"line": 6,
"mustEscape": false,
"type": "code",
"val": "if (attributes.href)",
},
Object {
"col": 1,
"line": 7,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 7,
"type": "class",
"val": "footer",
},
Object {
"col": 1,
"line": 8,
"type": "indent",
"val": 8,
},
Object {
"col": 9,
"line": 8,
"type": "tag",
"val": "a",
},
Object {
"col": 10,
"line": 8,
"type": "start-attributes",
},
Object {
"col": 11,
"line": 8,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "attributes.href",
},
Object {
"col": 31,
"line": 8,
"type": "end-attributes",
},
Object {
"col": 33,
"line": 8,
"type": "text",
"val": "Back",
},
Object {
"col": 7,
"line": 10,
"type": "outdent",
},
Object {
"col": 5,
"line": 10,
"type": "outdent",
},
Object {
"col": 3,
"line": 10,
"type": "outdent",
},
Object {
"col": 1,
"line": 10,
"type": "outdent",
},
Object {
"args": "title",
"col": 1,
"line": 10,
"type": "mixin",
"val": "main",
},
Object {
"col": 1,
"line": 11,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 11,
"type": "tag",
"val": "div",
},
Object {
"col": 6,
"line": 11,
"type": "class",
"val": "stretch",
},
Object {
"col": 1,
"line": 12,
"type": "indent",
"val": 4,
},
Object {
"args": "title",
"col": 5,
"line": 12,
"type": "call",
"val": "centered",
},
Object {
"col": 21,
"line": 12,
"type": "class",
"val": "highlight",
},
Object {
"col": 31,
"line": 12,
"type": "&attributes",
"val": "attributes",
},
Object {
"col": 1,
"line": 13,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 13,
"type": "mixin-block",
},
Object {
"col": 5,
"line": 15,
"type": "outdent",
},
Object {
"col": 3,
"line": 15,
"type": "outdent",
},
Object {
"col": 1,
"line": 15,
"type": "outdent",
},
Object {
"args": null,
"col": 1,
"line": 15,
"type": "mixin",
"val": "bottom",
},
Object {
"col": 1,
"line": 16,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 16,
"type": "tag",
"val": "div",
},
Object {
"col": 6,
"line": 16,
"type": "class",
"val": "bottom",
},
Object {
"col": 13,
"line": 16,
"type": "&attributes",
"val": "attributes",
},
Object {
"col": 1,
"line": 17,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 17,
"type": "mixin-block",
},
Object {
"col": 3,
"line": 19,
"type": "outdent",
},
Object {
"col": 1,
"line": 19,
"type": "outdent",
},
Object {
"col": 1,
"line": 19,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 20,
"type": "indent",
"val": 2,
},
Object {
"args": null,
"col": 3,
"line": 20,
"type": "call",
"val": "centered",
},
Object {
"col": 12,
"line": 20,
"type": "id",
"val": "First",
},
Object {
"col": 19,
"line": 20,
"type": "text",
"val": "Hello World",
},
Object {
"col": 1,
"line": 21,
"type": "newline",
},
Object {
"args": "\'Section 1\'",
"col": 3,
"line": 21,
"type": "call",
"val": "centered",
},
Object {
"col": 25,
"line": 21,
"type": "id",
"val": "Second",
},
Object {
"col": 1,
"line": 22,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 22,
"type": "tag",
"val": "p",
},
Object {
"col": 7,
"line": 22,
"type": "text",
"val": "Some important content.",
},
Object {
"col": 3,
"line": 23,
"type": "outdent",
},
Object {
"args": "\'Section 2\'",
"col": 3,
"line": 23,
"type": "call",
"val": "centered",
},
Object {
"col": 25,
"line": 23,
"type": "id",
"val": "Third",
},
Object {
"col": 31,
"line": 23,
"type": "class",
"val": "foo",
},
Object {
"col": 35,
"line": 23,
"type": "start-attributes",
},
Object {
"col": 36,
"line": 23,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'menu.html\'",
},
Object {
"col": 54,
"line": 23,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\'bar\'",
},
Object {
"col": 65,
"line": 23,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 24,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 24,
"type": "tag",
"val": "p",
},
Object {
"col": 7,
"line": 24,
"type": "text",
"val": "Even more important content.",
},
Object {
"col": 3,
"line": 25,
"type": "outdent",
},
Object {
"args": "\'Section 3\'",
"col": 3,
"line": 25,
"type": "call",
"val": "main",
},
Object {
"col": 21,
"line": 25,
"type": "start-attributes",
},
Object {
"col": 22,
"line": 25,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'#\'",
},
Object {
"col": 30,
"line": 25,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 26,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 26,
"type": "tag",
"val": "p",
},
Object {
"col": 7,
"line": 26,
"type": "text",
"val": "Last content.",
},
Object {
"col": 3,
"line": 27,
"type": "outdent",
},
Object {
"args": null,
"col": 3,
"line": 27,
"type": "call",
"val": "bottom",
},
Object {
"col": 10,
"line": 27,
"type": "class",
"val": "foo",
},
Object {
"col": 14,
"line": 27,
"type": "start-attributes",
},
Object {
"col": 15,
"line": 27,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\'bar\'",
},
Object {
"col": 28,
"line": 27,
"mustEscape": true,
"name": "name",
"type": "attribute",
"val": "\'end\'",
},
Object {
"col": 40,
"line": 27,
"mustEscape": true,
"name": "id",
"type": "attribute",
"val": "\'Last\'",
},
Object {
"col": 51,
"line": 27,
"mustEscape": true,
"name": "data-attr",
"type": "attribute",
"val": "\'baz\'",
},
Object {
"col": 66,
"line": 27,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 28,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 28,
"type": "tag",
"val": "p",
},
Object {
"col": 7,
"line": 28,
"type": "text",
"val": "Some final words.",
},
Object {
"col": 3,
"line": 29,
"type": "outdent",
},
Object {
"args": null,
"col": 3,
"line": 29,
"type": "call",
"val": "bottom",
},
Object {
"col": 10,
"line": 29,
"type": "start-attributes",
},
Object {
"col": 11,
"line": 29,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "[\'class1\', \'class2\']",
},
Object {
"col": 37,
"line": 29,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 31,
"type": "outdent",
},
Object {
"args": null,
"col": 1,
"line": 31,
"type": "mixin",
"val": "foo",
},
Object {
"col": 1,
"line": 32,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 32,
"type": "tag",
"val": "div",
},
Object {
"col": 6,
"line": 32,
"type": "class",
"val": "thing",
},
Object {
"col": 12,
"line": 32,
"type": "start-attributes",
},
Object {
"col": 13,
"line": 32,
"mustEscape": true,
"name": "attr1",
"type": "attribute",
"val": "\'foo\'",
},
Object {
"col": 26,
"line": 32,
"mustEscape": true,
"name": "attr2",
"type": "attribute",
"val": "\'bar\'",
},
Object {
"col": 37,
"line": 32,
"type": "end-attributes",
},
Object {
"col": 38,
"line": 32,
"type": "&attributes",
"val": "attributes",
},
Object {
"col": 1,
"line": 34,
"type": "outdent",
},
Object {
"buffer": false,
"col": 1,
"line": 34,
"mustEscape": false,
"type": "code",
"val": "var val = \'<biz>\'",
},
Object {
"col": 1,
"line": 35,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 35,
"mustEscape": false,
"type": "code",
"val": "var classes = [\'foo\', \'bar\']",
},
Object {
"col": 1,
"line": 36,
"type": "newline",
},
Object {
"args": null,
"col": 1,
"line": 36,
"type": "call",
"val": "foo",
},
Object {
"col": 5,
"line": 36,
"type": "start-attributes",
},
Object {
"col": 6,
"line": 36,
"mustEscape": true,
"name": "attr3",
"type": "attribute",
"val": "\'baz\'",
},
Object {
"col": 18,
"line": 36,
"mustEscape": true,
"name": "data-foo",
"type": "attribute",
"val": "val",
},
Object {
"col": 31,
"line": 36,
"mustEscape": false,
"name": "data-bar",
"type": "attribute",
"val": "val",
},
Object {
"col": 45,
"line": 36,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "classes",
},
Object {
"col": 58,
"line": 36,
"type": "end-attributes",
},
Object {
"col": 59,
"line": 36,
"type": "class",
"val": "thunk",
},
Object {
"col": 1,
"line": 38,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 38,
"type": "comment",
"val": " Regression test for #1424",
},
Object {
"col": 1,
"line": 39,
"type": "newline",
},
Object {
"args": "work",
"col": 1,
"line": 39,
"type": "mixin",
"val": "work_filmstrip_item",
},
Object {
"col": 1,
"line": 40,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 40,
"type": "tag",
"val": "div",
},
Object {
"col": 6,
"line": 40,
"type": "&attributes",
"val": "attributes",
},
Object {
"buffer": true,
"col": 29,
"line": 40,
"mustEscape": true,
"type": "code",
"val": "work",
},
Object {
"col": 1,
"line": 41,
"type": "outdent",
},
Object {
"args": "\'work\'",
"col": 1,
"line": 41,
"type": "call",
"val": "work_filmstrip_item",
},
Object {
"col": 29,
"line": 41,
"type": "start-attributes",
},
Object {
"col": 31,
"line": 41,
"mustEscape": true,
"name": "data-profile",
"type": "attribute",
"val": "\'profile\'",
},
Object {
"col": 56,
"line": 41,
"mustEscape": true,
"name": "data-creator-name",
"type": "attribute",
"val": "\'name\'",
},
Object {
"col": 82,
"line": 41,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 43,
"type": "newline",
},
Object {
"args": "arg1, arg2, arg3, arg4",
"col": 1,
"line": 43,
"type": "mixin",
"val": "my-mixin",
},
Object {
"col": 1,
"line": 44,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 44,
"type": "tag",
"val": "p",
},
Object {
"buffer": true,
"col": 4,
"line": 44,
"mustEscape": true,
"type": "code",
"val": "arg1",
},
Object {
"col": 1,
"line": 45,
"type": "newline",
},
Object {
"col": 3,
"line": 45,
"type": "tag",
"val": "p",
},
Object {
"buffer": true,
"col": 4,
"line": 45,
"mustEscape": true,
"type": "code",
"val": "arg2",
},
Object {
"col": 1,
"line": 46,
"type": "newline",
},
Object {
"col": 3,
"line": 46,
"type": "tag",
"val": "p",
},
Object {
"buffer": true,
"col": 4,
"line": 46,
"mustEscape": true,
"type": "code",
"val": "arg3",
},
Object {
"col": 1,
"line": 47,
"type": "newline",
},
Object {
"col": 3,
"line": 47,
"type": "tag",
"val": "p",
},
Object {
"buffer": true,
"col": 4,
"line": 47,
"mustEscape": true,
"type": "code",
"val": "arg4",
},
Object {
"col": 1,
"line": 49,
"type": "outdent",
},
Object {
"args": null,
"col": 1,
"line": 49,
"type": "call",
"val": "foo",
},
Object {
"col": 5,
"line": 49,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 50,
"mustEscape": true,
"name": "attr3",
"type": "attribute",
"val": "\"qux\"",
},
Object {
"col": 3,
"line": 51,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\"baz\"",
},
Object {
"col": 1,
"line": 52,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 54,
"type": "newline",
},
Object {
"args": "
\'1\',
\'2\',
\'3\',
\'4\'
",
"col": 1,
"line": 54,
"type": "call",
"val": "my-mixin",
},
Object {
"col": 1,
"line": 60,
"type": "newline",
},
Object {
"col": 1,
"line": 60,
"type": "eos",
},
]
`;
exports[`test mixin.block-tag-behaviour.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"args": "name",
"col": 1,
"line": 2,
"type": "mixin",
"val": "article",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 3,
"type": "tag",
"val": "section",
},
Object {
"col": 10,
"line": 3,
"type": "class",
"val": "article",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 4,
"type": "tag",
"val": "h1",
},
Object {
"buffer": true,
"col": 7,
"line": 4,
"mustEscape": true,
"type": "code",
"val": "name",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 5,
"line": 5,
"type": "mixin-block",
},
Object {
"col": 3,
"line": 7,
"type": "outdent",
},
Object {
"col": 1,
"line": 7,
"type": "outdent",
},
Object {
"col": 1,
"line": 7,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 8,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 8,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 9,
"type": "indent",
"val": 4,
},
Object {
"args": "\'Foo\'",
"col": 5,
"line": 9,
"type": "call",
"val": "article",
},
Object {
"col": 20,
"line": 9,
"type": ":",
},
Object {
"col": 22,
"line": 9,
"type": "tag",
"val": "p",
},
Object {
"col": 24,
"line": 9,
"type": "text",
"val": "I\'m article foo",
},
Object {
"col": 3,
"line": 11,
"type": "outdent",
},
Object {
"col": 1,
"line": 11,
"type": "outdent",
},
Object {
"args": "name",
"col": 1,
"line": 11,
"type": "mixin",
"val": "article",
},
Object {
"col": 1,
"line": 12,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 12,
"type": "tag",
"val": "section",
},
Object {
"col": 10,
"line": 12,
"type": "class",
"val": "article",
},
Object {
"col": 1,
"line": 13,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 13,
"type": "tag",
"val": "h1",
},
Object {
"buffer": true,
"col": 7,
"line": 13,
"mustEscape": true,
"type": "code",
"val": "name",
},
Object {
"col": 1,
"line": 14,
"type": "newline",
},
Object {
"col": 5,
"line": 14,
"type": "tag",
"val": "p",
},
Object {
"col": 1,
"line": 15,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 15,
"type": "mixin-block",
},
Object {
"col": 5,
"line": 17,
"type": "outdent",
},
Object {
"col": 3,
"line": 17,
"type": "outdent",
},
Object {
"col": 1,
"line": 17,
"type": "outdent",
},
Object {
"col": 1,
"line": 17,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 18,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 18,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 19,
"type": "indent",
"val": 4,
},
Object {
"args": "\'Something\'",
"col": 5,
"line": 19,
"type": "call",
"val": "article",
},
Object {
"col": 26,
"line": 19,
"type": "dot",
},
Object {
"col": 27,
"line": 19,
"type": "start-pipeless-text",
},
Object {
"col": 7,
"line": 20,
"type": "text",
"val": "I\'m a much longer",
},
Object {
"col": 1,
"line": 21,
"type": "newline",
},
Object {
"col": 7,
"line": 21,
"type": "text",
"val": "text-only article,",
},
Object {
"col": 1,
"line": 22,
"type": "newline",
},
Object {
"col": 7,
"line": 22,
"type": "text",
"val": "but you can still",
},
Object {
"col": 1,
"line": 23,
"type": "newline",
},
Object {
"col": 7,
"line": 23,
"type": "text",
"val": "inline html tags",
},
Object {
"col": 1,
"line": 24,
"type": "newline",
},
Object {
"col": 7,
"line": 24,
"type": "text",
"val": "in me if you want.",
},
Object {
"col": 25,
"line": 24,
"type": "end-pipeless-text",
},
Object {
"col": 25,
"line": 24,
"type": "outdent",
},
Object {
"col": 25,
"line": 24,
"type": "outdent",
},
Object {
"col": 25,
"line": 24,
"type": "eos",
},
]
`;
exports[`test mixin.blocks.pug 1`] = `
Array [
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"args": "method, action",
"col": 1,
"line": 3,
"type": "mixin",
"val": "form",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 4,
"type": "tag",
"val": "form",
},
Object {
"col": 7,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 8,
"line": 4,
"mustEscape": true,
"name": "method",
"type": "attribute",
"val": "method",
},
Object {
"col": 23,
"line": 4,
"mustEscape": true,
"name": "action",
"type": "attribute",
"val": "action",
},
Object {
"col": 36,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 4,
},
Object {
"buffer": false,
"col": 5,
"line": 5,
"mustEscape": false,
"type": "code",
"val": "var csrf_token_from_somewhere = \'hey\'",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 5,
"line": 6,
"type": "tag",
"val": "input",
},
Object {
"col": 10,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 11,
"line": 6,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'hidden\'",
},
Object {
"col": 26,
"line": 6,
"mustEscape": true,
"name": "name",
"type": "attribute",
"val": "\'_csrf\'",
},
Object {
"col": 40,
"line": 6,
"mustEscape": true,
"name": "value",
"type": "attribute",
"val": "csrf_token_from_somewhere",
},
Object {
"col": 71,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 5,
"line": 7,
"type": "mixin-block",
},
Object {
"col": 3,
"line": 9,
"type": "outdent",
},
Object {
"col": 1,
"line": 9,
"type": "outdent",
},
Object {
"col": 1,
"line": 9,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 10,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 10,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 11,
"type": "indent",
"val": 4,
},
Object {
"args": "\'GET\', \'/search\'",
"col": 5,
"line": 11,
"type": "call",
"val": "form",
},
Object {
"col": 1,
"line": 12,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 12,
"type": "tag",
"val": "input",
},
Object {
"col": 12,
"line": 12,
"type": "start-attributes",
},
Object {
"col": 13,
"line": 12,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'text\'",
},
Object {
"col": 26,
"line": 12,
"mustEscape": true,
"name": "name",
"type": "attribute",
"val": "\'query\'",
},
Object {
"col": 40,
"line": 12,
"mustEscape": true,
"name": "placeholder",
"type": "attribute",
"val": "\'Search\'",
},
Object {
"col": 60,
"line": 12,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 13,
"type": "newline",
},
Object {
"col": 7,
"line": 13,
"type": "tag",
"val": "input",
},
Object {
"col": 12,
"line": 13,
"type": "start-attributes",
},
Object {
"col": 13,
"line": 13,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'submit\'",
},
Object {
"col": 28,
"line": 13,
"mustEscape": true,
"name": "value",
"type": "attribute",
"val": "\'Search\'",
},
Object {
"col": 42,
"line": 13,
"type": "end-attributes",
},
Object {
"col": 5,
"line": 15,
"type": "outdent",
},
Object {
"col": 3,
"line": 15,
"type": "outdent",
},
Object {
"col": 1,
"line": 15,
"type": "outdent",
},
Object {
"col": 1,
"line": 15,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 16,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 16,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 17,
"type": "indent",
"val": 4,
},
Object {
"args": "\'POST\', \'/search\'",
"col": 5,
"line": 17,
"type": "call",
"val": "form",
},
Object {
"col": 1,
"line": 18,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 18,
"type": "tag",
"val": "input",
},
Object {
"col": 12,
"line": 18,
"type": "start-attributes",
},
Object {
"col": 13,
"line": 18,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'text\'",
},
Object {
"col": 26,
"line": 18,
"mustEscape": true,
"name": "name",
"type": "attribute",
"val": "\'query\'",
},
Object {
"col": 40,
"line": 18,
"mustEscape": true,
"name": "placeholder",
"type": "attribute",
"val": "\'Search\'",
},
Object {
"col": 60,
"line": 18,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 19,
"type": "newline",
},
Object {
"col": 7,
"line": 19,
"type": "tag",
"val": "input",
},
Object {
"col": 12,
"line": 19,
"type": "start-attributes",
},
Object {
"col": 13,
"line": 19,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'submit\'",
},
Object {
"col": 28,
"line": 19,
"mustEscape": true,
"name": "value",
"type": "attribute",
"val": "\'Search\'",
},
Object {
"col": 42,
"line": 19,
"type": "end-attributes",
},
Object {
"col": 5,
"line": 21,
"type": "outdent",
},
Object {
"col": 3,
"line": 21,
"type": "outdent",
},
Object {
"col": 1,
"line": 21,
"type": "outdent",
},
Object {
"col": 1,
"line": 21,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 22,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 22,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 23,
"type": "indent",
"val": 4,
},
Object {
"args": "\'POST\', \'/search\'",
"col": 5,
"line": 23,
"type": "call",
"val": "form",
},
Object {
"col": 3,
"line": 25,
"type": "outdent",
},
Object {
"col": 1,
"line": 25,
"type": "outdent",
},
Object {
"args": null,
"col": 1,
"line": 25,
"type": "mixin",
"val": "bar",
},
Object {
"col": 1,
"line": 26,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 26,
"type": "id",
"val": "bar",
},
Object {
"col": 1,
"line": 27,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 27,
"type": "mixin-block",
},
Object {
"col": 3,
"line": 29,
"type": "outdent",
},
Object {
"col": 1,
"line": 29,
"type": "outdent",
},
Object {
"args": null,
"col": 1,
"line": 29,
"type": "mixin",
"val": "foo",
},
Object {
"col": 1,
"line": 30,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 30,
"type": "id",
"val": "foo",
},
Object {
"col": 1,
"line": 31,
"type": "indent",
"val": 4,
},
Object {
"args": null,
"col": 5,
"line": 31,
"type": "call",
"val": "bar",
},
Object {
"col": 1,
"line": 32,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 32,
"type": "mixin-block",
},
Object {
"col": 5,
"line": 34,
"type": "outdent",
},
Object {
"col": 3,
"line": 34,
"type": "outdent",
},
Object {
"col": 1,
"line": 34,
"type": "outdent",
},
Object {
"args": null,
"col": 1,
"line": 34,
"type": "call",
"val": "foo",
},
Object {
"col": 1,
"line": 35,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 35,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 35,
"type": "text",
"val": "one",
},
Object {
"col": 1,
"line": 36,
"type": "newline",
},
Object {
"col": 3,
"line": 36,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 36,
"type": "text",
"val": "two",
},
Object {
"col": 1,
"line": 37,
"type": "newline",
},
Object {
"col": 3,
"line": 37,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 37,
"type": "text",
"val": "three",
},
Object {
"col": 1,
"line": 40,
"type": "outdent",
},
Object {
"args": null,
"col": 1,
"line": 40,
"type": "mixin",
"val": "baz",
},
Object {
"col": 1,
"line": 41,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 41,
"type": "id",
"val": "baz",
},
Object {
"col": 1,
"line": 42,
"type": "indent",
"val": 8,
},
Object {
"col": 9,
"line": 42,
"type": "mixin-block",
},
Object {
"col": 5,
"line": 44,
"type": "outdent",
},
Object {
"col": 1,
"line": 44,
"type": "outdent",
},
Object {
"args": "",
"col": 1,
"line": 44,
"type": "call",
"val": "baz",
},
Object {
"buffer": true,
"col": 7,
"line": 44,
"mustEscape": true,
"type": "code",
"val": "\'123\'",
},
Object {
"col": 14,
"line": 44,
"type": "eos",
},
]
`;
exports[`test mixin.merge.pug 1`] = `
Array [
Object {
"args": null,
"col": 1,
"line": 1,
"type": "mixin",
"val": "foo",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "p",
},
Object {
"col": 4,
"line": 2,
"type": "class",
"val": "bar",
},
Object {
"col": 8,
"line": 2,
"type": "&attributes",
"val": "attributes",
},
Object {
"col": 32,
"line": 2,
"type": "text",
"val": "One",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 3,
"line": 3,
"type": "tag",
"val": "p",
},
Object {
"col": 4,
"line": 3,
"type": "class",
"val": "baz",
},
Object {
"col": 8,
"line": 3,
"type": "class",
"val": "quux",
},
Object {
"col": 13,
"line": 3,
"type": "&attributes",
"val": "attributes",
},
Object {
"col": 37,
"line": 3,
"type": "text",
"val": "Two",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 3,
"line": 4,
"type": "tag",
"val": "p",
},
Object {
"col": 4,
"line": 4,
"type": "&attributes",
"val": "attributes",
},
Object {
"col": 28,
"line": 4,
"type": "text",
"val": "Three",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 3,
"line": 5,
"type": "tag",
"val": "p",
},
Object {
"col": 4,
"line": 5,
"type": "class",
"val": "bar",
},
Object {
"col": 8,
"line": 5,
"type": "&attributes",
"val": "attributes",
},
Object {
"col": 31,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 32,
"line": 5,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\"baz\"",
},
Object {
"col": 43,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 45,
"line": 5,
"type": "text",
"val": "Four",
},
Object {
"col": 1,
"line": 7,
"type": "outdent",
},
Object {
"col": 1,
"line": 7,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 8,
"type": "indent",
"val": 2,
},
Object {
"args": null,
"col": 3,
"line": 8,
"type": "call",
"val": "foo",
},
Object {
"col": 7,
"line": 8,
"type": "class",
"val": "hello",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"args": null,
"col": 3,
"line": 9,
"type": "call",
"val": "foo",
},
Object {
"col": 7,
"line": 9,
"type": "id",
"val": "world",
},
Object {
"col": 1,
"line": 10,
"type": "newline",
},
Object {
"args": null,
"col": 3,
"line": 10,
"type": "call",
"val": "foo",
},
Object {
"col": 7,
"line": 10,
"type": "class",
"val": "hello",
},
Object {
"col": 13,
"line": 10,
"type": "id",
"val": "world",
},
Object {
"col": 1,
"line": 11,
"type": "newline",
},
Object {
"args": null,
"col": 3,
"line": 11,
"type": "call",
"val": "foo",
},
Object {
"col": 7,
"line": 11,
"type": "class",
"val": "hello",
},
Object {
"col": 13,
"line": 11,
"type": "class",
"val": "world",
},
Object {
"col": 1,
"line": 12,
"type": "newline",
},
Object {
"args": null,
"col": 3,
"line": 12,
"type": "call",
"val": "foo",
},
Object {
"col": 7,
"line": 12,
"type": "start-attributes",
},
Object {
"col": 8,
"line": 12,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\"hello\"",
},
Object {
"col": 21,
"line": 12,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 13,
"type": "newline",
},
Object {
"args": null,
"col": 3,
"line": 13,
"type": "call",
"val": "foo",
},
Object {
"col": 7,
"line": 13,
"type": "class",
"val": "hello",
},
Object {
"col": 13,
"line": 13,
"type": "start-attributes",
},
Object {
"col": 14,
"line": 13,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "\"world\"",
},
Object {
"col": 27,
"line": 13,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 14,
"type": "newline",
},
Object {
"args": null,
"col": 3,
"line": 14,
"type": "call",
"val": "foo",
},
Object {
"col": 1,
"line": 15,
"type": "newline",
},
Object {
"args": null,
"col": 3,
"line": 15,
"type": "call",
"val": "foo",
},
Object {
"col": 7,
"line": 15,
"type": "&attributes",
"val": "{class: \"hello\"}",
},
Object {
"col": 36,
"line": 15,
"type": "outdent",
},
Object {
"col": 36,
"line": 15,
"type": "eos",
},
]
`;
exports[`test mixin-at-end-of-file.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "include",
},
Object {
"col": 9,
"line": 1,
"type": "path",
"val": "./auxiliary/mixin-at-end-of-file.pug",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"args": "",
"col": 1,
"line": 3,
"type": "call",
"val": "slide",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 4,
"type": "tag",
"val": "p",
},
Object {
"col": 5,
"line": 4,
"type": "text",
"val": "some awesome content",
},
Object {
"col": 1,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "eos",
},
]
`;
exports[`test mixin-block-with-space.pug 1`] = `
Array [
Object {
"args": "id",
"col": 1,
"line": 1,
"type": "mixin",
"val": "m",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "div",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "mixin-block",
},
Object {
"col": 3,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "outdent",
},
Object {
"args": "",
"col": 1,
"line": 5,
"type": "call",
"val": "m",
},
Object {
"col": 1,
"line": 6,
"type": "indent",
"val": 2,
},
Object {
"col": 5,
"line": 6,
"type": "text",
"val": "This text should appear",
},
Object {
"col": 28,
"line": 6,
"type": "outdent",
},
Object {
"col": 28,
"line": 6,
"type": "eos",
},
]
`;
exports[`test mixin-hoist.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"args": null,
"col": 1,
"line": 2,
"type": "mixin",
"val": "foo",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 3,
"type": "tag",
"val": "h1",
},
Object {
"buffer": true,
"col": 5,
"line": 3,
"mustEscape": true,
"type": "code",
"val": "title",
},
Object {
"col": 1,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 6,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 6,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 7,
"type": "indent",
"val": 4,
},
Object {
"args": null,
"col": 5,
"line": 7,
"type": "call",
"val": "foo",
},
Object {
"col": 3,
"line": 8,
"type": "outdent",
},
Object {
"col": 1,
"line": 8,
"type": "outdent",
},
Object {
"col": 1,
"line": 8,
"type": "eos",
},
]
`;
exports[`test mixin-via-include.pug 1`] = `
Array [
Object {
"buffer": false,
"col": 1,
"line": 1,
"type": "comment",
"val": " regression test for https://github.com/pugjs/pug/issues/1435",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "include",
},
Object {
"col": 9,
"line": 3,
"type": "path",
"val": "../fixtures/mixin-include.pug",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"args": null,
"col": 1,
"line": 5,
"type": "call",
"val": "bang",
},
Object {
"col": 6,
"line": 5,
"type": "eos",
},
]
`;
exports[`test mixins.pug 1`] = `
Array [
Object {
"args": "title, str",
"col": 1,
"line": 1,
"type": "mixin",
"val": "comment",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "class",
"val": "comment",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "tag",
"val": "h2",
},
Object {
"buffer": true,
"col": 7,
"line": 3,
"mustEscape": true,
"type": "code",
"val": "title",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 5,
"line": 4,
"type": "tag",
"val": "p",
},
Object {
"col": 6,
"line": 4,
"type": "class",
"val": "body",
},
Object {
"buffer": true,
"col": 11,
"line": 4,
"mustEscape": true,
"type": "code",
"val": "str",
},
Object {
"col": 3,
"line": 7,
"type": "outdent",
},
Object {
"col": 1,
"line": 7,
"type": "outdent",
},
Object {
"args": "title, str",
"col": 1,
"line": 7,
"type": "mixin",
"val": "comment",
},
Object {
"col": 1,
"line": 8,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 8,
"type": "class",
"val": "comment",
},
Object {
"col": 1,
"line": 9,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 9,
"type": "tag",
"val": "h2",
},
Object {
"buffer": true,
"col": 7,
"line": 9,
"mustEscape": true,
"type": "code",
"val": "title",
},
Object {
"col": 1,
"line": 10,
"type": "newline",
},
Object {
"col": 5,
"line": 10,
"type": "tag",
"val": "p",
},
Object {
"col": 6,
"line": 10,
"type": "class",
"val": "body",
},
Object {
"buffer": true,
"col": 11,
"line": 10,
"mustEscape": true,
"type": "code",
"val": "str",
},
Object {
"col": 3,
"line": 12,
"type": "outdent",
},
Object {
"col": 1,
"line": 12,
"type": "outdent",
},
Object {
"col": 1,
"line": 12,
"type": "id",
"val": "user",
},
Object {
"col": 1,
"line": 13,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 13,
"type": "tag",
"val": "h1",
},
Object {
"col": 6,
"line": 13,
"type": "text",
"val": "Tobi",
},
Object {
"col": 1,
"line": 14,
"type": "newline",
},
Object {
"col": 3,
"line": 14,
"type": "class",
"val": "comments",
},
Object {
"col": 1,
"line": 15,
"type": "indent",
"val": 4,
},
Object {
"args": "\'This\',
((\'is regular, javascript\'))",
"col": 5,
"line": 15,
"type": "call",
"val": "comment",
},
Object {
"col": 3,
"line": 18,
"type": "outdent",
},
Object {
"col": 1,
"line": 18,
"type": "outdent",
},
Object {
"args": null,
"col": 1,
"line": 18,
"type": "mixin",
"val": "list",
},
Object {
"col": 1,
"line": 19,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 19,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 20,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 20,
"type": "tag",
"val": "li",
},
Object {
"col": 8,
"line": 20,
"type": "text",
"val": "foo",
},
Object {
"col": 1,
"line": 21,
"type": "newline",
},
Object {
"col": 5,
"line": 21,
"type": "tag",
"val": "li",
},
Object {
"col": 8,
"line": 21,
"type": "text",
"val": "bar",
},
Object {
"col": 1,
"line": 22,
"type": "newline",
},
Object {
"col": 5,
"line": 22,
"type": "tag",
"val": "li",
},
Object {
"col": 8,
"line": 22,
"type": "text",
"val": "baz",
},
Object {
"col": 3,
"line": 24,
"type": "outdent",
},
Object {
"col": 1,
"line": 24,
"type": "outdent",
},
Object {
"col": 1,
"line": 24,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 25,
"type": "indent",
"val": 2,
},
Object {
"args": "",
"col": 3,
"line": 25,
"type": "call",
"val": "list",
},
Object {
"col": 1,
"line": 26,
"type": "newline",
},
Object {
"args": "",
"col": 3,
"line": 26,
"type": "call",
"val": "list",
},
Object {
"col": 1,
"line": 28,
"type": "outdent",
},
Object {
"args": "str",
"col": 1,
"line": 28,
"type": "mixin",
"val": "foobar",
},
Object {
"col": 1,
"line": 29,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 29,
"type": "tag",
"val": "div",
},
Object {
"col": 6,
"line": 29,
"type": "id",
"val": "interpolation",
},
Object {
"buffer": true,
"col": 20,
"line": 29,
"mustEscape": true,
"type": "code",
"val": "str + \'interpolated\'",
},
Object {
"col": 1,
"line": 31,
"type": "outdent",
},
Object {
"buffer": false,
"col": 1,
"line": 31,
"mustEscape": false,
"type": "code",
"val": "var suffix = \"bar\"",
},
Object {
"col": 1,
"line": 32,
"type": "newline",
},
Object {
"args": "\'This is \'",
"col": 1,
"line": 32,
"type": "call",
"val": "#{\'foo\' + suffix}",
},
Object {
"col": 1,
"line": 33,
"type": "newline",
},
Object {
"col": 1,
"line": 33,
"type": "eos",
},
]
`;
exports[`test mixins.rest-args.pug 1`] = `
Array [
Object {
"args": "tag, ...items",
"col": 1,
"line": 1,
"type": "mixin",
"val": "list",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "interpolation",
"val": "tag",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"code": "items",
"col": 5,
"key": null,
"line": 3,
"type": "each",
"val": "item",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 4,
"type": "tag",
"val": "li",
},
Object {
"buffer": true,
"col": 9,
"line": 4,
"mustEscape": true,
"type": "code",
"val": "item",
},
Object {
"col": 5,
"line": 6,
"type": "outdent",
},
Object {
"col": 3,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "outdent",
},
Object {
"args": "\'ul\', 1, 2, 3, 4",
"col": 1,
"line": 6,
"type": "call",
"val": "list",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 1,
"line": 7,
"type": "eos",
},
]
`;
exports[`test mixins-unused.pug 1`] = `
Array [
Object {
"args": null,
"col": 1,
"line": 1,
"type": "mixin",
"val": "never-called",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "class",
"val": "wtf",
},
Object {
"col": 8,
"line": 2,
"type": "text",
"val": "This isn\'t something we ever want to output",
},
Object {
"col": 1,
"line": 3,
"type": "outdent",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "body",
},
Object {
"col": 5,
"line": 3,
"type": "eos",
},
]
`;
exports[`test multi-line-interpolation.pug 1`] = `
Object {
"code": "PUG:NO_END_BRACKET",
"column": 65,
"line": 2,
"msg": "End of line was reached with no closing bracket for interpolation.",
}
`;
exports[`test namespaces.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "fb:user:role",
},
Object {
"col": 14,
"line": 1,
"type": "text",
"val": "Something",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "foo",
},
Object {
"col": 4,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 5,
"line": 2,
"mustEscape": true,
"name": "fb:foo",
"type": "attribute",
"val": "\'bar\'",
},
Object {
"col": 17,
"line": 2,
"type": "end-attributes",
},
Object {
"col": 18,
"line": 2,
"type": "eos",
},
]
`;
exports[`test nesting.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "li",
},
Object {
"col": 6,
"line": 2,
"type": "text",
"val": "a",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 3,
"line": 3,
"type": "tag",
"val": "li",
},
Object {
"col": 6,
"line": 3,
"type": "text",
"val": "b",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 3,
"line": 4,
"type": "tag",
"val": "li",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 5,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 6,
"type": "indent",
"val": 8,
},
Object {
"col": 9,
"line": 6,
"type": "tag",
"val": "li",
},
Object {
"col": 12,
"line": 6,
"type": "text",
"val": "c",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 9,
"line": 7,
"type": "tag",
"val": "li",
},
Object {
"col": 12,
"line": 7,
"type": "text",
"val": "d",
},
Object {
"col": 5,
"line": 8,
"type": "outdent",
},
Object {
"col": 3,
"line": 8,
"type": "outdent",
},
Object {
"col": 3,
"line": 8,
"type": "tag",
"val": "li",
},
Object {
"col": 6,
"line": 8,
"type": "text",
"val": "e",
},
Object {
"col": 7,
"line": 8,
"type": "outdent",
},
Object {
"col": 7,
"line": 8,
"type": "eos",
},
]
`;
exports[`test old-prefixed-each.pug 1`] = `
Object {
"code": "PUG:MALFORMED_EACH",
"column": 3,
"line": 2,
"msg": "Pug each and for should no longer be prefixed with a dash (\"-\"). They are pug keywords and not part of JavaScript.",
}
`;
exports[`test open-interpolation.pug 1`] = `
Object {
"code": "PUG:NO_END_BRACKET",
"column": 54,
"line": 1,
"msg": "End of line was reached with no closing bracket for interpolation.",
}
`;
exports[`test pipeless-comments.pug 1`] = `
Array [
Object {
"buffer": true,
"col": 1,
"line": 1,
"type": "comment",
"val": "",
},
Object {
"col": 3,
"line": 1,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 2,
"type": "text",
"val": " .foo",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 3,
"line": 3,
"type": "text",
"val": " .bar",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 3,
"line": 4,
"type": "text",
"val": ".hey",
},
Object {
"col": 7,
"line": 4,
"type": "end-pipeless-text",
},
Object {
"col": 7,
"line": 4,
"type": "eos",
},
]
`;
exports[`test pipeless-filters.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "filter",
"val": "markdown-it",
},
Object {
"col": 13,
"line": 1,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 2,
"type": "text",
"val": " code sample",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 3,
"line": 3,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 3,
"line": 4,
"type": "text",
"val": "# Heading",
},
Object {
"col": 12,
"line": 4,
"type": "end-pipeless-text",
},
Object {
"col": 12,
"line": 4,
"type": "eos",
},
]
`;
exports[`test pipeless-tag.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "pre",
},
Object {
"col": 4,
"line": 1,
"type": "dot",
},
Object {
"col": 5,
"line": 1,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 2,
"type": "text",
"val": " what",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 3,
"line": 3,
"type": "text",
"val": "is ",
},
Object {
"buffer": true,
"col": 6,
"line": 3,
"mustEscape": true,
"type": "interpolated-code",
"val": "\'going\'",
},
Object {
"col": 16,
"line": 3,
"type": "text",
"val": " ",
},
Object {
"col": 17,
"line": 3,
"type": "start-pug-interpolation",
},
Object {
"buffer": true,
"col": 21,
"line": 3,
"mustEscape": true,
"type": "interpolated-code",
"val": "\'on\'",
},
Object {
"col": 28,
"line": 3,
"type": "end-pug-interpolation",
},
Object {
"col": 29,
"line": 3,
"type": "text",
"val": "",
},
Object {
"col": 29,
"line": 3,
"type": "end-pipeless-text",
},
Object {
"col": 29,
"line": 3,
"type": "eos",
},
]
`;
exports[`test pre.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "pre",
},
Object {
"col": 4,
"line": 1,
"type": "dot",
},
Object {
"col": 5,
"line": 1,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 2,
"type": "text",
"val": "foo",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 3,
"line": 3,
"type": "text",
"val": "bar",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 3,
"line": 4,
"type": "text",
"val": "baz",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 3,
"line": 5,
"type": "text",
"val": "",
},
Object {
"col": 3,
"line": 5,
"type": "end-pipeless-text",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 1,
"line": 6,
"type": "tag",
"val": "pre",
},
Object {
"col": 1,
"line": 7,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 7,
"type": "tag",
"val": "code",
},
Object {
"col": 7,
"line": 7,
"type": "dot",
},
Object {
"col": 8,
"line": 7,
"type": "start-pipeless-text",
},
Object {
"col": 5,
"line": 8,
"type": "text",
"val": "foo",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 5,
"line": 9,
"type": "text",
"val": "bar",
},
Object {
"col": 1,
"line": 10,
"type": "newline",
},
Object {
"col": 5,
"line": 10,
"type": "text",
"val": "baz",
},
Object {
"col": 8,
"line": 10,
"type": "end-pipeless-text",
},
Object {
"col": 8,
"line": 10,
"type": "outdent",
},
Object {
"col": 8,
"line": 10,
"type": "eos",
},
]
`;
exports[`test quotes.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 1,
"type": "text",
"val": "\"foo\"",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 2,
"type": "text",
"val": "\'foo\'",
},
Object {
"col": 8,
"line": 2,
"type": "eos",
},
]
`;
exports[`test regression.784.pug 1`] = `
Array [
Object {
"buffer": false,
"col": 1,
"line": 1,
"mustEscape": false,
"type": "code",
"val": "var url = \'http://www.google.com\'",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "class",
"val": "url",
},
Object {
"buffer": true,
"col": 6,
"line": 2,
"mustEscape": true,
"type": "interpolated-code",
"val": "url.replace(\'http://\', \'\').replace(/^www\\./, \'\')",
},
Object {
"col": 57,
"line": 2,
"type": "eos",
},
]
`;
exports[`test regression.1794.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "extends",
},
Object {
"col": 9,
"line": 1,
"type": "path",
"val": "./auxiliary/1794-extends.pug",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"mode": "replace",
"type": "block",
"val": "content",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 4,
"type": "include",
},
Object {
"col": 11,
"line": 4,
"type": "path",
"val": "./auxiliary/1794-include.pug",
},
Object {
"col": 39,
"line": 4,
"type": "outdent",
},
Object {
"col": 39,
"line": 4,
"type": "eos",
},
]
`;
exports[`test script.whitespace.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "script",
},
Object {
"col": 7,
"line": 1,
"type": "dot",
},
Object {
"col": 8,
"line": 1,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 2,
"type": "text",
"val": "if (foo) {",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 3,
"line": 3,
"type": "text",
"val": " ",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 3,
"line": 4,
"type": "text",
"val": " bar();",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 3,
"line": 5,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 3,
"line": 6,
"type": "text",
"val": "}",
},
Object {
"col": 4,
"line": 6,
"type": "end-pipeless-text",
},
Object {
"col": 4,
"line": 6,
"type": "eos",
},
]
`;
exports[`test scripts.non-js.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "script",
},
Object {
"col": 7,
"line": 1,
"type": "id",
"val": "user-template",
},
Object {
"col": 21,
"line": 1,
"type": "start-attributes",
},
Object {
"col": 22,
"line": 1,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'text/template\'",
},
Object {
"col": 42,
"line": 1,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "id",
"val": "user",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "tag",
"val": "h1",
},
Object {
"col": 8,
"line": 3,
"type": "text",
"val": "<%= user.name %>",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 5,
"line": 4,
"type": "tag",
"val": "p",
},
Object {
"col": 7,
"line": 4,
"type": "text",
"val": "<%= user.description %>",
},
Object {
"col": 3,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "tag",
"val": "script",
},
Object {
"col": 7,
"line": 6,
"type": "id",
"val": "user-template",
},
Object {
"col": 21,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 22,
"line": 6,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'text/template\'",
},
Object {
"col": 42,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 43,
"line": 6,
"type": "dot",
},
Object {
"col": 44,
"line": 6,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 7,
"type": "text",
"val": "if (foo) {",
},
Object {
"col": 1,
"line": 8,
"type": "newline",
},
Object {
"col": 3,
"line": 8,
"type": "text",
"val": " bar();",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 3,
"line": 9,
"type": "text",
"val": "}",
},
Object {
"col": 4,
"line": 9,
"type": "end-pipeless-text",
},
Object {
"col": 4,
"line": 9,
"type": "eos",
},
]
`;
exports[`test scripts.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "script",
},
Object {
"col": 7,
"line": 1,
"type": "dot",
},
Object {
"col": 8,
"line": 1,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 2,
"type": "text",
"val": "if (foo) {",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 3,
"line": 3,
"type": "text",
"val": " bar();",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 3,
"line": 4,
"type": "text",
"val": "}",
},
Object {
"col": 4,
"line": 4,
"type": "end-pipeless-text",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 1,
"line": 5,
"type": "tag",
"val": "script",
},
Object {
"buffer": true,
"col": 7,
"line": 5,
"mustEscape": false,
"type": "code",
"val": "\'foo()\'",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 1,
"line": 6,
"type": "tag",
"val": "script",
},
Object {
"col": 8,
"line": 6,
"type": "text",
"val": "foo()",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 1,
"line": 7,
"type": "tag",
"val": "script",
},
Object {
"col": 1,
"line": 8,
"type": "newline",
},
Object {
"col": 1,
"line": 8,
"type": "tag",
"val": "div",
},
Object {
"col": 4,
"line": 8,
"type": "eos",
},
]
`;
exports[`test self-closing-html.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "doctype",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 3,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 4,
"type": "tag",
"val": "br",
},
Object {
"col": 7,
"line": 4,
"type": "slash",
},
Object {
"col": 3,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "eos",
},
]
`;
exports[`test single-period.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "span",
},
Object {
"col": 6,
"line": 1,
"type": "text",
"val": ".",
},
Object {
"col": 7,
"line": 1,
"type": "eos",
},
]
`;
exports[`test source.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "audio",
},
Object {
"col": 8,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 9,
"line": 2,
"mustEscape": true,
"name": "preload",
"type": "attribute",
"val": "\'auto\'",
},
Object {
"col": 25,
"line": 2,
"mustEscape": false,
"name": "autobuffer",
"type": "attribute",
"val": true,
},
Object {
"col": 37,
"line": 2,
"mustEscape": false,
"name": "controls",
"type": "attribute",
"val": true,
},
Object {
"col": 45,
"line": 2,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "tag",
"val": "source",
},
Object {
"col": 11,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 12,
"line": 3,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'foo\'",
},
Object {
"col": 21,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 5,
"line": 4,
"type": "tag",
"val": "source",
},
Object {
"col": 11,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 12,
"line": 4,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'bar\'",
},
Object {
"col": 21,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 22,
"line": 4,
"type": "outdent",
},
Object {
"col": 22,
"line": 4,
"type": "outdent",
},
Object {
"col": 22,
"line": 4,
"type": "eos",
},
]
`;
exports[`test styles.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "head",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "tag",
"val": "style",
},
Object {
"col": 10,
"line": 3,
"type": "dot",
},
Object {
"col": 11,
"line": 3,
"type": "start-pipeless-text",
},
Object {
"col": 7,
"line": 4,
"type": "text",
"val": "body {",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 7,
"line": 5,
"type": "text",
"val": " padding: 50px;",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 7,
"line": 6,
"type": "text",
"val": "}",
},
Object {
"col": 8,
"line": 6,
"type": "end-pipeless-text",
},
Object {
"col": 3,
"line": 7,
"type": "outdent",
},
Object {
"col": 3,
"line": 7,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 8,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 8,
"type": "tag",
"val": "div",
},
Object {
"col": 8,
"line": 8,
"type": "start-attributes",
},
Object {
"col": 9,
"line": 8,
"mustEscape": true,
"name": "style",
"type": "attribute",
"val": "\'color:red;background:green\'",
},
Object {
"col": 43,
"line": 8,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 5,
"line": 9,
"type": "tag",
"val": "div",
},
Object {
"col": 8,
"line": 9,
"type": "start-attributes",
},
Object {
"col": 9,
"line": 9,
"mustEscape": true,
"name": "style",
"type": "attribute",
"val": "{color: \'red\', background: \'green\'}",
},
Object {
"col": 50,
"line": 9,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 10,
"type": "newline",
},
Object {
"col": 5,
"line": 10,
"type": "tag",
"val": "div",
},
Object {
"col": 8,
"line": 10,
"type": "&attributes",
"val": "{style: \'color:red;background:green\'}",
},
Object {
"col": 1,
"line": 11,
"type": "newline",
},
Object {
"col": 5,
"line": 11,
"type": "tag",
"val": "div",
},
Object {
"col": 8,
"line": 11,
"type": "&attributes",
"val": "{style: {color: \'red\', background: \'green\'}}",
},
Object {
"col": 1,
"line": 12,
"type": "newline",
},
Object {
"args": null,
"col": 5,
"line": 12,
"type": "mixin",
"val": "div",
},
Object {
"col": 1,
"line": 13,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 13,
"type": "tag",
"val": "div",
},
Object {
"col": 10,
"line": 13,
"type": "&attributes",
"val": "attributes",
},
Object {
"col": 5,
"line": 14,
"type": "outdent",
},
Object {
"args": null,
"col": 5,
"line": 14,
"type": "call",
"val": "div",
},
Object {
"col": 9,
"line": 14,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 14,
"mustEscape": true,
"name": "style",
"type": "attribute",
"val": "\'color:red;background:green\'",
},
Object {
"col": 44,
"line": 14,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 15,
"type": "newline",
},
Object {
"args": null,
"col": 5,
"line": 15,
"type": "call",
"val": "div",
},
Object {
"col": 9,
"line": 15,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 15,
"mustEscape": true,
"name": "style",
"type": "attribute",
"val": "{color: \'red\', background: \'green\'}",
},
Object {
"col": 51,
"line": 15,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 16,
"type": "newline",
},
Object {
"buffer": false,
"col": 5,
"line": 16,
"mustEscape": false,
"type": "code",
"val": "var bg = \'green\';",
},
Object {
"col": 1,
"line": 17,
"type": "newline",
},
Object {
"col": 5,
"line": 17,
"type": "tag",
"val": "div",
},
Object {
"col": 8,
"line": 17,
"type": "start-attributes",
},
Object {
"col": 9,
"line": 17,
"mustEscape": true,
"name": "style",
"type": "attribute",
"val": "{color: \'red\', background: bg}",
},
Object {
"col": 45,
"line": 17,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 18,
"type": "newline",
},
Object {
"col": 5,
"line": 18,
"type": "tag",
"val": "div",
},
Object {
"col": 8,
"line": 18,
"type": "&attributes",
"val": "{style: {color: \'red\', background: bg}}",
},
Object {
"col": 1,
"line": 19,
"type": "newline",
},
Object {
"args": null,
"col": 5,
"line": 19,
"type": "call",
"val": "div",
},
Object {
"col": 9,
"line": 19,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 19,
"mustEscape": true,
"name": "style",
"type": "attribute",
"val": "{color: \'red\', background: bg}",
},
Object {
"col": 46,
"line": 19,
"type": "end-attributes",
},
Object {
"col": 3,
"line": 20,
"type": "outdent",
},
Object {
"col": 1,
"line": 20,
"type": "outdent",
},
Object {
"col": 1,
"line": 20,
"type": "eos",
},
]
`;
exports[`test tag.interpolation.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 2,
"mustEscape": false,
"type": "code",
"val": "var tag = \'p\'",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 3,
"mustEscape": false,
"type": "code",
"val": "var foo = \'bar\'",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 1,
"line": 5,
"type": "interpolation",
"val": "tag",
},
Object {
"col": 8,
"line": 5,
"type": "text",
"val": "value",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 1,
"line": 6,
"type": "interpolation",
"val": "tag",
},
Object {
"col": 7,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 8,
"line": 6,
"mustEscape": true,
"name": "foo",
"type": "attribute",
"val": "\'bar\'",
},
Object {
"col": 17,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 19,
"line": 6,
"type": "text",
"val": "value",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 1,
"line": 7,
"type": "interpolation",
"val": "foo ? \'a\' : \'li\'",
},
Object {
"col": 20,
"line": 7,
"type": "start-attributes",
},
Object {
"col": 21,
"line": 7,
"mustEscape": true,
"name": "something",
"type": "attribute",
"val": true,
},
Object {
"col": 30,
"line": 7,
"type": "end-attributes",
},
Object {
"col": 32,
"line": 7,
"type": "text",
"val": "here",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"args": "icon",
"col": 1,
"line": 9,
"type": "mixin",
"val": "item",
},
Object {
"col": 1,
"line": 10,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 10,
"type": "tag",
"val": "li",
},
Object {
"col": 1,
"line": 11,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 11,
"type": "if",
"val": "attributes.href",
},
Object {
"col": 1,
"line": 12,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 12,
"type": "tag",
"val": "a",
},
Object {
"col": 8,
"line": 12,
"type": "&attributes",
"val": "attributes",
},
Object {
"col": 1,
"line": 13,
"type": "indent",
"val": 8,
},
Object {
"col": 9,
"line": 13,
"type": "tag",
"val": "img",
},
Object {
"col": 12,
"line": 13,
"type": "class",
"val": "icon",
},
Object {
"col": 17,
"line": 13,
"type": "start-attributes",
},
Object {
"col": 18,
"line": 13,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "icon",
},
Object {
"col": 26,
"line": 13,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 14,
"type": "newline",
},
Object {
"col": 9,
"line": 14,
"type": "mixin-block",
},
Object {
"col": 7,
"line": 15,
"type": "outdent",
},
Object {
"col": 5,
"line": 15,
"type": "outdent",
},
Object {
"col": 5,
"line": 15,
"type": "else",
"val": "",
},
Object {
"col": 1,
"line": 16,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 16,
"type": "tag",
"val": "span",
},
Object {
"col": 11,
"line": 16,
"type": "&attributes",
"val": "attributes",
},
Object {
"col": 1,
"line": 17,
"type": "indent",
"val": 8,
},
Object {
"col": 9,
"line": 17,
"type": "tag",
"val": "img",
},
Object {
"col": 12,
"line": 17,
"type": "class",
"val": "icon",
},
Object {
"col": 17,
"line": 17,
"type": "start-attributes",
},
Object {
"col": 18,
"line": 17,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "icon",
},
Object {
"col": 26,
"line": 17,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 18,
"type": "newline",
},
Object {
"col": 9,
"line": 18,
"type": "mixin-block",
},
Object {
"col": 7,
"line": 20,
"type": "outdent",
},
Object {
"col": 5,
"line": 20,
"type": "outdent",
},
Object {
"col": 3,
"line": 20,
"type": "outdent",
},
Object {
"col": 1,
"line": 20,
"type": "outdent",
},
Object {
"col": 1,
"line": 20,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 21,
"type": "indent",
"val": 2,
},
Object {
"args": "\'contact\'",
"col": 3,
"line": 21,
"type": "call",
"val": "item",
},
Object {
"col": 20,
"line": 21,
"type": "text",
"val": "Contact",
},
Object {
"col": 1,
"line": 22,
"type": "newline",
},
Object {
"args": null,
"col": 3,
"line": 22,
"type": "call",
"val": "item",
},
Object {
"col": 8,
"line": 22,
"type": "start-attributes",
},
Object {
"col": 9,
"line": 22,
"mustEscape": true,
"name": "href",
"type": "attribute",
"val": "\'/contact\'",
},
Object {
"col": 24,
"line": 22,
"type": "end-attributes",
},
Object {
"col": 26,
"line": 22,
"type": "text",
"val": "Contact",
},
Object {
"col": 1,
"line": 23,
"type": "outdent",
},
Object {
"col": 1,
"line": 23,
"type": "eos",
},
]
`;
exports[`test tag-blocks.pug 1`] = `
Array [
Object {
"buffer": true,
"col": 1,
"line": 1,
"type": "comment",
"val": " we should not get blocks within blocks",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "div",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 2,
},
Object {
"col": 5,
"line": 3,
"type": "text",
"val": "We have sent an e-mail to ",
},
Object {
"col": 31,
"line": 3,
"type": "start-pug-interpolation",
},
Object {
"col": 33,
"line": 3,
"type": "tag",
"val": "strong",
},
Object {
"buffer": true,
"col": 39,
"line": 3,
"mustEscape": true,
"type": "code",
"val": "this.props.email",
},
Object {
"col": 57,
"line": 3,
"type": "end-pug-interpolation",
},
Object {
"col": 58,
"line": 3,
"type": "text",
"val": ". Please click the link in the e-mail",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"buffer": true,
"col": 3,
"line": 4,
"mustEscape": true,
"type": "code",
"val": "\' \'",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 5,
"line": 5,
"type": "text",
"val": "to confirm your e-mail address.",
},
Object {
"col": 1,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "eos",
},
]
`;
exports[`test tags.self-closing.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 3,
"type": "tag",
"val": "foo",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 3,
"line": 4,
"type": "tag",
"val": "foo",
},
Object {
"col": 6,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 7,
"line": 4,
"mustEscape": true,
"name": "bar",
"type": "attribute",
"val": "\'baz\'",
},
Object {
"col": 16,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 3,
"line": 5,
"type": "tag",
"val": "foo",
},
Object {
"col": 6,
"line": 5,
"type": "slash",
},
Object {
"col": 1,
"line": 6,
"type": "newline",
},
Object {
"col": 3,
"line": 6,
"type": "tag",
"val": "foo",
},
Object {
"col": 6,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 7,
"line": 6,
"mustEscape": true,
"name": "bar",
"type": "attribute",
"val": "\'baz\'",
},
Object {
"col": 16,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 17,
"line": 6,
"type": "slash",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 3,
"line": 7,
"type": "tag",
"val": "foo",
},
Object {
"col": 7,
"line": 7,
"type": "text",
"val": "/",
},
Object {
"col": 1,
"line": 8,
"type": "newline",
},
Object {
"col": 3,
"line": 8,
"type": "tag",
"val": "foo",
},
Object {
"col": 6,
"line": 8,
"type": "start-attributes",
},
Object {
"col": 7,
"line": 8,
"mustEscape": true,
"name": "bar",
"type": "attribute",
"val": "\'baz\'",
},
Object {
"col": 16,
"line": 8,
"type": "end-attributes",
},
Object {
"col": 18,
"line": 8,
"type": "text",
"val": "/",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 3,
"line": 9,
"type": "interpolation",
"val": "\'foo\'",
},
Object {
"col": 11,
"line": 9,
"type": "slash",
},
Object {
"col": 1,
"line": 10,
"type": "newline",
},
Object {
"col": 3,
"line": 10,
"type": "interpolation",
"val": "\'foo\'",
},
Object {
"col": 11,
"line": 10,
"type": "start-attributes",
},
Object {
"col": 12,
"line": 10,
"mustEscape": true,
"name": "bar",
"type": "attribute",
"val": "\'baz\'",
},
Object {
"col": 21,
"line": 10,
"type": "end-attributes",
},
Object {
"col": 22,
"line": 10,
"type": "slash",
},
Object {
"col": 1,
"line": 11,
"type": "newline",
},
Object {
"col": 3,
"line": 11,
"type": "interpolation",
"val": "\'foo\'",
},
Object {
"col": 12,
"line": 11,
"type": "text",
"val": "/",
},
Object {
"col": 1,
"line": 12,
"type": "newline",
},
Object {
"col": 3,
"line": 12,
"type": "interpolation",
"val": "\'foo\'",
},
Object {
"col": 11,
"line": 12,
"type": "start-attributes",
},
Object {
"col": 12,
"line": 12,
"mustEscape": true,
"name": "bar",
"type": "attribute",
"val": "\'baz\'",
},
Object {
"col": 21,
"line": 12,
"type": "end-attributes",
},
Object {
"col": 23,
"line": 12,
"type": "text",
"val": "/",
},
Object {
"col": 1,
"line": 13,
"type": "newline",
},
Object {
"buffer": false,
"col": 3,
"line": 13,
"type": "comment",
"val": " can have a single space after them",
},
Object {
"col": 1,
"line": 14,
"type": "newline",
},
Object {
"col": 3,
"line": 14,
"type": "tag",
"val": "img",
},
Object {
"col": 6,
"line": 14,
"type": "text",
"val": " ",
},
Object {
"col": 1,
"line": 15,
"type": "newline",
},
Object {
"buffer": false,
"col": 3,
"line": 15,
"type": "comment",
"val": " can have lots of white space after them",
},
Object {
"col": 1,
"line": 16,
"type": "newline",
},
Object {
"col": 3,
"line": 16,
"type": "tag",
"val": "img",
},
Object {
"col": 7,
"line": 16,
"type": "text",
"val": " ",
},
Object {
"col": 1,
"line": 17,
"type": "newline",
},
Object {
"col": 3,
"line": 17,
"type": "interpolation",
"val": "
\'foo\'
",
},
Object {
"col": 4,
"line": 19,
"type": "slash",
},
Object {
"col": 1,
"line": 20,
"type": "outdent",
},
Object {
"col": 1,
"line": 20,
"type": "eos",
},
]
`;
exports[`test template.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "script",
},
Object {
"col": 7,
"line": 1,
"type": "start-attributes",
},
Object {
"col": 8,
"line": 1,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'text/x-template\'",
},
Object {
"col": 30,
"line": 1,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "article",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "tag",
"val": "h2",
},
Object {
"col": 8,
"line": 3,
"type": "text",
"val": "{{title}}",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 5,
"line": 4,
"type": "tag",
"val": "p",
},
Object {
"col": 7,
"line": 4,
"type": "text",
"val": "{{description}}",
},
Object {
"col": 3,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "tag",
"val": "script",
},
Object {
"col": 7,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 8,
"line": 6,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'text/x-template\'",
},
Object {
"col": 30,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 31,
"line": 6,
"type": "dot",
},
Object {
"col": 32,
"line": 6,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 7,
"type": "text",
"val": "article",
},
Object {
"col": 1,
"line": 8,
"type": "newline",
},
Object {
"col": 3,
"line": 8,
"type": "text",
"val": " h2 {{title}}",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 3,
"line": 9,
"type": "text",
"val": " p {{description}}",
},
Object {
"col": 22,
"line": 9,
"type": "end-pipeless-text",
},
Object {
"col": 22,
"line": 9,
"type": "eos",
},
]
`;
exports[`test text.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "option",
},
Object {
"col": 7,
"line": 1,
"type": "start-attributes",
},
Object {
"col": 8,
"line": 1,
"mustEscape": true,
"name": "value",
"type": "attribute",
"val": "\'\'",
},
Object {
"col": 16,
"line": 1,
"type": "end-attributes",
},
Object {
"col": 18,
"line": 1,
"type": "text",
"val": "-- (selected) --",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "p",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 1,
"line": 5,
"type": "tag",
"val": "p",
},
Object {
"col": 2,
"line": 5,
"type": "dot",
},
Object {
"col": 1,
"line": 7,
"type": "newline",
},
Object {
"col": 1,
"line": 7,
"type": "tag",
"val": "p",
},
Object {
"col": 1,
"line": 8,
"type": "indent",
"val": 2,
},
Object {
"col": 5,
"line": 8,
"type": "text",
"val": "foo",
},
Object {
"col": 1,
"line": 9,
"type": "newline",
},
Object {
"col": 5,
"line": 9,
"type": "text",
"val": "bar",
},
Object {
"col": 1,
"line": 10,
"type": "newline",
},
Object {
"col": 4,
"line": 10,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 11,
"type": "newline",
},
Object {
"col": 4,
"line": 11,
"type": "text",
"val": " ",
},
Object {
"col": 1,
"line": 12,
"type": "newline",
},
Object {
"col": 5,
"line": 12,
"type": "text",
"val": "baz",
},
Object {
"col": 1,
"line": 14,
"type": "outdent",
},
Object {
"col": 1,
"line": 14,
"type": "tag",
"val": "p",
},
Object {
"col": 2,
"line": 14,
"type": "dot",
},
Object {
"col": 3,
"line": 14,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 15,
"type": "text",
"val": "foo",
},
Object {
"col": 1,
"line": 16,
"type": "newline",
},
Object {
"col": 3,
"line": 16,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 17,
"type": "newline",
},
Object {
"col": 3,
"line": 17,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 18,
"type": "newline",
},
Object {
"col": 3,
"line": 18,
"type": "text",
"val": "bar",
},
Object {
"col": 1,
"line": 19,
"type": "newline",
},
Object {
"col": 3,
"line": 19,
"type": "text",
"val": "baz",
},
Object {
"col": 1,
"line": 20,
"type": "newline",
},
Object {
"col": 3,
"line": 20,
"type": "text",
"val": "",
},
Object {
"col": 3,
"line": 20,
"type": "end-pipeless-text",
},
Object {
"col": 1,
"line": 21,
"type": "newline",
},
Object {
"col": 1,
"line": 21,
"type": "dot",
},
Object {
"col": 1,
"line": 23,
"type": "newline",
},
Object {
"col": 1,
"line": 23,
"type": "dot",
},
Object {
"col": 2,
"line": 23,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 24,
"type": "text",
"val": "foo",
},
Object {
"col": 1,
"line": 25,
"type": "newline",
},
Object {
"col": 3,
"line": 25,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 26,
"type": "newline",
},
Object {
"col": 3,
"line": 26,
"type": "text",
"val": "",
},
Object {
"col": 1,
"line": 27,
"type": "newline",
},
Object {
"col": 3,
"line": 27,
"type": "text",
"val": "bar",
},
Object {
"col": 1,
"line": 28,
"type": "newline",
},
Object {
"col": 3,
"line": 28,
"type": "text",
"val": "baz",
},
Object {
"col": 1,
"line": 29,
"type": "newline",
},
Object {
"col": 3,
"line": 29,
"type": "text",
"val": "",
},
Object {
"col": 3,
"line": 29,
"type": "end-pipeless-text",
},
Object {
"col": 1,
"line": 30,
"type": "newline",
},
Object {
"col": 1,
"line": 30,
"type": "tag",
"val": "pre",
},
Object {
"col": 1,
"line": 31,
"type": "indent",
"val": 2,
},
Object {
"col": 5,
"line": 31,
"type": "text",
"val": "foo",
},
Object {
"col": 1,
"line": 32,
"type": "newline",
},
Object {
"col": 5,
"line": 32,
"type": "text",
"val": " bar",
},
Object {
"col": 1,
"line": 33,
"type": "newline",
},
Object {
"col": 5,
"line": 33,
"type": "text",
"val": " baz",
},
Object {
"col": 1,
"line": 34,
"type": "newline",
},
Object {
"col": 5,
"line": 34,
"type": "text",
"val": ".",
},
Object {
"col": 1,
"line": 36,
"type": "outdent",
},
Object {
"col": 1,
"line": 36,
"type": "tag",
"val": "pre",
},
Object {
"col": 4,
"line": 36,
"type": "dot",
},
Object {
"col": 5,
"line": 36,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 37,
"type": "text",
"val": "foo",
},
Object {
"col": 1,
"line": 38,
"type": "newline",
},
Object {
"col": 3,
"line": 38,
"type": "text",
"val": " bar",
},
Object {
"col": 1,
"line": 39,
"type": "newline",
},
Object {
"col": 3,
"line": 39,
"type": "text",
"val": " baz",
},
Object {
"col": 1,
"line": 40,
"type": "newline",
},
Object {
"col": 3,
"line": 40,
"type": "text",
"val": ".",
},
Object {
"col": 1,
"line": 41,
"type": "newline",
},
Object {
"col": 3,
"line": 41,
"type": "text",
"val": "",
},
Object {
"col": 3,
"line": 41,
"type": "end-pipeless-text",
},
Object {
"col": 1,
"line": 42,
"type": "newline",
},
Object {
"col": 1,
"line": 42,
"type": "dot",
},
Object {
"col": 2,
"line": 42,
"type": "start-pipeless-text",
},
Object {
"col": 3,
"line": 43,
"type": "text",
"val": "foo",
},
Object {
"col": 1,
"line": 44,
"type": "newline",
},
Object {
"col": 3,
"line": 44,
"type": "text",
"val": " bar",
},
Object {
"col": 1,
"line": 45,
"type": "newline",
},
Object {
"col": 3,
"line": 45,
"type": "text",
"val": " baz",
},
Object {
"col": 1,
"line": 46,
"type": "newline",
},
Object {
"col": 3,
"line": 46,
"type": "text",
"val": ".",
},
Object {
"col": 4,
"line": 46,
"type": "end-pipeless-text",
},
Object {
"col": 4,
"line": 46,
"type": "eos",
},
]
`;
exports[`test text-block.pug 1`] = `
Array [
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "label",
},
Object {
"col": 7,
"line": 2,
"type": "text",
"val": "Username:",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 3,
"type": "tag",
"val": "input",
},
Object {
"col": 8,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 9,
"line": 3,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'text\'",
},
Object {
"col": 22,
"line": 3,
"mustEscape": true,
"name": "name",
"type": "attribute",
"val": "\'user[name]\'",
},
Object {
"col": 39,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "tag",
"val": "label",
},
Object {
"col": 7,
"line": 5,
"type": "text",
"val": "Password:",
},
Object {
"col": 1,
"line": 6,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 6,
"type": "tag",
"val": "input",
},
Object {
"col": 8,
"line": 6,
"type": "start-attributes",
},
Object {
"col": 9,
"line": 6,
"mustEscape": true,
"name": "type",
"type": "attribute",
"val": "\'text\'",
},
Object {
"col": 22,
"line": 6,
"mustEscape": true,
"name": "name",
"type": "attribute",
"val": "\'user[pass]\'",
},
Object {
"col": 39,
"line": 6,
"type": "end-attributes",
},
Object {
"col": 40,
"line": 6,
"type": "outdent",
},
Object {
"col": 40,
"line": 6,
"type": "eos",
},
]
`;
exports[`test utf8bom.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "p",
},
Object {
"col": 3,
"line": 1,
"type": "text",
"val": "\"foo\"",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "eos",
},
]
`;
exports[`test vars.pug 1`] = `
Array [
Object {
"buffer": false,
"col": 1,
"line": 1,
"mustEscape": false,
"type": "code",
"val": "var foo = \'bar\'",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"buffer": false,
"col": 1,
"line": 2,
"mustEscape": false,
"type": "code",
"val": "var list = [1,2,3]",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "a",
},
Object {
"col": 2,
"line": 3,
"type": "start-attributes",
},
Object {
"col": 3,
"line": 3,
"mustEscape": true,
"name": "class",
"type": "attribute",
"val": "list",
},
Object {
"col": 15,
"line": 3,
"mustEscape": true,
"name": "id",
"type": "attribute",
"val": "foo",
},
Object {
"col": 21,
"line": 3,
"type": "end-attributes",
},
Object {
"col": 22,
"line": 3,
"type": "eos",
},
]
`;
exports[`test when-with-no-expression.pug 1`] = `
Object {
"code": "PUG:NO_WHEN_EXPRESSION",
"column": 5,
"line": 1,
"msg": "missing expression for when",
}
`;
exports[`test while.pug 1`] = `
Array [
Object {
"buffer": false,
"col": 1,
"line": 1,
"mustEscape": false,
"type": "code",
"val": "var x = 1;",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "ul",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 3,
"type": "while",
"val": "x < 10",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 4,
},
Object {
"buffer": false,
"col": 5,
"line": 4,
"mustEscape": false,
"type": "code",
"val": "x++;",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 5,
"line": 5,
"type": "tag",
"val": "li",
},
Object {
"buffer": true,
"col": 7,
"line": 5,
"mustEscape": true,
"type": "code",
"val": "x",
},
Object {
"col": 3,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "eos",
},
]
`;
exports[`test while-with-no-expression.pug 1`] = `
Object {
"code": "PUG:NO_WHILE_EXPRESSION",
"column": 6,
"line": 1,
"msg": "missing expression for while",
}
`;
exports[`test xml.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "doctype",
"val": "xml",
},
Object {
"col": 1,
"line": 2,
"type": "newline",
},
Object {
"col": 1,
"line": 2,
"type": "tag",
"val": "category",
},
Object {
"col": 9,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 2,
"mustEscape": true,
"name": "term",
"type": "attribute",
"val": "\'some term\'",
},
Object {
"col": 26,
"line": 2,
"type": "end-attributes",
},
Object {
"col": 27,
"line": 2,
"type": "slash",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 1,
"line": 3,
"type": "tag",
"val": "link",
},
Object {
"col": 6,
"line": 3,
"type": "text",
"val": "http://google.com",
},
Object {
"col": 23,
"line": 3,
"type": "eos",
},
]
`;
exports[`test yield.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "include",
},
Object {
"col": 13,
"line": 3,
"type": "path",
"val": "yield-head.pug",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 4,
"type": "tag",
"val": "script",
},
Object {
"col": 13,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 14,
"line": 4,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'/caustic.js\'",
},
Object {
"col": 31,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 7,
"line": 5,
"type": "tag",
"val": "script",
},
Object {
"col": 13,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 14,
"line": 5,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'/app.js\'",
},
Object {
"col": 27,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 5,
"line": 6,
"type": "outdent",
},
Object {
"col": 3,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "eos",
},
]
`;
exports[`test yield-before-conditional.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "include",
},
Object {
"col": 13,
"line": 3,
"type": "path",
"val": "yield-before-conditional-head.pug",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 6,
},
Object {
"col": 7,
"line": 4,
"type": "tag",
"val": "script",
},
Object {
"col": 13,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 14,
"line": 4,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'/caustic.js\'",
},
Object {
"col": 31,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 7,
"line": 5,
"type": "tag",
"val": "script",
},
Object {
"col": 13,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 14,
"line": 5,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'/app.js\'",
},
Object {
"col": 27,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 5,
"line": 6,
"type": "outdent",
},
Object {
"col": 3,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "eos",
},
]
`;
exports[`test yield-before-conditional-head.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "head",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 2,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'/jquery.js\'",
},
Object {
"col": 26,
"line": 2,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 3,
"line": 3,
"type": "yield",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 3,
"line": 4,
"type": "if",
"val": "false",
},
Object {
"col": 1,
"line": 5,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 5,
"type": "tag",
"val": "script",
},
Object {
"col": 11,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 12,
"line": 5,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'/jquery.ui.js\'",
},
Object {
"col": 31,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 3,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "eos",
},
]
`;
exports[`test yield-head.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "head",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 2,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 2,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'/jquery.js\'",
},
Object {
"col": 26,
"line": 2,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 3,
"type": "newline",
},
Object {
"col": 3,
"line": 3,
"type": "yield",
},
Object {
"col": 1,
"line": 4,
"type": "newline",
},
Object {
"col": 3,
"line": 4,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 4,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'/jquery.ui.js\'",
},
Object {
"col": 29,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "eos",
},
]
`;
exports[`test yield-title.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "html",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "body",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "include",
},
Object {
"col": 13,
"line": 3,
"type": "path",
"val": "yield-title-head.pug",
},
Object {
"col": 1,
"line": 4,
"type": "indent",
"val": 6,
},
Object {
"col": 9,
"line": 4,
"type": "text",
"val": "My Title",
},
Object {
"col": 5,
"line": 5,
"type": "outdent",
},
Object {
"col": 3,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "outdent",
},
Object {
"col": 1,
"line": 5,
"type": "eos",
},
]
`;
exports[`test yield-title-head.pug 1`] = `
Array [
Object {
"col": 1,
"line": 1,
"type": "tag",
"val": "head",
},
Object {
"col": 1,
"line": 2,
"type": "indent",
"val": 2,
},
Object {
"col": 3,
"line": 2,
"type": "tag",
"val": "title",
},
Object {
"col": 1,
"line": 3,
"type": "indent",
"val": 4,
},
Object {
"col": 5,
"line": 3,
"type": "yield",
},
Object {
"col": 3,
"line": 4,
"type": "outdent",
},
Object {
"col": 3,
"line": 4,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 4,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 4,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'/jquery.js\'",
},
Object {
"col": 26,
"line": 4,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 5,
"type": "newline",
},
Object {
"col": 3,
"line": 5,
"type": "tag",
"val": "script",
},
Object {
"col": 9,
"line": 5,
"type": "start-attributes",
},
Object {
"col": 10,
"line": 5,
"mustEscape": true,
"name": "src",
"type": "attribute",
"val": "\'/jquery.ui.js\'",
},
Object {
"col": 29,
"line": 5,
"type": "end-attributes",
},
Object {
"col": 1,
"line": 6,
"type": "outdent",
},
Object {
"col": 1,
"line": 6,
"type": "eos",
},
]
`;