import { Token } from "./tokenizer/index" ; import { augmentError , initParser , state } from "./traverser/base" ; import { parseFile } from "./traverser/index" ; export class File { tokens : Array < Token > ; constructor ( tokens ) { this . tokens = tokens ; } } export function parse ( input ) { initParser ( input ) ; const result = parseFile ( ) ; if ( state . error ) { throw augmentError ( state . error ) ; } return result ; }