Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
DiscreteTom committed Apr 16, 2023
1 parent 6accdf5 commit 7a5c974
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ yarn add retsac
- The Parser, co-work with the lexer and produce an [AST (Abstract Syntax Tree)](https://github.com/DiscreteTom/retsac/blob/main/src/parser/ast.ts).
- By default retsac provides an ELR(Expectational LR) parser.
- Support **meta characters** like `+*?` when defining a grammar rule, just like in Regex.
- Support **conflict detection** (for reduce-shift conflicts and reduce-reduce conflicts), try to **auto resolve conflicts** by peeking the rest of input, you can also set grammar rule's **priority** or self-associativity to auto generate resolvers. Besides, we provide a **code generator** as the low-level API to manually resolve conflict, .
- Support **conflict detection** (for reduce-shift conflicts and reduce-reduce conflicts), try to **auto resolve conflicts** by peeking the rest of input, you can also set grammar rule's **priority** or **self-associativity** to auto generate resolvers. Besides, we provide a **code generator** as the low-level API to manually resolve conflict, .
- Query children nodes by using `$('name')` to avoid accessing them using ugly index like `children[0]`. You can also rename nodes if you want to query nodes with same type using different names.
- Optional data reducer to make it possible to get a result value when the parse is done.
- Optional traverser to make it easy to invoke a top-down traverse after the AST is build.
Expand All @@ -37,9 +37,9 @@ yarn add retsac

## Resources

- [Documentation & API reference](https://discretetom.github.io/retsac/)
- [VSCode extension](https://github.com/DiscreteTom/vscode-retsac)
- [Demo programming language](https://github.com/DiscreteTom/dt0)
- [Documentation & API reference.](https://discretetom.github.io/retsac/)
- [VSCode extension.](https://github.com/DiscreteTom/vscode-retsac)
- [Demo programming language which compiles to WebAssembly.](https://github.com/DiscreteTom/dt0)

## [Examples](https://github.com/DiscreteTom/retsac/tree/main/example)

Expand All @@ -59,7 +59,7 @@ const lexer = new Lexer.Builder()
number: /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/,
})
.define(Lexer.wordType("true", "false", "null")) // type's name is the literal value
.anonymous(Lexer.exact(..."[]{},:"))
.anonymous(Lexer.exact(..."[]{},:")) // single char borders
.build();

export const parser = new ELR.AdvancedBuilder<any>()
Expand Down
8 changes: 4 additions & 4 deletions README.src.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ yarn add retsac
- The Parser, co-work with the lexer and produce an [AST (Abstract Syntax Tree)](https://github.com/DiscreteTom/retsac/blob/main/src/parser/ast.ts).
- By default retsac provides an ELR(Expectational LR) parser.
- Support **meta characters** like `+*?` when defining a grammar rule, just like in Regex.
- Support **conflict detection** (for reduce-shift conflicts and reduce-reduce conflicts), try to **auto resolve conflicts** by peeking the rest of input, you can also set grammar rule's **priority** or self-associativity to auto generate resolvers. Besides, we provide a **code generator** as the low-level API to manually resolve conflict, .
- Support **conflict detection** (for reduce-shift conflicts and reduce-reduce conflicts), try to **auto resolve conflicts** by peeking the rest of input, you can also set grammar rule's **priority** or **self-associativity** to auto generate resolvers. Besides, we provide a **code generator** as the low-level API to manually resolve conflict, .
- Query children nodes by using `$('name')` to avoid accessing them using ugly index like `children[0]`. You can also rename nodes if you want to query nodes with same type using different names.
- Optional data reducer to make it possible to get a result value when the parse is done.
- Optional traverser to make it easy to invoke a top-down traverse after the AST is build.
Expand All @@ -37,9 +37,9 @@ yarn add retsac

## Resources

- [Documentation & API reference](https://discretetom.github.io/retsac/)
- [VSCode extension](https://github.com/DiscreteTom/vscode-retsac)
- [Demo programming language](https://github.com/DiscreteTom/dt0)
- [Documentation & API reference.](https://discretetom.github.io/retsac/)
- [VSCode extension.](https://github.com/DiscreteTom/vscode-retsac)
- [Demo programming language which compiles to WebAssembly.](https://github.com/DiscreteTom/dt0)

## [Examples](https://github.com/DiscreteTom/retsac/tree/main/example)

Expand Down

0 comments on commit 7a5c974

Please sign in to comment.