https://github.com/anikethsaha/acorn-do-expressions
https://github.com/tc39/proposal-do-expressions
https://github.com/anikethsaha/acorn-do-expressions
acorn parser
Last synced: over 1 year ago
JSON representation
https://github.com/tc39/proposal-do-expressions
- Host: GitHub
- URL: https://github.com/anikethsaha/acorn-do-expressions
- Owner: anikethsaha
- Created: 2020-09-07T16:52:09.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-08T17:04:56.000Z (almost 6 years ago)
- Last Synced: 2025-03-24T03:51:01.596Z (over 1 year ago)
- Topics: acorn, parser
- Language: JavaScript
- Homepage:
- Size: 97.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# acorn-do-expressions
Acorn plugin for parsing [do-expressions](https://github.com/tc39/proposal-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.
```javascript
const { Parser } = require('acorn');
const doExpressions = require('acorn-do-expressions');
Parser.extend(doExpressions).parse(
`let x = do {
h1()
};`
);
```