aikoven / slice2json

Parser for the Slice language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

slice2json

Parser for the Slice language.

Usage

import {readFileSync} from 'fs';
import {parse} from 'slice2json';

const contents = readFileSync('MySlice.ice', 'utf-8');
const result = parse(contents);
/*
  {
    "pragmaOnce": true,
    "includes": [...],
    "modules": {
      "type": "module",
      "name": "MyModule",
      "content": [...]
    }
  }
*/

See types.ts for the schema of returned object.

About

Parser for the Slice language


Languages

Language:TypeScript 94.4%Language:Slice 5.6%