{"name":"pug-parser","version":"6.0.0-canary-2","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-canary-2","token-stream":"1.0.0"},"devDependencies":{},"repository":{"type":"git","url":"https://github.com/pugjs/pug/tree/master/packages/pug-parser"},"author":{"name":"ForbesLindesay"},"license":"MIT","readme":"# pug-parser\n\nThe pug parser (takes an array of tokens and converts it to an abstract syntax tree)\n\n[![Build Status](https://img.shields.io/travis/pugjs/pug-parser/master.svg)](https://travis-ci.org/pugjs/pug-parser)\n[![Dependencies Status](https://david-dm.org/pugjs/pug/status.svg?path=packages/pug-parser)](https://david-dm.org/pugjs/pug?path=packages/pug-parser)\n[![DevDependencies Status](https://david-dm.org/pugjs/pug/dev-status.svg?path=packages/pug-parser)](https://david-dm.org/pugjs/pug?path=packages/pug-parser&type=dev)\n[![NPM version](https://img.shields.io/npm/v/pug-parser.svg)](https://www.npmjs.org/package/pug-parser)\n\n## Installation\n\n    npm install pug-parser\n\n## Usage\n\n```js\nvar parse = require('pug-parser');\n```\n\n### `parse(tokens, options)`\n\nConvert Pug tokens to an abstract syntax tree (AST).\n\n`options` can contain the following properties:\n\n- `filename` (string): The name of the Pug file; it is included in the produced AST nodes and error handling, if provided.\n- `plugins` (array): An array of plugins, in the order they should be applied.\n- `src` (string): The source of the Pug file; it is used in error handling if provided.\n\n```js\nvar lex = require('pug-lexer');\n\nvar filename = 'my-file.pug';\nvar src = 'div(data-foo=\"bar\")';\nvar tokens = lex(src, {filename});\n\nvar ast = parse(tokens, {filename, src});\n\nconsole.log(JSON.stringify(ast, null, '  '))\n```\n\n```json\n{\n  \"type\": \"Block\",\n  \"nodes\": [\n    {\n      \"type\": \"Tag\",\n      \"name\": \"div\",\n      \"selfClosing\": false,\n      \"block\": {\n        \"type\": \"Block\",\n        \"nodes\": [],\n        \"line\": 1,\n        \"filename\": \"my-file.pug\"\n      },\n      \"attrs\": [\n        {\n          \"name\": \"data-foo\",\n          \"val\": \"\\\"bar\\\"\",\n          \"line\": 1,\n          \"column\": 5,\n          \"filename\": \"my-file.pug\",\n          \"mustEscape\": true\n        }\n      ],\n      \"attributeBlocks\": [],\n      \"isInline\": false,\n      \"line\": 1,\n      \"column\": 1,\n      \"filename\": \"my-file.pug\"\n    }\n  ],\n  \"line\": 0,\n  \"filename\": \"my-file.pug\"\n}\n```\n\n### `new parse.Parser(tokens, options)`\n\nConstructor for a Parser class. This is not meant to be used directly unless you know what you are doing.\n\n`options` may contain the following properties:\n\n- `filename` (string): The name of the Pug file; it is included in the produced AST nodes and error handling, if provided.\n- `plugins` (array): An array of plugins, in the order they should be applied.\n- `src` (string): The source of the Pug file; it is used in error handling if provided.\n\n## License\n\n  MIT\n","readmeFilename":"README.md","_id":"pug-parser@6.0.0-canary-2","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"integrity":"sha512-rVIgPyhTXsk/Psa6bmhovNpOIboWKvIPewHAiGKk5Hnvu3iz/MAHoA8FJxegtd0kZubenVXRKXYlz1Rn0/Hh2w==","shasum":"33218d9bb5233d4dc581944f4e57b996153a1c27","tarball":"http://registry-npm.ywwl.com/pug-parser/download/pug-parser-6.0.0-canary-2.tgz","fileCount":6,"unpackedSize":35830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJey7e0CRA9TVsSAnZWagAAvfwP/2BlaxfqdIfQIstVB8gX\nvA++2AmWV9m+h2ghRMlxGDtnhxME/PPEY66mHGPXHBlV2xtf1XgGNGqYg8pD\nFBhFD7XK+CWfjcNFrXvPktL7todnxWTC1jVVGYxJcOBLSWgoXqbe7Sq5wkIL\nNp3UZom2ozz/C9wyOnYm4xUZsiqzPMm/04hjt4CSYrkM1GfIoacBajLoefmR\nEiashMv/ieJR6Vd00GJNGShhzFqGWvC7+qwuaGvaMmMFwIAiHcvRVfg7hgVl\nxoDJPl9G9u3pib4XuMCTdk48zvNy90G7Ft7EkujZiPAqXtWgIkhd4j6130w3\nugzbAj8x3aVDmtnWsQ3Pg4Af3520f6a7vQpwPuNMZtZvWBDT32LE8pPDLR8Q\nZuFneXDa0+0JJIFhHAG354oWMk//27pnMPMzm2wJGTr+RARsnCaSWCuhESqt\n4zoNhYmDKqd0Rmkvwt4hclh+OeYxtWiSnudZqhFNntbUlYQyuFdfqHpAm1SC\nrCOzVRl60zicCTxppp+yeljZE4jUFDHuQY+p1DoGkHeZL1YlBysPkwSO/J+p\n+Af87g/WdT2s7UDWMd+HLh/lK9lM5QsGeZEk6Dym2LUzZsCzpD8Y4SmlYEgO\nesYB09tA8s+a6JQAmGtYWp8cAn5QnGsl/Gs3jWzbX98CBWhffkda4ECVP0da\nBCCs\r\n=QlrT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICPwvo93duGv4p/hVDK4GvIiBxdjIwappoBgtHXA+hegAiEA6M9JH3e8+1TTHkVcGhq2pcceq7CjCFD1GpPY2gwa9T0="}],"size":7945,"noattachment":false,"key":"/pug-parser/-/pug-parser-6.0.0-canary-2.tgz"},"maintainers":[{"email":"forbes@lindesay.co.uk","name":"forbeslindesay"},{"email":"pug-bot@rollingversions.com","name":"pug-bot"},{"email":"timothygu99@gmail.com","name":"timothygu"}],"_npmUser":{"name":"pug-bot","email":"pug-bot@rollingversions.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pug-parser_6.0.0-canary-2_1590409140354_0.3413836770441083"},"_hasShrinkwrap":false,"publish_time":1590409140569,"_cnpm_publish_time":1590409140569,"dist-tags":{"canary":"6.0.0-canary-2","latest":"6.0.0"}}