lc2-compiler
TypeScript icon, indicating that this package has built-in type declarations

2.2.9 • Public • Published

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

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i lc2-compiler

    Weekly Downloads

    9

    Version

    2.2.9

    License

    MIT

    Last publish

    Collaborators

    • lichaozhy
    • steambap