com.shapesecurity.shift.es2017.validator.README.md Maven / Gradle / Ivy
Shift AST Validator
===========================
## Description
The `Validator.validate` function validates an AST and returns a list of validation errors.
## Usage
```java
import com.shapesecurity.shift.parser.Parser;
import com.shapesecurity.shift.ast.Program;
import com.shapesecurity.shift.scope.ScopeAnalyzer;
import com.shapesecurity.shift.js.valid.Validator;
import com.shapesecurity.shift.js.valid.ValidationError;
String source = "a; b;";
Script script = new Parser(source).parse();
List errs = Validator.validate(script);
```