commit | 3f9dc14a707a5325f2579075251876977f1e7e15 | [log] [tgz] |
---|---|---|
author | Joseph Pecoraro <joepeck02@gmail.com> | Tue Sep 10 18:15:20 2019 -0700 |
committer | Ariya Hidayat <ariya.hidayat@gmail.com> | Fri Sep 13 23:16:18 2019 -0700 |
tree | 2d81a9d7ba68585d619ad9f999ee49b80fc5d3a1 | |
parent | 5e55171feb5adbc2b1d28ef4b2628d5ea9af0848 [diff] |
Fix Unexpected ILLEGAL token with function literal in template strings Fixes #1991 Closes gh-1994
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.