Skip to content

ayecue/miniscript-core

Repository files navigation

miniscript-core

miniscript-core

Basic Lexer and Parser for MiniScript.

Install

npm install --save miniscript-core

Lexer

Options

  • validator - define custom validator
  • tabWidth - define the used tab width in file
  • unsafe - will parse invalid MiniScript without throwing (useful for debugging)

Usage

const content = 'print "hello world"';
const lexer = new Lexer(content);
const parser = new Parser(content, { lexer });
const payload = parser.parseChunk(); // AST

Parser

Options

  • validator - define custom validator
  • astProvider - define custom ast provider
  • lexer - define custom lexer
  • tabWidth - define the used tab width in file
  • unsafe - will parse invalid MiniScript without throwing (useful for debugging)

Usage

const content = 'print "hello world"';
const parser = new Parser(content);
const payload = parser.parseChunk(); // AST

About

MiniScript Parser & Lexer in TypeScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published