lc2-compiler
v2.2.9
Published
lemoncase2 parser
Downloads
45
Readme
api
This main exported function takes a lc2 code string and
returns an abstract syntax tree
export function parse(input: string, options?: configObject): Object;
This function tries to parse a single expression
Useful for REPL, testing, and parsing mixed-language formats
export function parseAt(input: string, options?: configObject): Object;
How to use parse file
const parseFile = require('lc2-compiler/pre');
parseFile('your code', {sourceFile: 'path/to/your/code'});
Note that sourceFile
option is required