{"_id":"messageformat-parser","_rev":"19-6c4dc11006e758edd2c5553151a5a467","name":"messageformat-parser","description":"A PEG.js parser for ICU MessageFormat strings","dist-tags":{"latest":"4.1.3","next":"4.1.3"},"versions":{"1.0.0-rc.1":{"name":"messageformat-parser","version":"1.0.0-rc.1","description":"A PEG.js parser for ICU MessageFormat strings -- part of messageformat.js","keywords":["icu","messageformat","parser"],"contributors":[{"name":"Alex Sexton","email":"alexsexton@gmail.com"},{"name":"Eemeli Aro","email":"eemeli@gmail.com"},{"name":"Adrian Vogelsgesang","email":"adrian.vogelsgesang@tum.de"}],"license":"MIT","homepage":"https://messageformat.github.io/","repository":{"type":"git","url":"git+https://github.com/messageformat/parser.git"},"main":"parser.js","files":["parser.pegjs","parser.js"],"devDependencies":{"expect.js":"^0.3.1","mocha":"^2.4.5","pegjs":">=0.8.0"},"scripts":{"prepublish":"pegjs parser.pegjs","test":"mocha"},"gitHead":"f592a330d7856a1e6379df6c33e13d3bc097be71","bugs":{"url":"https://github.com/messageformat/parser/issues"},"_id":"messageformat-parser@1.0.0-rc.1","_shasum":"70df3613797df18975529966cb481c0a7d9631df","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.7.0","_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"maintainers":[{"name":"eemeli","email":"eemeli@gmail.com"}],"dist":{"shasum":"70df3613797df18975529966cb481c0a7d9631df","tarball":"https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-1.0.0-rc.1.tgz","integrity":"sha512-F8gs17bI9vDtH21X5RII0ovabBaA8Q1eFHIFuHNqMVPayqCd/pRdUdYH82OvTyxSAjNioCxqpE4w8I+ekGmwFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEDB+u7iMEilCpVzX0Sm8w6vA6QgmrbSSkQ4EcfPjdEgIhAJVALFH9aeFiyg+1F04ATKfSt/OT7KA8PwNPnzuu26SC"}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/messageformat-parser-1.0.0-rc.1.tgz_1460923991353_0.2238752585835755"},"directories":{}},"1.0.0":{"name":"messageformat-parser","version":"1.0.0","description":"A PEG.js parser for ICU MessageFormat strings -- part of messageformat.js","keywords":["icu","messageformat","parser"],"contributors":[{"name":"Alex Sexton","email":"alexsexton@gmail.com"},{"name":"Eemeli Aro","email":"eemeli@gmail.com"},{"name":"Adrian Vogelsgesang","email":"adrian.vogelsgesang@tum.de"}],"license":"MIT","homepage":"https://messageformat.github.io/","repository":{"type":"git","url":"git+https://github.com/messageformat/parser.git"},"main":"parser.js","files":["parser.pegjs","parser.js"],"devDependencies":{"expect.js":"^0.3.1","mocha":"^3.0.2","pegjs":"^0.10.0"},"scripts":{"prepublish":"pegjs parser.pegjs","test":"mocha"},"gitHead":"99d179eb4216395ff730ba8cc9a8a8bf3385b343","bugs":{"url":"https://github.com/messageformat/parser/issues"},"_id":"messageformat-parser@1.0.0","_shasum":"3dea21419f141c50026a29d4b2239203ad613d3f","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"dist":{"shasum":"3dea21419f141c50026a29d4b2239203ad613d3f","tarball":"https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-1.0.0.tgz","integrity":"sha512-3KsTHU8mGjMjP98F/ojqdE3TBxc/incL7CVQ/HAi+c7dt4FD1oOp1R3Glx1g9foYRwBN3otxEX8hgjVVMvz7fg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClF1XxgFldUMKtBcdPX6WAC19R4uxrrncAa1IZ8OgffgIgMx+xmxwNuwAUV4XVtJ0tiyNfh4Eub8PtZp7/Bfuv35Y="}]},"maintainers":[{"name":"eemeli","email":"eemeli@gmail.com"},{"name":"slexaxton","email":"alexsexton@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/messageformat-parser-1.0.0.tgz_1472770365921_0.41532221157103777"},"directories":{}},"1.1.0":{"name":"messageformat-parser","version":"1.1.0","description":"A PEG.js parser for ICU MessageFormat strings -- part of messageformat.js","keywords":["icu","messageformat","parser"],"contributors":[{"name":"Alex Sexton","email":"alexsexton@gmail.com"},{"name":"Eemeli Aro","email":"eemeli@gmail.com"},{"name":"Nikola Kovacs","email":"nikola.kovacs@gmail.com"},{"name":"Adrian Vogelsgesang","email":"adrian.vogelsgesang@tum.de"}],"license":"MIT","homepage":"https://messageformat.github.io/","repository":{"type":"git","url":"git+https://github.com/messageformat/parser.git"},"main":"parser.js","files":["parser.pegjs","parser.js"],"devDependencies":{"expect.js":"^0.3.1","mocha":"^3.0.2","pegjs":"^0.10.0"},"scripts":{"prepublish":"pegjs parser.pegjs","test":"mocha"},"gitHead":"524e8fb4d90b3cef43e317c94d18ca565eebddcd","bugs":{"url":"https://github.com/messageformat/parser/issues"},"_id":"messageformat-parser@1.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.1.3","_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"dist":{"integrity":"sha512-Hwem6G3MsKDLS1FtBRGIs8T50P1Q00r3srS6QJePCFbad9fq0nYxwf3rnU2BreApRGhmpKMV7oZI06Sy1c9TPA==","shasum":"13ba2250a76bbde8e0fca0dbb3475f95c594a90a","tarball":"https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBMiKcRWciPfMekAWpxSzbZziLSFXkMP+fhkPdDC7f2xAiAKgM7XsnC1ggrE8aC/pkm8sVVq1OE2w0mf4QsBeVy18w=="}]},"maintainers":[{"name":"eemeli","email":"eemeli@gmail.com"},{"name":"slexaxton","email":"alexsexton@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messageformat-parser-1.1.0.tgz_1500358806190_0.3648966371547431"},"directories":{}},"2.0.0":{"name":"messageformat-parser","version":"2.0.0","description":"A PEG.js parser for ICU MessageFormat strings -- part of messageformat.js","keywords":["icu","messageformat","parser"],"contributors":[{"name":"Alex Sexton","email":"alexsexton@gmail.com"},{"name":"Eemeli Aro","email":"eemeli@gmail.com"},{"name":"Nikola Kovacs","email":"nikola.kovacs@gmail.com"},{"name":"Adrian Vogelsgesang","email":"adrian.vogelsgesang@tum.de"}],"license":"MIT","homepage":"https://messageformat.github.io/","repository":{"type":"git","url":"git+https://github.com/messageformat/parser.git"},"main":"parser.js","files":["parser.pegjs","parser.js"],"devDependencies":{"expect.js":"^0.3.1","mocha":"^4.0.1","pegjs":"^0.10.0"},"scripts":{"prepublish":"pegjs parser.pegjs","test":"mocha"},"gitHead":"bddb72f0c71069e92f3c52c73ae626fea7958dad","bugs":{"url":"https://github.com/messageformat/parser/issues"},"_id":"messageformat-parser@2.0.0","_npmVersion":"5.4.2","_nodeVersion":"8.8.0","_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"dist":{"integrity":"sha512-C2ZjB5GlLeikkeoMCTcwEeb68LrFl9osxQzXHIPh0Wcj+43wNsoKpRRKq9rm204sAIdknrdcoeQMUnzvDuMf6g==","shasum":"e37efa0cb07b6784e5f3adc089cbf266208c01c7","tarball":"https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-2.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCngyoNKGTQ4fBJCJZUtrkKB0LV3VeseLgu3xnhype/FgIgBwnnggjuEK/Qlw2gIO8zcgwqKlV99/emsWtwLhJM9iQ="}]},"maintainers":[{"email":"alexsexton@gmail.com","name":"slexaxton"},{"email":"eemeli@gmail.com","name":"eemeli"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messageformat-parser-2.0.0.tgz_1511000996175_0.46639939048327506"},"directories":{}},"3.0.0-beta.1":{"name":"messageformat-parser","version":"3.0.0-beta.1","description":"A PEG.js parser for ICU MessageFormat strings","keywords":["icu","messageformat","parser"],"contributors":[{"name":"Alex Sexton","email":"alexsexton@gmail.com"},{"name":"Eemeli Aro","email":"eemeli@gmail.com"},{"name":"Nikola Kovacs","email":"nikola.kovacs@gmail.com"},{"name":"Adrian Vogelsgesang","email":"adrian.vogelsgesang@tum.de"}],"license":"MIT","homepage":"https://messageformat.github.io/","repository":{"type":"git","url":"git+https://github.com/messageformat/parser.git"},"main":"parser.js","files":["parser.js","codemod-fix-backslash-escapes.js"],"devDependencies":{"expect.js":"^0.3.1","mocha":"^4.0.1","pegjs":"^0.10.0"},"scripts":{"prepare":"pegjs parser.pegjs","prepublishOnly":"npm test","test":"mocha"},"readme":"# messageformat-parser  <a href=\"http://travis-ci.org/messageformat/parser\"><img align=\"right\" alt=\"Build Status\" src=\"https://secure.travis-ci.org/messageformat/parser.png\"></a>\n\nA [PEG.js] parser for [ICU MessageFormat] strings – part of [messageformat].\nOutputs an AST defined by [parser.pegjs].\n\nThe generated `parse(src, [options])` function takes two parameters, first the\nstring to be parsed, and a second optional parameter `options`, an object with\nthe following possible keys:\n\n- `cardinal` and `ordinal` – Arrays of valid plural categories for the current\n  locale, used to validate `plural` and `selectordinal` keys. If these are\n  missing or set to false, the full set of valid [Unicode CLDR] keys is used:\n  `'zero', 'one', 'two', 'few', 'many', 'other'`. To disable this check, pass in\n  an empty array.\n\n- `strictFunctionParams` – By default, function parameters are split on commas\n  and trimmed, so the parameters in `{x,fn,   a,   b   }` are parsed as\n  `['a','b']`. Setting `strictFunctionParams` to true will make the parser\n  follow the ICU MessageFormat spec more closely, and result in a params array\n  with a single element: `['   a,   b   ']`.\n\n- `strictNumberSign` – Inside a `plural` or `selectordinal` statement, a pound\n  symbol (`#`) is replaced with the input number. By default, `#` is also parsed\n  as a special character in nested statements too, and can be escaped using\n  apostrophes (`'#'`). Setting `strictNumberSign` to true will make the parser\n  follow the ICU MessageFormat spec more closely, and only parse `#` as a\n  special character directly inside a `plural` or `selectordinal` statement.\n  Outside those, `#` and `'#'` will be parsed as literal text.\n\nThe parser only supports the default `DOUBLE_OPTIONAL` [apostrophe mode]. A\nsingle apostrophe only starts quoted literal text if preceded by a curly brace\n(`{}`) or a pound symbol (`#`) inside a `plural` or `selectordinal` statement,\ndepending on the value of `strictNumberSign`. Otherwise, it is a literal\napostrophe. A double apostrophe is always a literal apostrophe.\n\n[ICU MessageFormat]: https://messageformat.github.io/guide/\n[messageformat]: https://messageformat.github.io/\n[parser.pegjs]: ./parser.pegjs\n[PEG.js]: http://pegjs.org/\n[Unicode CLDR]: http://cldr.unicode.org/index/cldr-spec/plural-rules\n[apostrophe mode]: http://www.icu-project.org/apiref/icu4c/messagepattern_8h.html#af6e0757e0eb81c980b01ee5d68a9978b\n\n\n## Installation\n\n```sh\nnpm install messageformat-parser\n```\n\n\n## Usage\n\n```js\n> var parse = require('messageformat-parser').parse;\n\n> parse('So {wow}.')\n[ 'So ', { type: 'argument', arg: 'wow' }, '.' ]\n\n> parse('Such { thing }. { count, selectordinal, one {First} two {Second}' +\n        '                  few {Third} other {#th} } word.')\n[ 'Such ',\n  { type: 'argument', arg: 'thing' },\n  '. ',\n  { type: 'selectordinal',\n    arg: 'count',\n    offset: 0,\n    cases:\n     [ { key: 'one', tokens: [ 'First' ] },\n       { key: 'two', tokens: [ 'Second' ] },\n       { key: 'few', tokens: [ 'Third' ] },\n       { key: 'other', tokens: [ { type: 'octothorpe' }, 'th' ] } ] },\n  ' word.' ]\n\n> parse('Many{type,select,plural{ numbers}selectordinal{ counting}' +\n                         'select{ choices}other{ some {type}}}.')\n[ 'Many',\n  { type: 'select',\n    arg: 'type',\n    cases:\n     [ { key: 'plural', tokens: [ ' numbers' ] },\n       { key: 'selectordinal', tokens: [ ' counting' ] },\n       { key: 'select', tokens: [ ' choices' ] },\n       { key: 'other', tokens: [ ' some',\n                                 { type: 'argument', arg: 'type' } ] } ] },\n  '.' ]\n\n> parse('{Such compliance')\n// SyntaxError: Expected \",\", \"}\" or [ \\t\\n\\r] but \"c\" found.\n\n> var msg = '{words, plural, zero{No words} one{One word} other{# words}}';\n> var englishKeys = { cardinal: [ 'one', 'other' ],\n                      ordinal: [ 'one', 'two', 'few', 'other' ] };\n> parse(msg)\n[ { type: 'plural',\n    arg: 'words',\n    offset: 0,\n    cases:\n     [ { key: 'zero', tokens: [ 'No words' ] },\n       { key: 'one', tokens: [ 'One word' ] },\n       { key: 'other', tokens: [ { type: 'octothorpe' }, ' words' ] } ] } ]\n\n> parse(msg, englishKeys)\n// Error: Invalid key `zero` for argument `words`. Valid plural keys for this\n//        locale are `one`, `other`, and explicit keys like `=0`.\n```\n\nFor more example usage, please take a look at our [test suite](./test.js).\n\n\n## Structure\n\nThe output of `parse()` is a `Token` array:\n\n```js\ntype Token = string | Argument | Plural | Select | Function\n\ntype Argument = {\n  type: 'argument',\n  arg: Identifier\n}\n\ntype Plural = {\n  type: 'plural' | 'selectordinal',\n  arg: Identifier,\n  offset: number,\n  cases: PluralCase[]\n}\n\ntype Select = {\n  type: 'select',\n  arg: Identifier,\n  cases: SelectCase[]\n}\n\ntype Function = {\n  type: 'function',\n  arg: Identifier,\n  key: Identifier,\n  params: string[]\n}\n\ntype PluralCase = {\n  key: 'zero' | 'one' | 'two' | 'few' | 'many' | 'other' | '=0' | '=1' | '=2' | ...,\n  tokens: (Token | Octothorpe)[]\n}\n\ntype SelectCase = {\n  key: Identifier,\n  tokens: strictNumberSign ? Token[] : (Token | Octothorpe)[]\n}\n\ntype Octothorpe = {\n  type: 'octothorpe'\n}\n\ntype Identifier = string  // not containing whitespace or control characters\n```\n\n\n## License & Contributor License Agreement\nReleased under the MIT license. See the [messageformat README][CLA] for details.\n\n[CLA]: https://github.com/messageformat/messageformat.js#contributor-license-agreement\n","readmeFilename":"README.md","gitHead":"9b3ae2687cf72c2d58f6e1d5fb158247bb573af2","bugs":{"url":"https://github.com/messageformat/parser/issues"},"_id":"messageformat-parser@3.0.0-beta.1","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"dist":{"integrity":"sha512-N4/mXXj2/sOPYvSydAGCHJJ49FnxRYfjEEOF784FuGC13rSQ4GrmQoZG2GEaW99dRpmXzgm3dCD1FHFKGRbDhg==","shasum":"7574d17228a7e024510f04728f710fa1630d5523","tarball":"https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-3.0.0-beta.1.tgz","fileCount":5,"unpackedSize":59780,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIChHl2F+D8+9LzrPZGMqz+NZdjALU3vE3tZceqC2OQRKAiBj1KbcsR+/qqVUOGPsFjLq3I+jHEonLZCm4BeC3nz+Pg=="}]},"maintainers":[{"email":"eemeli@gmail.com","name":"eemeli"},{"email":"alexsexton@gmail.com","name":"slexaxton"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messageformat-parser_3.0.0-beta.1_1521290667546_0.3931494078752473"},"_hasShrinkwrap":false},"3.0.0-beta.2":{"name":"messageformat-parser","version":"3.0.0-beta.2","description":"A PEG.js parser for ICU MessageFormat strings","keywords":["icu","messageformat","parser"],"contributors":[{"name":"Alex Sexton","email":"alexsexton@gmail.com"},{"name":"Eemeli Aro","email":"eemeli@gmail.com"},{"name":"Nikola Kovacs","email":"nikola.kovacs@gmail.com"},{"name":"Adrian Vogelsgesang","email":"adrian.vogelsgesang@tum.de"}],"license":"MIT","homepage":"https://messageformat.github.io/","repository":{"type":"git","url":"git+https://github.com/messageformat/parser.git"},"main":"parser.js","files":["parser.js","codemod-fix-backslash-escapes.js"],"devDependencies":{"expect.js":"^0.3.1","mocha":"^4.0.1","pegjs":"^0.10.0"},"scripts":{"prepare":"pegjs parser.pegjs","prepublishOnly":"npm test","test":"mocha"},"readme":"# messageformat-parser  <a href=\"http://travis-ci.org/messageformat/parser\"><img align=\"right\" alt=\"Build Status\" src=\"https://secure.travis-ci.org/messageformat/parser.png\"></a>\n\nA [PEG.js] parser for [ICU MessageFormat] strings – part of [messageformat].\nOutputs an AST defined by [parser.pegjs].\n\nThe generated `parse(src, [options])` function takes two parameters, first the\nstring to be parsed, and a second optional parameter `options`, an object with\nthe following possible keys:\n\n- `cardinal` and `ordinal` – Arrays of valid plural categories for the current\n  locale, used to validate `plural` and `selectordinal` keys. If these are\n  missing or set to false, the full set of valid [Unicode CLDR] keys is used:\n  `'zero', 'one', 'two', 'few', 'many', 'other'`. To disable this check, pass in\n  an empty array.\n\n- `strictNumberSign` – Inside a `plural` or `selectordinal` statement, a pound\n  symbol (`#`) is replaced with the input number. By default, `#` is also parsed\n  as a special character in nested statements too, and can be escaped using\n  apostrophes (`'#'`). Setting `strictNumberSign` to true will make the parser\n  follow the ICU MessageFormat spec more closely, and only parse `#` as a\n  special character directly inside a `plural` or `selectordinal` statement.\n  Outside those, `#` and `'#'` will be parsed as literal text.\n\nThe parser only supports the default `DOUBLE_OPTIONAL` [apostrophe mode]. A\nsingle apostrophe only starts quoted literal text if preceded by a curly brace\n(`{}`) or a pound symbol (`#`) inside a `plural` or `selectordinal` statement,\ndepending on the value of `strictNumberSign`. Otherwise, it is a literal\napostrophe. A double apostrophe is always a literal apostrophe.\n\n[ICU MessageFormat]: https://messageformat.github.io/guide/\n[messageformat]: https://messageformat.github.io/\n[parser.pegjs]: ./parser.pegjs\n[PEG.js]: http://pegjs.org/\n[Unicode CLDR]: http://cldr.unicode.org/index/cldr-spec/plural-rules\n[apostrophe mode]: http://www.icu-project.org/apiref/icu4c/messagepattern_8h.html#af6e0757e0eb81c980b01ee5d68a9978b\n\n\n## Installation\n\n```sh\nnpm install messageformat-parser\n```\n\n\n## Usage\n\n```js\n> var parse = require('messageformat-parser').parse;\n\n> parse('So {wow}.')\n[ 'So ', { type: 'argument', arg: 'wow' }, '.' ]\n\n> parse('Such { thing }. { count, selectordinal, one {First} two {Second}' +\n        '                  few {Third} other {#th} } word.')\n[ 'Such ',\n  { type: 'argument', arg: 'thing' },\n  '. ',\n  { type: 'selectordinal',\n    arg: 'count',\n    offset: 0,\n    cases:\n     [ { key: 'one', tokens: [ 'First' ] },\n       { key: 'two', tokens: [ 'Second' ] },\n       { key: 'few', tokens: [ 'Third' ] },\n       { key: 'other', tokens: [ { type: 'octothorpe' }, 'th' ] } ] },\n  ' word.' ]\n\n> parse('Many{type,select,plural{ numbers}selectordinal{ counting}' +\n                         'select{ choices}other{ some {type}}}.')\n[ 'Many',\n  { type: 'select',\n    arg: 'type',\n    cases:\n     [ { key: 'plural', tokens: [ ' numbers' ] },\n       { key: 'selectordinal', tokens: [ ' counting' ] },\n       { key: 'select', tokens: [ ' choices' ] },\n       { key: 'other', tokens: [ ' some',\n                                 { type: 'argument', arg: 'type' } ] } ] },\n  '.' ]\n\n> parse('{Such compliance')\n// SyntaxError: Expected \",\", \"}\" or [ \\t\\n\\r] but \"c\" found.\n\n> var msg = '{words, plural, zero{No words} one{One word} other{# words}}';\n> var englishKeys = { cardinal: [ 'one', 'other' ],\n                      ordinal: [ 'one', 'two', 'few', 'other' ] };\n> parse(msg)\n[ { type: 'plural',\n    arg: 'words',\n    offset: 0,\n    cases:\n     [ { key: 'zero', tokens: [ 'No words' ] },\n       { key: 'one', tokens: [ 'One word' ] },\n       { key: 'other', tokens: [ { type: 'octothorpe' }, ' words' ] } ] } ]\n\n> parse(msg, englishKeys)\n// Error: Invalid key `zero` for argument `words`. Valid plural keys for this\n//        locale are `one`, `other`, and explicit keys like `=0`.\n```\n\nFor more example usage, please take a look at our [test suite](./test.js).\n\n\n## Structure\n\nThe output of `parse()` is a `Token` array:\n\n```typescript\ntype Token = string | Argument | Plural | Select | Function\n\ntype Argument = {\n  type: 'argument',\n  arg: Identifier\n}\n\ntype Plural = {\n  type: 'plural' | 'selectordinal',\n  arg: Identifier,\n  offset: number,\n  cases: PluralCase[]\n}\n\ntype Select = {\n  type: 'select',\n  arg: Identifier,\n  cases: SelectCase[]\n}\n\ntype Function = {\n  type: 'function',\n  arg: Identifier,\n  key: Identifier,\n  param: string | null\n}\n\ntype PluralCase = {\n  key: 'zero' | 'one' | 'two' | 'few' | 'many' | 'other' | '=0' | '=1' | '=2' | ...,\n  tokens: (Token | Octothorpe)[]\n}\n\ntype SelectCase = {\n  key: Identifier,\n  tokens: strictNumberSign ? Token[] : (Token | Octothorpe)[]\n}\n\ntype Octothorpe = {\n  type: 'octothorpe'\n}\n\ntype Identifier = string  // not containing whitespace or control characters\n```\n\n\n## License & Contributor License Agreement\nReleased under the MIT license. See the [messageformat README][CLA] for details.\n\n[CLA]: https://github.com/messageformat/messageformat.js#contributor-license-agreement\n","readmeFilename":"README.md","gitHead":"e6cb9d43820143fd65853d632c3ba0db86161054","bugs":{"url":"https://github.com/messageformat/parser/issues"},"_id":"messageformat-parser@3.0.0-beta.2","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"dist":{"integrity":"sha512-P9hh6N/vEvAoGTprQFNNSq7MJL+xaurJRmOMDY+cdUM+yqLurp4RNueCxAJzhcFoK1EcTcY4RbpbnJo3BXQMbQ==","shasum":"7fa93864b12465933e8f53e7a3e6c374e6d70703","tarball":"https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-3.0.0-beta.2.tgz","fileCount":5,"unpackedSize":54047,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHdm4YD0dYR6Of41v5SmUR/0YLZMTGsa7T4lYA1hsI87AiAgViiJcg7Y6wPTEcp1P7j7Pt6ocnGLRkoT3DBkj76+Og=="}]},"maintainers":[{"email":"eemeli@gmail.com","name":"eemeli"},{"email":"alexsexton@gmail.com","name":"slexaxton"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messageformat-parser_3.0.0-beta.2_1521296714185_0.3150158122307032"},"_hasShrinkwrap":false},"3.0.0":{"name":"messageformat-parser","version":"3.0.0","description":"A PEG.js parser for ICU MessageFormat strings","keywords":["icu","messageformat","parser"],"contributors":[{"name":"Alex Sexton","email":"alexsexton@gmail.com"},{"name":"Eemeli Aro","email":"eemeli@gmail.com"},{"name":"Nikola Kovacs","email":"nikola.kovacs@gmail.com"},{"name":"Adrian Vogelsgesang","email":"adrian.vogelsgesang@tum.de"}],"license":"MIT","homepage":"https://messageformat.github.io/","repository":{"type":"git","url":"git+https://github.com/messageformat/parser.git"},"main":"parser.js","files":["parser.js","codemod-fix-backslash-escapes.js"],"devDependencies":{"expect.js":"^0.3.1","mocha":"^4.0.1","pegjs":"^0.10.0"},"scripts":{"prepare":"pegjs parser.pegjs","prepublishOnly":"npm test","test":"mocha"},"gitHead":"02a06777d1ce5b99af4a6cbbeb80cebcbfb4de19","bugs":{"url":"https://github.com/messageformat/parser/issues"},"_id":"messageformat-parser@3.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"dist":{"integrity":"sha512-5KfDWGAHz5kzfKH5V4M7+o3CIFiykCfFDaLK+Ck2fkaxYfLWwKZMioxrSsMRnkfMr0ZaaC0gcxyOUb2d0GCy4A==","shasum":"38ae9348eb4834ab19b3a8d682af7babb335f37a","tarball":"https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-3.0.0.tgz","fileCount":5,"unpackedSize":54040,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBHwBPj0aGCPkhOCF1+Etb0hz+YqRkLnYvdhJNvFKWU1AiEAoem7wupKoIG9Jm4qn8BcZHi1iVQPgYS+qx7qUyljRvk="}]},"maintainers":[{"email":"eemeli@gmail.com","name":"eemeli"},{"email":"alexsexton@gmail.com","name":"slexaxton"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messageformat-parser_3.0.0_1522833094949_0.852994987088443"},"_hasShrinkwrap":false},"4.0.0":{"name":"messageformat-parser","version":"4.0.0","description":"A PEG.js parser for ICU MessageFormat strings","keywords":["icu","messageformat","parser"],"contributors":[{"name":"Alex Sexton","email":"alexsexton@gmail.com"},{"name":"Eemeli Aro","email":"eemeli@gmail.com"},{"name":"Nikola Kovacs","email":"nikola.kovacs@gmail.com"},{"name":"Adrian Vogelsgesang","email":"adrian.vogelsgesang@tum.de"}],"license":"MIT","homepage":"https://messageformat.github.io/","repository":{"type":"git","url":"git+https://github.com/messageformat/parser.git"},"main":"parser.js","devDependencies":{"expect.js":"^0.3.1","mocha":"^4.1.0","pegjs":"^0.10.0"},"scripts":{"prepare":"pegjs parser.pegjs","prepublishOnly":"npm test","test":"mocha"},"gitHead":"b6638652829b451fb1b9bada883c554da8120d4c","bugs":{"url":"https://github.com/messageformat/parser/issues"},"_id":"messageformat-parser@4.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"dist":{"integrity":"sha512-jhIvKWiNOdfpGGy5QcqPG00vpwBJIqIxvKouVowoJbRlEyUvl1RQf3lRMKCv5rT/YSpNyD3Nf+rgZMMMCPqGtg==","shasum":"2c9abd15182c9a36f5085122013f4caf49b71738","tarball":"https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-4.0.0.tgz","fileCount":5,"unpackedSize":64203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcB7zCCRA9TVsSAnZWagAA9EwQAIqAy4mwgH76ZOhNCsmz\n+se9nHl06ExMAHiakkQTVEyA7xVKy7IEOxRzV9YGKrG35qiHkK3ImWoR7Zs8\nWJq1Fh/qJepAIyAnSylcuZEyrt7NtzfZrzr6UYE4QtATLGBwrADTkesSrKy8\nV1j97xhC+yit2rjJCIUticv8EsLnG7xB+RhfEfLoOUq7TNhh+Z7MUaUYE3rZ\nv8zTc/sxxjYZNkgtsdkSCDWnJOu81B5XWFtw//tL3xX5RKuZIj6rLTSN1ogF\nzws62Wwr5CmA5vXWOzU/LA4jQmXDHML2KFva27lwSp+xz22Lix5PgJzOh9I4\nltvlzr7AH3I9yJm5xcaw+mPDXpxq2JqiEGHhVhLPmHewMFz2xckwzZDVgXSj\n083Mr4UQGY76balRgJj5bT2PYCLEph4Poqwun8bVzQ3l/oGBKlLw8p+zlyJF\n+9QoEpsIugvfKB36YfqHAO/VnAn7GspIn31WeVsARufDKCq8dMPeomMRiNMM\nt918aVc2wlpxU1XcvdXTYOfoyR2a3btS69tMmSdz7eNmsV39+N5pTgrRjlp6\nWcHtuaxeUekLQYyTXnqGWQi0i/u56i3RH3ZzzagjCnBT9iWSnex+1ddYzOJ9\n3d9ag8sIwxULx01MSiuJtMb5NhS3O46pVnji6Whal9rid4cCyx6tUIyksv9I\nqgE9\r\n=7+xo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC19YOEyp5DBW5eux1Cnoa2Text3WvZCYiEqxHsKi72vAIgFVLkTka6AsTQrC9+vcJh5MXGMtNvvwXEwkI1XMyISQ4="}]},"maintainers":[{"email":"eemeli@gmail.com","name":"eemeli"},{"email":"alexsexton@gmail.com","name":"slexaxton"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messageformat-parser_4.0.0_1544010946030_0.22258419325120515"},"_hasShrinkwrap":false},"4.1.0":{"name":"messageformat-parser","version":"4.1.0","description":"A PEG.js parser for ICU MessageFormat strings","keywords":["icu","messageformat","parser"],"contributors":[{"name":"Alex Sexton","email":"alexsexton@gmail.com"},{"name":"Eemeli Aro","email":"eemeli@gmail.com"},{"name":"Nikola Kovacs","email":"nikola.kovacs@gmail.com"},{"name":"Adrian Vogelsgesang","email":"adrian.vogelsgesang@tum.de"}],"license":"MIT","homepage":"https://messageformat.github.io/","repository":{"type":"git","url":"git+https://github.com/messageformat/messageformat.git"},"main":"parser.js","eslintConfig":{"env":{"commonjs":true,"es6":true},"overrides":[{"files":["test.js"],"env":{"mocha":true},"rules":{"no-unused-vars":0}}]},"devDependencies":{"expect.js":"^0.3.1","mocha":"^5.2.0","pegjs":"^0.10.0"},"scripts":{"build":"pegjs parser.pegjs","prepublishOnly":"npm test","test":"mocha"},"gitHead":"7594c61df39236cfa19268ae28a87099034fe5ea","_resolved":"","_integrity":"","_from":"file:messageformat-parser-4.1.0.tgz","bugs":{"url":"https://github.com/messageformat/messageformat/issues"},"_id":"messageformat-parser@4.1.0","_npmVersion":"6.5.0","_nodeVersion":"11.9.0","_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"dist":{"integrity":"sha512-L/9SdYyDOdZD1BAQILkH/xrkHzM3x+99Peu9JnE8wWM6e0KvVz3iRobLNmTgz0LxLViHAX5YYsvDIpuJrIljsg==","shasum":"2bd21fd08db7233d0ef2af6d2c878fef2750c526","tarball":"https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-4.1.0.tgz","fileCount":6,"unpackedSize":68833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJce/jtCRA9TVsSAnZWagAA03MP/Rw84Wm7Ct4blpcFHF6W\nUW80Jv992LBN2LP/qGbdjRlWsBXiuba4vk9XcwrIxbYbxVRD4xJwhj/eUwzs\nRpdkxyIgz5i5SMUtetjoJKlnykNCnpcFnEHKpRcRNN2pXscKZxtX2AzEOKU1\n3bSak5gS+rg5XJu6Ztm3LbHiGqaVuh7nVPtdIDWNgPMrFXfUsUnNjKnTTXqI\nXo8RwURTVEgjerOZwtclFlQK68csA3VY2hbUaHrniyM+RUz6OuZUZvQAmIRG\nCJ2I2jKI3SYcss30IAYYpaFrsoYVYdyvyofz4VNBWnUZakB0mi76OZOcePR7\ncOvo3am5wcaUrmUfh0TI0eUdTZc/TnPLmYN2iOiu1mhqhbKWZ7De4bhOu5EK\nVeGc0oW/7FzfrN0QFxdgVvlzQ4xptLXqAAEZxk9j8YroB+cQhy9QpmyV2l9e\noEMxIefI5Txkvk7kuziotbG9Rum41mQPUMmalZp/U9cSSgQ5mpwzaVaIoJpJ\nI5lBvnTDW8UYMtetHAGQAYn6QkFmmAAoEnSbCx056L1IfPsIQawOpcePuR1K\njOqlNsFT/jB/YHtZWIoSHa9dMA/Rgdp0qZocPoXbZWHJWpnmLPbqtWlfkA3R\n333wZIHc4Isgjw+rkrulpPESBUsyQLeZjjkyEh5FsS45iIQzRsA3gbnJlGoG\nVfzd\r\n=byyW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBIR3oRpTgLSFYnZKsvoeCQRJQ0BHlVm4aTSNTIcgtQnAiEAulCKFmFmttLr+KmxGKYQSxKHOwjQUuRa4FvHkRdNo00="}]},"maintainers":[{"email":"eemeli@gmail.com","name":"eemeli"},{"email":"alexsexton@gmail.com","name":"slexaxton"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messageformat-parser_4.1.0_1551628524826_0.09890771250702124"},"_hasShrinkwrap":false},"4.1.1":{"name":"messageformat-parser","version":"4.1.1","description":"A PEG.js parser for ICU MessageFormat strings","keywords":["icu","messageformat","parser"],"contributors":[{"name":"Alex Sexton","email":"alexsexton@gmail.com"},{"name":"Eemeli Aro","email":"eemeli@gmail.com"},{"name":"Nikola Kovacs","email":"nikola.kovacs@gmail.com"},{"name":"Adrian Vogelsgesang","email":"adrian.vogelsgesang@tum.de"}],"license":"MIT","homepage":"https://messageformat.github.io/","repository":{"type":"git","url":"git+https://github.com/messageformat/messageformat.git"},"main":"parser.js","eslintConfig":{"env":{"commonjs":true,"es6":true},"overrides":[{"files":["test.js"],"env":{"mocha":true},"rules":{"no-unused-vars":0}}]},"devDependencies":{"chai":"^4.2.0","mocha":"^6.1.4","pegjs":"^0.10.0"},"scripts":{"build":"pegjs parser.pegjs","prepublishOnly":"npm test","test":"mocha"},"gitHead":"6bf6b1de2df35276f2453b6b1173332513267e82","bugs":{"url":"https://github.com/messageformat/messageformat/issues"},"_id":"messageformat-parser@4.1.1","_nodeVersion":"11.9.0","_npmVersion":"lerna/3.13.4/node@v11.9.0+x64 (darwin)","dist":{"integrity":"sha512-g5JfN4P58rrx0YVYo4S/tT23cYYm3NNeJLm2F2hhcFq1O1xieVGTssHa1QWMYeHCulTJ/1V7EMkOtItJa9LFUg==","shasum":"665c70393f7b9b55a666ab27f6503ce0b5beeb1f","tarball":"https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-4.1.1.tgz","fileCount":6,"unpackedSize":69577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcywMUCRA9TVsSAnZWagAA7zkP/Aj2LGoZEtD7lvtNBxQ/\n6ipolEoR08Tm4Bv8CN/fIkaQz3IvzeJTLEVK+M9Ghw+pvapQoISKGevsXX1n\nd5zXLPJWlGJrTDya/zDHl7jZk95+cSUsQksWwJxMXbojTKHILnzCVpAN60i+\nTzi9bzvzLiSMi52WX37NkGV1UPc1t3cejctekPvkKg3mKqOZBl1rxFyCYNrL\np/2PnHLN5rqul/3A0StZGvJcbncnDCJFVlbaThAKftfq8WWcpiJO2wkBX97P\nZVgOcwXtUWvL5sTcEng9CjP157SvlXNC328nWpoLdTgOPT80nIA/giD07Gok\n89Wccl+IK2sp8/5TKG9IEW7gusfzKHWOTVf2rWA8DHYxplDue8yRHQQ3R34W\nlItbda25jxkUU5HvEBizfTqSF9mOoL0VCwaaiKV9RxNT4+zJlgrRatMXtYSu\nQa3/JhJdoTpzTLq4fbRgDa35DV/FWYaro8rJMWFUcAvydktZDtUPnkqaAZ+9\nsexpGaAgtALjeH/R4HnlvOv16hjV+bW2FglWVY+7fe14irJ7vk0ufnqjbsnN\nRBzvwcgjNWhnwGdmUAMN4TOSeJPQ8W/mYO3PN0RwZ7qmGagHAh+fJHX3NxKz\nNC2gzN+WxjFqtFr/j14QX7XMX1+kui8pL5lN3vNAWbHtAZ5BqhFK30SCnVkL\nNcL6\r\n=srLc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQCEYyVAF7AochLldJsLaxdy2vaAZwyPQ95Ml2NKl+MykwIff654A4gghGLsyuotcyVDWeM8w1FQnIiCoa/lOLx4bQ=="}]},"maintainers":[{"email":"eemeli@gmail.com","name":"eemeli"},{"email":"alexsexton@gmail.com","name":"slexaxton"}],"_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messageformat-parser_4.1.1_1556808468098_0.5157047276833024"},"_hasShrinkwrap":false},"4.1.2":{"name":"messageformat-parser","version":"4.1.2","description":"A PEG.js parser for ICU MessageFormat strings","keywords":["icu","messageformat","parser"],"contributors":[{"name":"Alex Sexton","email":"alexsexton@gmail.com"},{"name":"Eemeli Aro","email":"eemeli@gmail.com"},{"name":"Nikola Kovacs","email":"nikola.kovacs@gmail.com"},{"name":"Adrian Vogelsgesang","email":"adrian.vogelsgesang@tum.de"}],"license":"MIT","homepage":"https://messageformat.github.io/","repository":{"type":"git","url":"git+https://github.com/messageformat/messageformat.git"},"main":"parser.js","eslintConfig":{"env":{"commonjs":true,"es6":true},"overrides":[{"files":["test.js"],"env":{"mocha":true},"rules":{"no-unused-vars":0}}]},"devDependencies":{"chai":"^4.2.0","mocha":"^6.1.4","pegjs":"^0.10.0"},"scripts":{"build":"pegjs parser.pegjs","prepublishOnly":"npm test","test":"mocha"},"gitHead":"cd47ed7db2b7a4f5e21df4cd6284ae3f7dad05a1","bugs":{"url":"https://github.com/messageformat/messageformat/issues"},"_id":"messageformat-parser@4.1.2","_nodeVersion":"11.9.0","_npmVersion":"lerna/3.15.0/node@v11.9.0+x64 (darwin)","dist":{"integrity":"sha512-7dWuifeyldz7vhEuL96Kwq1fhZXBW+TUfbnHN4UCrCxoXQTYjHnR78eI66Gk9LaLLsAvzPNVJBaa66DRfFNaiA==","shasum":"fd34ec39912a14868a1595eaeb742485ab8ab372","tarball":"https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-4.1.2.tgz","fileCount":6,"unpackedSize":69832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdL2JFCRA9TVsSAnZWagAA6ysP/jEPGCOPqyuI7hMGnqag\n15ILzmxfaqcfTsnt+OrGPTFupYWWS+uBTWfa1xe0dlR/OF8X8aMxJwxM0db0\nAl8sdp5bj1EtcL5+s7Wg9eLVUPkY/PVotNS+KadZWup1HUnqnPQvqT7upYg2\nS+tP+UkC+AKjHdYRmzrKE5qcaAS23tUowIeLo3Jaav80Qa+RMP+9JlwPpUih\ncREngEvKR6GgjuYouyuYGM3otrat8RIXj0LoJxBbVEkv6qaIXsWykfQRRalr\nNPEGnnoQrVRWZh0zPwEZL6IqgRSV6ynE7jofKGnCHeksvlnUDt2WKYTQzMfi\n7U0lfB/e9PbF+Kyh5zdw0gLy4qGBHMw3RfkI9iI7BSYXhlVj7JarvulJOnAA\nGFLy8oJTOfPA2V9dUWzlUCtradKliunP2uer6knIzLcpn29BjWJYX0IgDd+E\njgQJswFrn00po26/rXxOqh1m33U/bXdKNVk+piIyqd5/Tds9p5mVUqUtgQby\n+Zn+a+sF77MmOCRXlO5DrsaqRYitXMQ+v6daKPBEewnJZp7Gq2LVI1gNbPDb\ngF0ZAIOMFzPAJpjHqPWCKOUv8xrNjBY5cwXEnEZCGHB/SQhpuV4ZdROJDXYS\neztw4+IcF9mZ5z0X9x20Wx4jIDrNMVDe38Pm/Z+jdzDut1DzDc6w1I1F+Mz6\n9gcx\r\n=pDw6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4g/RtShz2fhS3+/Q6FqTfjuWzcCytuW31N0CiKhKBUgIhALZv2mJodiY46d7RujIaPzfGNKYYbrIcevf5wNHIAC4C"}]},"maintainers":[{"email":"eemeli@gmail.com","name":"eemeli"},{"email":"alexsexton@gmail.com","name":"slexaxton"}],"_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messageformat-parser_4.1.2_1563386436619_0.10977996789796873"},"_hasShrinkwrap":false},"4.1.3":{"name":"messageformat-parser","version":"4.1.3","description":"A PEG.js parser for ICU MessageFormat strings","keywords":["icu","messageformat","parser"],"contributors":[{"name":"Alex Sexton","email":"alexsexton@gmail.com"},{"name":"Eemeli Aro","email":"eemeli@gmail.com"},{"name":"Nikola Kovacs","email":"nikola.kovacs@gmail.com"},{"name":"Adrian Vogelsgesang","email":"adrian.vogelsgesang@tum.de"}],"license":"MIT","homepage":"https://messageformat.github.io/","repository":{"type":"git","url":"git+https://github.com/messageformat/messageformat.git","directory":"packages/parser"},"main":"parser.js","eslintConfig":{"env":{"commonjs":true,"es6":true},"overrides":[{"files":["test.js"],"env":{"mocha":true},"rules":{"no-unused-vars":0}}]},"scripts":{"build":"pegjs parser.pegjs","prepublishOnly":"npm test","test":"mocha"},"gitHead":"dd10833d8d39155b005ea2ba6ec7a87f4daf0cd2","readme":"# messageformat-parser\n\nA [PEG.js] parser for [ICU MessageFormat] strings – part of [messageformat].\nOutputs an AST defined by [parser.pegjs].\n\nThe generated `parse(src, [options])` function takes two parameters, first the\nstring to be parsed, and a second optional parameter `options`, an object with\nthe following possible keys:\n\n- `cardinal` and `ordinal` – Arrays of valid plural categories for the current\n  locale, used to validate `plural` and `selectordinal` keys. If these are\n  missing or set to false, the full set of valid [Unicode CLDR] keys is used:\n  `'zero', 'one', 'two', 'few', 'many', 'other'`. To disable this check, pass in\n  an empty array.\n\n- `strict` – By default, the parsing applies a few relaxations to the ICU\n  MessageFormat spec. Setting `strict: true` will disable these relaxations:\n  - The `argType` of `simpleArg` formatting functions will be restricted to the\n    set of `number`, `date`, `time`, `spellout`, `ordinal`, and `duration`,\n    rather than accepting any lower-case identifier that does not start with a\n    number.\n  - The optional `argStyle` of `simpleArg` formatting functions will not be\n    parsed as any other text, but instead as the spec requires: \"In\n    argStyleText, every single ASCII apostrophe begins and ends quoted literal\n    text, and unquoted {curly braces} must occur in matched pairs.\"\n  - Inside a `plural` or `selectordinal` statement, a pound symbol (`#`) is\n    replaced with the input number. By default, `#` is also parsed as a special\n    character in nested statements too, and can be escaped using apostrophes\n    (`'#'`). In strict mode `#` will be parsed as a special character only\n    directly inside a `plural` or `selectordinal` statement. Outside those, `#`\n    and `'#'` will be parsed as literal text.\n\nThe parser only supports the default `DOUBLE_OPTIONAL` [apostrophe mode], in\nwhich a single apostrophe only starts quoted literal text if it immediately\nprecedes a curly brace `{}`, or a pound symbol `#` if inside a plural format. A\nliteral apostrophe `'` is represented by either a single `'` or a doubled `''`\napostrophe character.\n\n[icu messageformat]: https://messageformat.github.io/guide/\n[messageformat]: https://messageformat.github.io/\n[parser.pegjs]: ./parser.pegjs\n[peg.js]: http://pegjs.org/\n[unicode cldr]: http://cldr.unicode.org/index/cldr-spec/plural-rules\n[apostrophe mode]: http://www.icu-project.org/apiref/icu4c/messagepattern_8h.html#af6e0757e0eb81c980b01ee5d68a9978b\n\n## Installation\n\n```sh\nnpm install messageformat-parser\n```\n\n## Usage\n\n```js\n> var parse = require('messageformat-parser').parse;\n\n> parse('So {wow}.')\n[ 'So ', { type: 'argument', arg: 'wow' }, '.' ]\n\n> parse('Such { thing }. { count, selectordinal, one {First} two {Second}' +\n        '                  few {Third} other {#th} } word.')\n[ 'Such ',\n  { type: 'argument', arg: 'thing' },\n  '. ',\n  { type: 'selectordinal',\n    arg: 'count',\n    offset: 0,\n    cases:\n     [ { key: 'one', tokens: [ 'First' ] },\n       { key: 'two', tokens: [ 'Second' ] },\n       { key: 'few', tokens: [ 'Third' ] },\n       { key: 'other', tokens: [ { type: 'octothorpe' }, 'th' ] } ] },\n  ' word.' ]\n\n> parse('Many{type,select,plural{ numbers}selectordinal{ counting}' +\n                         'select{ choices}other{ some {type}}}.')\n[ 'Many',\n  { type: 'select',\n    arg: 'type',\n    cases:\n     [ { key: 'plural', tokens: [ ' numbers' ] },\n       { key: 'selectordinal', tokens: [ ' counting' ] },\n       { key: 'select', tokens: [ ' choices' ] },\n       { key: 'other', tokens: [ ' some',\n                                 { type: 'argument', arg: 'type' } ] } ] },\n  '.' ]\n\n> parse('{Such compliance')\n// SyntaxError: Expected \",\", \"}\" or [ \\t\\n\\r] but \"c\" found.\n\n> var msg = '{words, plural, zero{No words} one{One word} other{# words}}';\n> var englishKeys = { cardinal: [ 'one', 'other' ],\n                      ordinal: [ 'one', 'two', 'few', 'other' ] };\n> parse(msg)\n[ { type: 'plural',\n    arg: 'words',\n    offset: 0,\n    cases:\n     [ { key: 'zero', tokens: [ 'No words' ] },\n       { key: 'one', tokens: [ 'One word' ] },\n       { key: 'other', tokens: [ { type: 'octothorpe' }, ' words' ] } ] } ]\n\n> parse(msg, englishKeys)\n// Error: Invalid key `zero` for argument `words`. Valid plural keys for this\n//        locale are `one`, `other`, and explicit keys like `=0`.\n```\n\nFor more example usage, please take a look at our [test suite](./test.js).\n\n## Structure\n\nThe output of `parse()` is a `Token` array:\n\n```typescript\ntype Token = string | Argument | Plural | Select | Function\n\ntype Argument = {\n  type: 'argument',\n  arg: Identifier\n}\n\ntype Plural = {\n  type: 'plural' | 'selectordinal',\n  arg: Identifier,\n  offset: number,\n  cases: PluralCase[]\n}\n\ntype Select = {\n  type: 'select',\n  arg: Identifier,\n  cases: SelectCase[]\n}\n\ntype Function = {\n  type: 'function',\n  arg: Identifier,\n  key: Identifier,\n  param: {\n    tokens: options.strict ? [string] : (Token | Octothorpe)[]\n  } | null\n}\n\ntype PluralCase = {\n  key: 'zero' | 'one' | 'two' | 'few' | 'many' | 'other' | '=0' | '=1' | '=2' | ...,\n  tokens: (Token | Octothorpe)[]\n}\n\ntype SelectCase = {\n  key: Identifier,\n  tokens: options.strict ? Token[] : (Token | Octothorpe)[]\n}\n\ntype Octothorpe = {\n  type: 'octothorpe'\n}\n\ntype Identifier = string  // not containing whitespace or control characters\n```\n\n---\n\n[Messageformat](https://messageformat.github.io/) is an OpenJS Foundation project, and we follow its [Code of Conduct](https://github.com/openjs-foundation/cross-project-council/blob/master/CODE_OF_CONDUCT.md).\n\n<a href=\"https://openjsf.org\">\n<img width=200 alt=\"OpenJS Foundation\" src=\"https://messageformat.github.io/messageformat/logo/openjsf.svg\" />\n</a>\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/messageformat/messageformat/issues"},"_id":"messageformat-parser@4.1.3","_nodeVersion":"13.10.1","_npmVersion":"lerna/3.20.2/node@v13.10.1+x64 (darwin)","dist":{"integrity":"sha512-2fU3XDCanRqeOCkn7R5zW5VQHWf+T3hH65SzuqRvjatBK7r4uyFa5mEX+k6F9Bd04LVM5G4/BHBTUJsOdW7uyg==","shasum":"b824787f57fcda7d50769f5b63e8d4fda68f5b9e","tarball":"https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-4.1.3.tgz","fileCount":6,"unpackedSize":70035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekxMsCRA9TVsSAnZWagAAkIAQAKEuLGXgLGBE9Qu5iWNN\nDN1VdfBGLilR4d4w6I6M78HMGqrjAWUbuWCdECLMtrCMreC/5dl9xNjSsZTu\nK2vQNq46+cFrXIgehDvZSyfGk0Py7tWJVoflS7uFpYGkB9mTQE3ErmUlh1b9\nZeUSSNq6ZkNQTQKTH/TFIi+8QGywYLleYoU/ZrGE4kDEwvRgkkYFnjoxwMuH\n9GMWQ/c07TzlTtMtOFsTYLG+Er0rh3FgXdE8XeS8xgbrbnDoZGaXhmLDYRtl\nN2gB6cZqqEvDGY01fDhVZv9tNbTDzcFjVb/QPCSuGA3mxXVc81U2FJIGVamL\nnaSRzWQZhJT+Wdznq7GIaJ9YUVcaWExf1Bap9ss/EI6uChKzu8BaAh9SlA3b\nrU94YKsRHqQ6WCeFcCbcK4MVbP6xdU9rDewNOankpdkoCX0sCA3x4QipSINV\nUpmz4bnwotr2FsU1sYNwMP/gJU2vM9FcPu7vtl7CuOnpv4dKHMGpBzENdPIh\nGmmlbOkqtMqNfPoS1q4LP+L7nKrCni2EVHeZhbN/2VtghBJfmN708rOlPeey\ncX7z5FvRDukzc/WhzlICOeuCVqlPeH/qfCuWjOaG1vAKN7yoBllL/syRrVH8\nin/hvBm74o2WTXQyEx9ZMC/4scEl/OZ5YNmwINUhlazlgXpY3dApaGM+Ccik\noHGa\r\n=MUT4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnYIYH1v3xhdl93zz8qWQPzATjs3HXjcNNOFLhK6PU8AIhAL6avJ0Rvp4hpjXKAOgC14zMF7dX5SHOTO/VcF2wS6wM"}]},"maintainers":[{"email":"eemeli@gmail.com","name":"eemeli"},{"email":"alexsexton@gmail.com","name":"slexaxton"}],"_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messageformat-parser_4.1.3_1586697003967_0.2938166965815976"},"_hasShrinkwrap":false}},"readme":"","maintainers":[{"email":"eemeli@gmail.com","name":"eemeli"},{"email":"alexsexton@gmail.com","name":"slexaxton"}],"time":{"modified":"2022-06-19T18:04:50.532Z","created":"2016-04-17T20:13:12.612Z","1.0.0-rc.1":"2016-04-17T20:13:12.612Z","1.0.0":"2016-09-01T22:52:48.007Z","1.1.0":"2017-07-18T06:20:07.085Z","2.0.0":"2017-11-18T10:29:57.058Z","3.0.0-beta.1":"2018-03-17T12:44:27.619Z","3.0.0-beta.2":"2018-03-17T14:25:14.280Z","3.0.0":"2018-04-04T09:11:35.035Z","4.0.0":"2018-12-05T11:55:46.136Z","4.1.0":"2019-03-03T15:55:24.993Z","4.1.1":"2019-05-02T14:47:48.245Z","4.1.2":"2019-07-17T18:00:36.736Z","4.1.3":"2020-04-12T13:10:04.102Z"},"homepage":"https://messageformat.github.io/","keywords":["icu","messageformat","parser"],"repository":{"type":"git","url":"git+https://github.com/messageformat/messageformat.git"},"contributors":[{"name":"Alex Sexton","email":"alexsexton@gmail.com"},{"name":"Eemeli Aro","email":"eemeli@gmail.com"},{"name":"Nikola Kovacs","email":"nikola.kovacs@gmail.com"},{"name":"Adrian Vogelsgesang","email":"adrian.vogelsgesang@tum.de"}],"bugs":{"url":"https://github.com/messageformat/messageformat/issues"},"license":"MIT","readmeFilename":""}