ohm-js 16.3.0 → 16.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/ohm.esm.js +371 -409
- package/dist/ohm.js +36 -52
- package/dist/ohm.min.js +1 -1
- package/extras/semantics-toAST.js +3 -16
- package/index.d.ts +0 -7
- package/package.json +17 -16
- package/src/CaseInsensitiveTerminal.js +1 -1
- package/src/MatchState.js +6 -2
- package/src/Semantics.js +1 -18
- package/src/errors.js +4 -1
- package/src/nodes.js +21 -32
- package/src/pexprs-eval.js +8 -13
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# [Ohm](https://
|
|
1
|
+
# [Ohm](https://ohmjs.org/) · [](https://www.npmjs.com/package/ohm-js)  [](https://discord.gg/KwxY5gegRQ)
|
|
2
2
|
|
|
3
3
|
Ohm is a parsing toolkit consisting of a library and a domain-specific language. You can use it to parse custom file formats or quickly build parsers, interpreters, and compilers for programming languages.
|
|
4
4
|
|
|
@@ -11,7 +11,7 @@ more from the grammars you write.
|
|
|
11
11
|
- **Object-oriented grammar extension** makes it easy to extend an existing language with new syntax.
|
|
12
12
|
- **Modular semantic actions.** Unlike many similar tools, Ohm completely
|
|
13
13
|
separates grammars from semantic actions. This separation improves modularity and extensibility, and makes both grammars and semantic actions easier to read and understand.
|
|
14
|
-
- **Online editor and visualizer.** The [Ohm Editor](https://
|
|
14
|
+
- **Online editor and visualizer.** The [Ohm Editor](https://ohmjs.org/editor/) provides instant feedback and an [interactive visualization](https://dubroy.com/blog/visualizing-packrat-parsing/) that makes the entire execution of the parser visible and tangible. It'll [make you feel like you have superpowers](https://twitter.com/kylestetz/status/1349770893120172036). 💪
|
|
15
15
|
|
|
16
16
|
Some awesome things people have built using Ohm:
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@ Some awesome things people have built using Ohm:
|
|
|
23
23
|
|
|
24
24
|
## Getting Started
|
|
25
25
|
|
|
26
|
-
The easiest way to get started with Ohm is to use the [interactive editor](https://
|
|
26
|
+
The easiest way to get started with Ohm is to use the [interactive editor](https://ohmjs.org/editor/). Alternatively, you can play with one of the following examples on JSFiddle:
|
|
27
27
|
|
|
28
28
|
- [Basic parsing example](https://jsfiddle.net/pdubroy/p3b1v2xb/)
|
|
29
29
|
- [Arithmetic example with semantics](https://jsfiddle.net/pdubroy/15k63qae/)
|
|
@@ -159,9 +159,9 @@ For more information, see the [main documentation](doc/README.md).
|
|
|
159
159
|
|
|
160
160
|
Ohm has two tools to help you debug grammars: a text trace, and a graphical visualizer.
|
|
161
161
|
|
|
162
|
-
[](https://
|
|
162
|
+
[](https://ohmjs.org/editor)
|
|
163
163
|
|
|
164
|
-
You can [try the visualizer online](https://
|
|
164
|
+
You can [try the visualizer online](https://ohmjs.org/editor).
|
|
165
165
|
|
|
166
166
|
To see the text trace for a grammar `g`, just use the [`g.trace()`](./doc/api-reference.md#trace)
|
|
167
167
|
method instead of `g.match`. It takes the same arguments, but instead of returning a MatchResult
|