Token Collection Token Collection When Esprima parser is performing the syntactical analysis, first it needs to break down the source into a series of tokens. By default, the t...
Tolerant Mode Tolerant Mode When Esprima parser is given an input that does not represent a valid JavaScript program, it throws an exception. With the tolerant mode however, th...
Browser Compatibility Browser Compatibility In a certain specific case, Esprima parser intentionally does not throw an exception (indicating a syntax error) although the input ...
Browser Compatibility Browser Compatibility In a certain specific case, Esprima parser intentionally does not throw an exception (indicating a syntax error) although the input ...
Line and Block Comments Line and Block Comments By default, Esprima tokenizer ignores every line and block comment. If each comment needs to be included in the output, then the...
Distinguishing a Script and a Module Distinguishing a Script and a Module With ES2015 and later, a JavaScript program can be either a script or a module . It is a very importan...
Distinguishing a Script and a Module Distinguishing a Script and a Module With ES2015 and later, a JavaScript program can be either a script or a module . It is a very importan...
Chapter 3. Lexical Analysis (Tokenization) Chapter 3. Lexical Analysis (Tokenization) Esprima tokenizer takes a string as an input and produces an array of tokens, a list of ob...
Chapter 1. Getting Started Chapter 1. Getting Started Esprima is a tool to perform lexical and syntactical analysis of JavaScript programs. Esprima itself is also written in Ja...
Chapter 2. Syntactic Analysis (Parsing) Chapter 2. Syntactic Analysis (Parsing) The main use case of Esprima is to parse a JavaScript program. This is also known as syntactic a...