commit | fe13460e646a0adc3c434ca8c478264ca2e78cec | [log] [tgz] |
---|---|---|
author | Eugene Otto <eugene.otto@gmail.com> | Thu Aug 08 11:47:58 2019 -0700 |
committer | Ariya Hidayat <ariya.hidayat@gmail.com> | Fri Sep 13 23:19:40 2019 -0700 |
tree | 701e36319ef5f3794d6b31df5e6a2e8736b3fd39 | |
parent | 3f9dc14a707a5325f2579075251876977f1e7e15 [diff] |
Fix link from Chapter 2 to Chapter 3 https://github.com/jquery/esprima/issues/1986 Closes gh-1987
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.