pixsy/node_modules/pug-parser/try.js

30 lines
487 B
JavaScript
Raw Normal View History

2017-12-22 17:22:08 +00:00
var lex = require('../pug-lexer');
var parse = require('./');
var filename = 'my-file.pug';
var src = `
-
import { Block } from 'dwayne';
import { Block } from 'dwayne';
div(data-foo="bar", k=a.c)
a&attributes(attrs)
:cdata
123
`;
var src = `
script
:cdata:uglify-js
function myFunc(foo) {
return foo;
}
`;
var tokens = lex(src, {filename});
console.log(tokens);
var ast = parse(tokens, {filename, src});
console.log(JSON.stringify(ast, null, ' '));