0.0.1 • Published 4 years ago

acorn-do-expressions v0.0.1

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

acorn-do-expressions

Acorn plugin for parsing do-expressions proposal.

Unstable, as this proposal is still in stage-1, it might get changed.

Also this plugin is a part of my learning process of acorn and parsing js code. So it may not be a recommended way to do the parsing.

Usage

This module provides a plugin that can be used to extend the Acorn Parser class to parse do expressions.

const { Parser } = require('acorn');
const doExpressions = require('acorn-do-expressions');
Parser.extend(doExpressions).parse(
  `let x = do {
    h1()
  };`
);
0.0.1

4 years ago