commit | a971d877fe7af52d5518d25a758835dc51cd7dbe | [log] [tgz] |
---|---|---|
author | Joseph Pecoraro <joepeck02@gmail.com> | Tue Sep 10 18:13:15 2019 -0700 |
committer | Ariya Hidayat <ariya.hidayat@gmail.com> | Mon Oct 21 18:05:23 2019 -0700 |
tree | 77a391e40ed5d3c87622a884559c561edbd72f01 | |
parent | 9eadf3f250abcb79c948172eb8199daf6664534c [diff] |
Fix Unexpected "Invalid left-hand side in for-in" error Fixes #1920 Fixes #1944 Closes gh-1993
Esprima (esprima.org, BSD license) is a high performance, standard-compliant ECMAScript parser written in ECMAScript (also popularly known as JavaScript). Esprima is created and maintained by Ariya Hidayat, with the help of many contributors.
Esprima can be used to perform lexical analysis (tokenization) or syntactic analysis (parsing) of a JavaScript program.
A simple example on Node.js REPL:
> var esprima = require('esprima'); > var program = 'const answer = 42'; > esprima.tokenize(program); [ { type: 'Keyword', value: 'const' }, { type: 'Identifier', value: 'answer' }, { type: 'Punctuator', value: '=' }, { type: 'Numeric', value: '42' } ] > esprima.parseScript(program); { type: 'Program', body: [ { type: 'VariableDeclaration', declarations: [Object], kind: 'const' } ], sourceType: 'script' }
For more information, please read the complete documentation.