Fork me on GitHub

Shift Parser

generates a Shift AST from ECMAScript program text


This demo shows a rendering of the parser output on the right. You may edit its input on the left.

"use strict"; let [x,y,z] = [1,2,3].map(_ => _ * 2); class Person { constructor(name) { = name; } }


npm install shift-parser


import parse from "shift-parser";
let ast = parse("/* ECMAScript program text */");
import {parseScript, parseModule} from "shift-parser";
let scriptAST = parseScript("/* ECMAScript Script text */");
let moduleAST = parseModule("/* ECMAScript Module text */");