Skip to content

Commit

Permalink
~NPM quick patch
Browse files Browse the repository at this point in the history
  • Loading branch information
AjaniBilby committed Jul 16, 2023
1 parent 2187c50 commit 1f8c640
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
*

!bin/*
!bin/artifacts/*
!bin/legacy/*
!bin/lib/*
!bin/wasm/*
!dist/*
!changelog.md
!package.json
Expand Down
5 changes: 5 additions & 0 deletions docs/source/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Version 4.0.1

### Fixes:
- [x] NPM didn't include some critical files for some reason...

## Version 4.0.0

### Additions
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bnf-parser",
"version": "4.0.0",
"version": "4.0.1",
"description": "Deterministic BNF compiler/parser",
"homepage": "https://bnf-parser.ajanibilby.com",
"main": "./bin/index.js",
Expand Down
8 changes: 6 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# BNF-Parser <!-- no toc -->

[![Reflection Test](https://github.com/AjaniBilby/BNF-parser/actions/workflows/npm-load-check.yml/badge.svg?branch=master)](https://github.com/AjaniBilby/BNF-parser/actions/workflows/npm-load-check.yml)
[![Test](https://github.com/AjaniBilby/BNF-parser/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/AjaniBilby/BNF-parser/actions/workflows/test.yml)

Compile your bnfs down to WebAssembly for maximum parsing speed; with generated type definitions to make using the syntax tree outputs a breeze. The compiled output from this library is platform agnostic, so it can run anywhere `new WebAssembly.Instance()` is a valid function. It bundles the WebAssembly module inside of a single js file so it can be easily incorporated into any bundler. The type definitions for a given bnf are just that, a definitions file - so if you don't want to use typescript or type hints you can go wild by ignoring it.
Expand All @@ -10,8 +9,13 @@ Compile your bnfs down to WebAssembly for maximum parsing speed; with generated
program ::= %w* statement+ ;
block ::= %("block" w+) ...name %(w* "{" w*) seq_stmt* %("}" w*) ;
```
```bash
npx bnf-compile ./syntax.bnf
```
```ts
const tree = syntax.program(input).root;
import * as syntax from "syntax.js";

const tree = syntax.Parse_Program(input).root;
const block = program.value[0];
const name: string = block.value[0]; // typescript knows this **will** be a string
```
Expand Down

0 comments on commit 1f8c640

Please sign in to comment.