# parslets

> ##Parslets

Latest version **2.0.4** (published 2015-07-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install parslets
pnpm add parslets
yarn add parslets
bun add parslets
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2015-07-26 |
| First published | 2015-07-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Platon Korzh |
| Maintainers | pkorzh |

## Links

- npm: https://www.npmjs.com/package/parslets
- Repository: https://github.com/pkorzh/parslets
- Homepage: https://github.com/pkorzh/parslets#readme
- Issues: https://github.com/pkorzh/parslets/issues
- npm.io page: https://npm.io/package/parslets

## Recent versions

- 2.0.4 (latest) — 2015-07-26
- 2.0.3 — 2015-07-26
- 2.0.2 — 2015-07-26
- 2.0.1 — 2015-07-25
- 2.0.0 — 2015-07-25
- 1.0.4 — 2015-07-24
- 1.0.2 — 2015-07-24
- 1.0.0 — 2015-07-23

## README

#parslets

##Parslets

`partlets.lValue`

Consumes identifier or literal.

`partlets.rValue`

Consumes identifier.

`partlets.formalArgs`

Consumes formal arguments list.

`parslets.actualArgs`

Consumes actual arguments list.

`parslets.arith`

Options:

- postfixOps
- unaryOps

Consumes arith expression.

##Example

###Parsing arith expressions

	var util     = require('util');
	var parslets = require('parslets');
	var toker    = require('toker');
	var lex      = new toker.LexicalAnalyzer('2 + 2 * -2');


	var tokens = lex.getTokens();
	var tw     = new parslets.TokenWrapper(tokens);
	var parsed = tw.consume(parslets.arith());

	console.log(util.inspect(parsed, {showHidden: false, depth: null}));
	
Will output:

    { type: 'binary',
      left: 
       { source: undefined,
         loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } },
         lexeme: 2,
         tag: 'decimalLiteral' },
      op: 
       { source: undefined,
         loc: { start: { line: 1, column: 2 }, end: { line: 1, column: 3 } },
         lexeme: '+',
         tag: 'operator' },
      right: 
       { type: 'binary',
         left: 
          { source: undefined,
            loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } },
            lexeme: 2,
            tag: 'decimalLiteral' },
         op: 
          { source: undefined,
            loc: { start: { line: 1, column: 6 }, end: { line: 1, column: 7 } },
            lexeme: '*',
            tag: 'operator' },
         right: 
          { type: 'unary',
            op: 
             { source: undefined,
               loc: { start: { line: 1, column: 8 }, end: { line: 1, column: 9 } },
               lexeme: '-',
               tag: 'operator' },
            expr: 
             { source: undefined,
               loc: { start: { line: 1, column: 9 }, end: { line: 1, column: 10 } },
               lexeme: 2,
               tag: 'decimalLiteral' } } } }

---
_Source: https://npm.io/package/parslets · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
