parseman 0.14.0 → 0.14.1
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/dist/functional/run.d.ts.map +1 -1
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +5 -0
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4943,6 +4943,11 @@ function parseDoc(registry, rootRule, input, opts = {}) {
|
|
|
4943
4943
|
// src/functional/run.ts
|
|
4944
4944
|
var invoke = (r, input, pos, ctx) => typeof r === "function" ? r(input, pos, ctx) : r.parse(input, pos, ctx);
|
|
4945
4945
|
function run(entry, input, options = {}) {
|
|
4946
|
+
if (typeof entry !== "function" && typeof entry?.parse !== "function") {
|
|
4947
|
+
throw new TypeError(
|
|
4948
|
+
`run(): start production is ${entry === null ? "null" : typeof entry}, not a rule \u2014 the requested grammar rule does not exist (check the rule name).`
|
|
4949
|
+
);
|
|
4950
|
+
}
|
|
4946
4951
|
const triviaLog = [];
|
|
4947
4952
|
const errors = [];
|
|
4948
4953
|
const ctx = {
|