Initial commit
This commit is contained in:
11
node_modules/pug-parser/HISTORY.md
generated
vendored
Normal file
11
node_modules/pug-parser/HISTORY.md
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
2.0.1 / 2016-06-01
|
||||
==================
|
||||
|
||||
* Add a brief API introduction to README
|
||||
|
||||
2.0.0 / 2016-05-14
|
||||
==================
|
||||
|
||||
* Take the `filename` as an option rather than special casing it. This means that parse only takes 2 arguments rather than 3
|
||||
* Add type checking on arguments
|
||||
* Treat the legacy `.jade` extension as `.pug` rather than a raw include
|
19
node_modules/pug-parser/LICENSE
generated
vendored
Normal file
19
node_modules/pug-parser/LICENSE
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (c) 2014 Forbes Lindesay
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
90
node_modules/pug-parser/README.md
generated
vendored
Normal file
90
node_modules/pug-parser/README.md
generated
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
# pug-parser
|
||||
|
||||
The pug parser (takes an array of tokens and converts it to an abstract syntax tree)
|
||||
|
||||
[](https://travis-ci.org/pugjs/pug-parser)
|
||||
[](https://david-dm.org/pugjs/pug?path=packages/pug-parser)
|
||||
[](https://david-dm.org/pugjs/pug?path=packages/pug-parser&type=dev)
|
||||
[](https://www.npmjs.org/package/pug-parser)
|
||||
|
||||
## Installation
|
||||
|
||||
npm install pug-parser
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var parse = require('pug-parser');
|
||||
```
|
||||
|
||||
### `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.
|
||||
|
||||
```js
|
||||
var lex = require('pug-lexer');
|
||||
|
||||
var filename = 'my-file.pug';
|
||||
var src = 'div(data-foo="bar")';
|
||||
var tokens = lex(src, {filename});
|
||||
|
||||
var ast = parse(tokens, {filename, src});
|
||||
|
||||
console.log(JSON.stringify(ast, null, ' '))
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "Block",
|
||||
"nodes": [
|
||||
{
|
||||
"type": "Tag",
|
||||
"name": "div",
|
||||
"selfClosing": false,
|
||||
"block": {
|
||||
"type": "Block",
|
||||
"nodes": [],
|
||||
"line": 1,
|
||||
"filename": "my-file.pug"
|
||||
},
|
||||
"attrs": [
|
||||
{
|
||||
"name": "data-foo",
|
||||
"val": "\"bar\"",
|
||||
"line": 1,
|
||||
"column": 5,
|
||||
"filename": "my-file.pug",
|
||||
"mustEscape": true
|
||||
}
|
||||
],
|
||||
"attributeBlocks": [],
|
||||
"isInline": false,
|
||||
"line": 1,
|
||||
"column": 1,
|
||||
"filename": "my-file.pug"
|
||||
}
|
||||
],
|
||||
"line": 0,
|
||||
"filename": "my-file.pug"
|
||||
}
|
||||
```
|
||||
|
||||
### `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
|
1300
node_modules/pug-parser/index.js
generated
vendored
Normal file
1300
node_modules/pug-parser/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
23
node_modules/pug-parser/lib/inline-tags.js
generated
vendored
Normal file
23
node_modules/pug-parser/lib/inline-tags.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = [
|
||||
'a',
|
||||
'abbr',
|
||||
'acronym',
|
||||
'b',
|
||||
'br',
|
||||
'code',
|
||||
'em',
|
||||
'font',
|
||||
'i',
|
||||
'img',
|
||||
'ins',
|
||||
'kbd',
|
||||
'map',
|
||||
'samp',
|
||||
'small',
|
||||
'span',
|
||||
'strong',
|
||||
'sub',
|
||||
'sup',
|
||||
];
|
23
node_modules/pug-parser/package.json
generated
vendored
Normal file
23
node_modules/pug-parser/package.json
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "pug-parser",
|
||||
"version": "6.0.0",
|
||||
"description": "The pug parser (takes an array of tokens and converts it to an abstract syntax tree)",
|
||||
"keywords": [
|
||||
"pug"
|
||||
],
|
||||
"dependencies": {
|
||||
"pug-error": "^2.0.0",
|
||||
"token-stream": "1.0.0"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"files": [
|
||||
"lib/inline-tags.js",
|
||||
"index.js"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pugjs/pug/tree/master/packages/pug-parser"
|
||||
},
|
||||
"author": "ForbesLindesay",
|
||||
"license": "MIT"
|
||||
}
|
Reference in New Issue
Block a user