commit | 5a46bf8bf8dcd543e7de3ccc347e23bff18b125f | [log] [tgz] |
---|---|---|
author | Ariya Hidayat <ariya.hidayat@gmail.com> | Fri Jan 13 21:55:06 2017 -0800 |
committer | Ariya Hidayat <ariya.hidayat@gmail.com> | Sat Jan 14 10:09:13 2017 -0800 |
tree | e1481c502e2ac198b5fc91f5aa783c6198b6744d | |
parent | 4b0f65ebf92af4df85c523f8387359c71e7284ac [diff] |
Support running the tests on Safari Technology Preview Fix #1710 Closes gh-1729
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.parse(program); { type: 'Program', body: [ { type: 'VariableDeclaration', declarations: [Object], kind: 'const' } ], sourceType: 'script' }
For more information, please read the complete documentation.