pug-parser
The pug parser (takes an array of tokens and converts it to an abstract syntax tree)
Installation
npm install pug-parser
Usage
var parse = ;
parse(tokens, options)
Convert Pug tokens to an abstract syntax tree (AST).
options
can contain the following properties:
filename
(string): The name of the Pug file; it is included in the produced AST nodes and error handling, if provided.plugins
(array): An array of plugins, in the order they should be applied.src
(string): The source of the Pug file; it is used in error handling if provided.
var lex = ; var filename = 'my-file.pug';var src = 'div(data-foo="bar")';var tokens = ; var ast = ; console
new parse.Parser(tokens, options)
Constructor for a Parser class. This is not meant to be used directly unless you know what you are doing.
options
may contain the following properties:
filename
(string): The name of the Pug file; it is included in the produced AST nodes and error handling, if provided.plugins
(array): An array of plugins, in the order they should be applied.src
(string): The source of the Pug file; it is used in error handling if provided.
License
MIT