Skip to content

Commit

Permalink
~Tweaked shared artifact importing
Browse files Browse the repository at this point in the history
  • Loading branch information
AjaniBilby committed Sep 21, 2023
1 parent 8f7c39d commit 3a17139
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"files.trimTrailingWhitespace": false
},
"cSpell.words": [
"binaryen"
"binaryen",
"Deno"
]
}
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.7

### Fixes:
- [x] Slightly altered the import of `shared.js` from `[syntax].js` to handle better with Deno compatibility

## Version 4.0.6

### Fixes:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/static/dist/bnf-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,7 @@ function CompileRule(rule) {
`export declare function Parse_${capName} (i: string, refMapping?: boolean): _Shared.ParseError | {\n\troot: _Shared.SyntaxNode & ${typeName},\n\treachBytes: number,\n\treach: null | _Shared.Reference,\n\tisPartial: boolean\n}\n`;
}
function CompileTypes(lang) {
return `import type _Shared from './shared.js';\n` +
return `import type * as _Shared from './shared.js';\n` +
`export type _Literal = { type: "literal", value: string, start: number, end: number, count: number, ref: _Shared.ReferenceRange };\n` +
[...lang.terms.keys()]
.map(x => CompileRule(lang.terms.get(x))) // hush Typescript it's okay
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.6",
"version": "4.0.7",
"description": "Deterministic BNF compiler/parser",
"homepage": "https://bnf-parser.ajanibilby.com",
"main": "./bin/index.js",
Expand Down
2 changes: 1 addition & 1 deletion source/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function CompileRule(rule: Rule) {


export function CompileTypes(lang: Parser) {
return `import type _Shared from './shared.js';\n`+
return `import type * as _Shared from './shared.js';\n`+
`export type _Literal = { type: "literal", value: string, start: number, end: number, count: number, ref: _Shared.ReferenceRange };\n` +
[...lang.terms.keys()]
.map(x => CompileRule(lang.terms.get(x) as any)) // hush Typescript it's okay
Expand Down

0 comments on commit 3a17139

Please sign in to comment.