pug-lexer
The pug lexer. This module is responsible for taking a string and converting it into an array of tokens.
Installation
npm install pug-lexer
Usage
var lex = ;
lex(str, filename, options)
Convert Pug string to an array of tokens.
filename
, if provided, is used in error handling.
options
can contain the following property:
plugins
(array): An array of plugins, in the order they should be applied.
console
new lex.Lexer(str, filename, options)
Constructor for a Lexer class. This is not meant to be used directly unless you know what you are doing.
options
may contain the following properties:
interpolated
(boolean): if the Lexer is created as a child lexer for inline tag interpolation (e.g.#[p Hello]
). Defaults tofalse
.startingLine
(integer): the real line number of the first line in the input. It is also used for inline tag interpolation. Defaults to1
.plugins
(array): An array of plugins, in the order they should be applied.
License
MIT