ohm-js 17.0.4 → 17.1.0-pre
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 +6 -6
- package/dist/ohm-extras.cjs +5370 -2
- package/dist/ohm-extras.js +5370 -2
- package/dist/ohm.cjs +2 -2
- package/dist/ohm.cjs.map +1 -1
- package/dist/ohm.js +3 -3
- package/dist/ohm.min.js +1 -1
- package/extras/extractExamples.js +160 -0
- package/extras/index.d.ts +15 -0
- package/extras/index.mjs +1 -0
- package/extras/ohm-with-examples.ohm +46 -0
- package/package.json +25 -21
- package/src/Semantics.js +1 -1
- package/src/ohm-cmd.js +0 -0
- package/src/version.js +1 -1
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# [Ohm](https://ohmjs.org/) · [](https://www.npmjs.com/package/ohm-js)  · [](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
|
|
|
@@ -31,10 +31,10 @@ The easiest way to get started with Ohm is to use the [interactive editor](https
|
|
|
31
31
|
### Resources
|
|
32
32
|
|
|
33
33
|
- Tutorial: [Ohm: Parsing Made Easy](https://nextjournal.com/dubroy/ohm-parsing-made-easy)
|
|
34
|
-
- The [math example](https://github.com/
|
|
35
|
-
- [Examples](https://github.com/
|
|
34
|
+
- The [math example](https://github.com/ohmjs/ohm/tree/main/examples/math/index.html) is extensively commented and is a good way to dive deeper.
|
|
35
|
+
- [Examples](https://github.com/ohmjs/ohm/tree/main/examples/)
|
|
36
36
|
- [Documentation](doc/README.md)
|
|
37
|
-
- For community support and discussion, join us on [Discord](https://discord.gg/KwxY5gegRQ), [GitHub Discussions](https://github.com/
|
|
37
|
+
- For community support and discussion, join us on [Discord](https://discord.gg/KwxY5gegRQ), [GitHub Discussions](https://github.com/ohmjs/ohm/discussions), or the [ohm-discuss mailing list](https://groups.google.com/u/0/g/ohm-discuss).
|
|
38
38
|
- For updates, follow [@\_ohmjs on Twitter](https://twitter.com/_ohmjs).
|
|
39
39
|
|
|
40
40
|
### Installation
|
|
@@ -163,7 +163,7 @@ Ohm has two tools to help you debug grammars: a text trace, and a graphical visu
|
|
|
163
163
|
|
|
164
164
|
You can [try the visualizer online](https://ohmjs.org/editor).
|
|
165
165
|
|
|
166
|
-
To see the text trace for a grammar `g`, just use the [`g.trace()`](
|
|
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
|
|
168
168
|
object, it returns a Trace object — calling its `toString` method returns a string describing
|
|
169
169
|
all of the decisions the parser made when trying to match the input. For example, here is the
|
|
@@ -203,4 +203,4 @@ our [suggestions for publishing grammars](./doc/publishing-grammars.md).
|
|
|
203
203
|
## Contributing to Ohm
|
|
204
204
|
|
|
205
205
|
Interested in contributing to Ohm? Please read [CONTRIBUTING.md](./CONTRIBUTING.md)
|
|
206
|
-
and the [Ohm Contributor Guide](
|
|
206
|
+
and the [Ohm Contributor Guide](doc/contributing.md).
|