From 70dd0ef84c36b8cecaf848b2f60b01bcc5c8f0b7 Mon Sep 17 00:00:00 2001 From: sinclair Date: Fri, 22 Nov 2024 21:24:46 +0900 Subject: [PATCH] Documentation --- readme.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index 0f6b91e..e522095 100644 --- a/readme.md +++ b/readme.md @@ -56,7 +56,7 @@ type R = Static.Parse // type R = [['X', 'Y', 'Z'] ## Overview -ParseBox is a parsing system designed to embed domain-specific languages (DSLs) within the TypeScript type system. It provides a set of type-level and runtime combinators that directly map to BNF notation, which can be used to parse content either at runtime or statically within the type system. +ParseBox is a parsing library designed to embed domain-specific languages (DSLs) within the TypeScript type system. It provides a set of runtime and type-level combinators that enable BNF notation to be encoded within the type system. These combinators can then be used to parse content at runtime or interactively in editor via static type inference. ParseBox is written as a parsing infrastructure for the [TypeBox](https://github.com/sinclairzx81/typebox) and [LinqBox](https://github.com/sinclairzx81/linqbox) projects, enabling these libraries to support advanced runtime parsing for their respective domains. @@ -84,7 +84,7 @@ License MIT ## Combinators -ParseBox provides a set of combinators that map to notation expressible in (E)BNF (Backus-Naur Form). These combinators are named Const, Tuple, Union, Array, and Optional, respectively, to describe the types produced by each combinator. These combinators serve as building blocks for constructing parsers. +ParseBox provides a minimal set of combinators that map to structures expressible in BNF (Backus-Naur Form). These combinators serve as building blocks for constructing parsers. ### Const @@ -130,7 +130,7 @@ const T = Runtime.Tuple([ // const T = { // } -const R = Runtime.Parse(P, 'X Y Z W') // const R = [['X', 'Y', 'Z'], ' W'] +const R = Runtime.Parse(T, 'X Y Z W') // const R = [['X', 'Y', 'Z'], ' W'] ``` ### Union @@ -155,11 +155,11 @@ const T = Runtime.Union([ // const T = { // ] // } -const R1 = Runtime.Parse(P, 'X E') // const R1 = ['X', ' E'] +const R1 = Runtime.Parse(T, 'X E') // const R1 = ['X', ' E'] -const R2 = Runtime.Parse(P, 'Y E') // const R2 = ['Y', ' E'] +const R2 = Runtime.Parse(T, 'Y E') // const R2 = ['Y', ' E'] -const R3 = Runtime.Parse(P, 'Z E') // const R3 = ['Z', ' E'] +const R3 = Runtime.Parse(T, 'Z E') // const R3 = ['Z', ' E'] ``` ### Array @@ -205,7 +205,7 @@ const T = Runtime.Optional( // const T = { ) // parser: { type: 'Const', value: 'X' } // } -const R1 = Runtime.Parse(T, 'X Y Z') // const R1 = ['X', ' Y Z'] +const R1 = Runtime.Parse(T, 'X Y Z') // const R1 = [['X'], ' Y Z'] const R2 = Runtime.Parse(T, 'Y Z') // const R2 = [[], 'Y Z'] ```