Skip to content

Commit e25827f

Browse files
committed
Revision 0.9.1
1 parent 4fed4d5 commit e25827f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1219
-4165
lines changed

.github/workflows/build.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
name: Build
1+
name: Test
22
on: [push, pull_request]
33
jobs:
4-
ParseBox:
4+
# -----------------------------------------------------------
5+
# Deno
6+
# -----------------------------------------------------------
7+
Deno:
58
runs-on: ${{ matrix.os }}
9+
timeout-minutes: 2
610
strategy:
711
matrix:
8-
node: [16.x, 18.x, 20.x]
9-
os: [ubuntu-latest, windows-latest, macOS-latest]
12+
node: [20.x]
13+
os: [ubuntu-latest, macOS-latest, windows-latest]
1014
steps:
11-
- uses: actions/checkout@v3
12-
- name: Install Node
13-
uses: actions/setup-node@v3
14-
with:
15-
node-version: ${{ matrix.node }}
15+
- uses: actions/checkout@v4
1616

17-
- name: Install Packages
18-
run: npm install
17+
- name: Install Deno
18+
uses: denoland/setup-deno@v1
19+
with:
20+
deno-version: canary
1921

20-
- name: Build Library
21-
run: npm run build
2222
- name: Test Library
23-
run: npm run test
23+
run: deno task test

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
example/output
2-
node_modules
31
target

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"files.exclude": {
44
"node_modules": true,
55
"package-lock.json": true
6-
}
6+
},
7+
"deno.enable": true
78
}

deno.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"tasks": {
3+
"clean": "deno run -A tasks.ts clean",
4+
"format": "deno run -A tasks.ts format",
5+
"start": "deno run -A tasks.ts start",
6+
"test": "deno run -A tasks.ts test",
7+
"build": "deno run -A tasks.ts build",
8+
"publish": "deno run -A tasks.ts publish"
9+
},
10+
"imports": {
11+
"@sinclair/parsebox": "./src/index.ts"
12+
},
13+
"fmt": {
14+
"lineWidth": 240,
15+
"semiColons": false
16+
},
17+
"exclude": [
18+
"target/**"
19+
],
20+
"compilerOptions": {
21+
"strict": true
22+
}
23+
}

deno.lock

+309
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/ebnf/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
export * from './parse'
30-
export * from './runtime'
31-
export * from './static'
29+
export * from './parse.ts'
30+
export * from './runtime.ts'
31+
export * from './static.ts'

example/ebnf/parse.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ THE SOFTWARE.
2727
---------------------------------------------------------------------------*/
2828

2929
import { Static } from '@sinclair/parsebox'
30-
import { Module } from './runtime'
31-
import { Ebnf } from './static'
30+
import { Module } from './runtime.ts'
31+
import { Ebnf } from './static.ts'
3232

3333
/** Parses a Ebnf module */
3434
export function ParseEbnf<S extends string>(value: S): Static.Parse<Ebnf, S>[0] {

example/ebnf/runtime.ts

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29+
// deno-lint-ignore-file
30+
2931
import { Runtime } from '@sinclair/parsebox'
3032

3133
// ------------------------------------------------------------------

example/index.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
// deno-fmt-ignore-file
2+
13
import { Static, Runtime, Compile } from '@sinclair/parsebox'
2-
import { Syntax } from './typebox/compiled'
3-
import { ParseJson } from './json'
4-
import { ParseEbnf } from './ebnf'
4+
import { Syntax } from './typebox/compiled/index.ts'
5+
import { ParseJson } from './json/index.ts'
6+
import { ParseEbnf } from './ebnf/index.ts'
57

68
// ------------------------------------------------------------------
79
//
@@ -61,12 +63,13 @@ const Json = ParseJson(`{
6163
"z": 3
6264
}`)
6365

66+
console.log(Json)
67+
6468
// ------------------------------------------------------------------
6569
//
6670
// Example: Expression | Interpreted
6771
//
6872
// ------------------------------------------------------------------
69-
// prettier-ignore
7073
{
7174
type Result = Static.Parse<Expr, 'x * (y + z)'> // hover
7275

@@ -121,7 +124,6 @@ const Json = ParseJson(`{
121124
// semantic actions must be implemented manually.
122125
//
123126
// ------------------------------------------------------------------
124-
// prettier-ignore
125127
{
126128
const ListModule = new Runtime.Module({
127129
List: Runtime.Union([

example/json/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
export * from './parse'
30-
export * from './runtime'
31-
export * from './static'
29+
export * from './parse.ts'
30+
export * from './runtime.ts'
31+
export * from './static.ts'

example/json/parse.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ THE SOFTWARE.
2727
---------------------------------------------------------------------------*/
2828

2929
import { Static } from '@sinclair/parsebox'
30-
import { JsonModule } from './runtime'
31-
import { Json } from './static'
30+
import { JsonModule } from './runtime.ts'
31+
import { Json } from './static.ts'
3232

3333
/** Parses a Json string */
3434
export function ParseJson<S extends string>(value: S): Static.Parse<Json, S>[0] {

example/typebox/compiled/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
export * from './syntax'
29+
export * from './syntax.ts'

0 commit comments

Comments
 (0)