acorn-logical-assignment

Support for logical assignments in acorn

acorn>=7.4 supports logical assignments
Last updated 6 years ago by adrianheine .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install acorn-logical-assignment 
SYNC missed versions from official npm registry.

Logical assignment support for Acorn

NPM version

This is a plugin for Acorn - a tiny, fast JavaScript parser, written completely in JavaScript.

It implements support for logical assignments as defined in the stage 3 proposal Logical Assignments. The AST follows ESTree.

Usage

This module provides a plugin that can be used to extend the Acorn Parser class to parse logical assignments. You can either choose to use it via CommonJS (for example in Node.js) like this

var acorn = require('acorn');
var logicalAssignment = require('acorn-logical-assignment');
acorn.Parser.extend(logicalAssignment).parse('x ||= y');

or as an ECMAScript module like this:

import {Parser} from 'acorn';
import logicalAssignment from 'path/to/acorn-logical-assignment.mjs';
Parser.extend(logicalAssignment).parse('x ||= y');

License

This plugin is released under an MIT License.

Current Tags

  • 0.1.4                                ...           latest (6 years ago)

5 Versions

  • 0.1.4 [deprecated]           ...           6 years ago
  • 0.1.3 [deprecated]           ...           6 years ago
  • 0.1.2 [deprecated]           ...           6 years ago
  • 0.1.1 [deprecated]           ...           6 years ago
  • 0.1.0 [deprecated]           ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 4
Last Month 5
Dependencies (0)
None
Dev Dependencies (7)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |