{"name":"pug-parser","version":"6.0.0-canary-1","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-1","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-1","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"integrity":"sha512-QadrJeevATpjKTvsBKCX7OlyD6kf8Cc6yGUtmLbuntGHwwlg5EZf0uTAZ3b+n3/Zn4o9HCLxGEU+qGR1aouNdQ==","shasum":"ed7c1ecb2ba5ed22ea95c1228de70cc050353af9","tarball":"http://registry-npm.ywwl.com/pug-parser/download/pug-parser-6.0.0-canary-1.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\nwsFcBAEBCAAQBQJeyv5RCRA9TVsSAnZWagAAvFoP/ixqtx3Ym1+xlhUn5Om5\npfFRP2eRiHLVbTVxPmhsskyfBn1i82bLf9KxzxfwRrW5OHGUrfhVt0OdwUqT\nA8Qgt4zIHzN0LaHFhxno4D20p/1QLbkZEp/yZwod8tndfo9ih3+s/Z5tCUas\ntP3bjyHi8Uvj50Bme1bKGbDbw1sX0TQEPByG2mm9zhKfLvsjvi4CRHIo8gCB\njauval7vzCz/iJXfWCamVF36vABT9sCyQSa8tui3C3mrpIV2l1KsfROLIkC9\ntAzc49wZ603JFPV4lOBKlcZm7PWZu2VzBeIDPbltCGh481wuyGer0fKt9e55\nT5zobn0s2VD2StImIuQQ8VAdhruiA+Hfc25OAvPlDv33VPgSZcYJzkKbzeYa\nrKIPYb/h1yfE+NX1G0CT74P0WT1pCQzZrirUNNqRrqtbaI+rm+YOEdXH+wBJ\no4WSvBepbYZo5TDi8+Ys1aeNJ5v1vmN0TzlOZowqbjPUUk1LHMS6tfW1sZEC\nOTb5vF3RQjdyZP7FCDbH6v5pdb1f02hnHbN7gXJkiz7EhQSnL5iXOOBFxzNi\n0FIUn7u9dI42sTDD1OKUpv5eacPy/khu/wB04F1Iq3FhfRhEhiATxwAAROnm\nB8BZMITE7aiZe3I34+OIpTUa/N43O0s482Pa7YbJFP8twgcFkzuAL5LD1QPp\n0qKu\r\n=I+zP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGlAuVLJX+tRRz0HayaIEdebkXzO8QawPi/eeWwCd4TgIgccfsGLmIYIiKxmLwJGqCD036LSxRmHfuMYUElZP5rvU="}],"size":7945,"noattachment":false,"key":"/pug-parser/-/pug-parser-6.0.0-canary-1.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-1_1590361680650_0.49798907912935975"},"_hasShrinkwrap":false,"publish_time":1590361680789,"_cnpm_publish_time":1590361680789,"dist-tags":{"canary":"6.0.0-canary-2","latest":"6.0.0"}}