com.shapesecurity.shift.es2018.parser.README.md Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of es2018 Show documentation
Show all versions of es2018 Show documentation
Shift format ECMAScript 2018 AST tooling
Shift AST Parser
================
## Description
The `Parser.parseScript` function parses a String of ECMAScript program text using `Script` as the goal symbol, and either returns a `Script` node or throws a `ParseError`. Similarly, the `Parser.parseModule` function parses a String of ECMAScript program text using `Module` as the goal symbol, and either returns a `Module` node or throws a `ParseError`.
## Usage
```java
import com.shapesecurity.shift.parser.Parser;
String js = "a; b;";
Script p = Parser.parseScript(js);
Module m = Parser.parseModule(js);
```
© 2015 - 2025 Weber Informatics LLC | Privacy Policy