From 211aed7660064d1f64e063c7481283882a564f68 Mon Sep 17 00:00:00 2001 From: Patrick Dubroy Date: Mon, 2 May 2022 09:51:32 +0200 Subject: [PATCH] chore: Replace git.io links with links to ohmjs.org --- doc/releases/ohm-js-16.0.md | 6 +++--- doc/syntax-reference.md | 2 +- examples/math/index.html | 2 +- packages/ohm-js/index.d.ts | 4 ++-- packages/ohm-js/scripts/data/index.d.ts.template | 4 ++-- packages/ohm-js/src/Grammar.js | 2 +- packages/ohm-js/src/errors.js | 4 ++-- packages/ohm-js/src/main.js | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/releases/ohm-js-16.0.md b/doc/releases/ohm-js-16.0.md index ea60cb46..e571ae59 100644 --- a/doc/releases/ohm-js-16.0.md +++ b/doc/releases/ohm-js-16.0.md @@ -4,13 +4,13 @@ ### Args to _\_iter_ and _\_nonterminal_ actions - + The [`_iter` and `_nonterminal` actions](../api-reference.md#special-actions) now take a variable number of arguments, rather than a single `Node[]` argument containing the child nodes. To make existing code work with Ohm v16, you should change the parameter to a [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters) — e.g., `_iter(children) { ... }` should be changed to `_iter(...children) { ... }`. You can easily find code that needs to change because `addOperation` and friends will now throw an exception if your actions have a single parameter which is _not_ a rest parameter. See [#324](https://github.com/harc/ohm/issues/324) for the reasons behind this change. ### Default semantic actions - + In operations and attributes, if you haven't defined a semantic action for a particular rule application node, a default action will be used in some cases. For example, your grammar has an _AddExp_ rule but your action dictionary doesn't contain a semantic action named 'AddExp'. **In Ohm v16.0, there is no longer a default action for iteration nodes** — it is _only_ defined for non-terminal nodes with exactly one child. See [#309](https://github.com/harc/ohm/issues/309) for context on this change. @@ -26,7 +26,7 @@ _iter(...children) { ### grammarFromScriptElement / grammarsFromScriptElements - + The functions `grammarFromScriptElement` and `grammarsFromScriptElements` have been removed. When using Ohm in the browser, it's now recommended to put your grammar in a [template literal with String.raw](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/raw): diff --git a/doc/syntax-reference.md b/doc/syntax-reference.md index 824a9099..9be5fefc 100644 --- a/doc/syntax-reference.md +++ b/doc/syntax-reference.md @@ -250,7 +250,7 @@ AddExp_plus = AddExp "+" MulExp

Syntactic vs. Lexical Rules

- + A _syntactic rule_ is a rule whose name begins with an uppercase letter, and _lexical rule_ is one whose name begins with a lowercase letter. The difference between lexical and syntactic rules is that syntactic rules implicitly skip whitespace characters. diff --git a/examples/math/index.html b/examples/math/index.html index fa46f636..61a4ec10 100644 --- a/examples/math/index.html +++ b/examples/math/index.html @@ -14,7 +14,7 @@ and the `String.raw` tag. The template literal syntax enables multi-line strings, and String.raw makes it simpler to - use escape codes like "\n" in your grammars -- see https://git.io/J0gPJ for more details. + use escape codes like "\n" in your grammars -- see https://ohmjs.org/d/sc for more details. */ const source = String.raw` // An Ohm grammar for arithmetic expressions. diff --git a/packages/ohm-js/index.d.ts b/packages/ohm-js/index.d.ts index 7353b931..f7265d45 100644 --- a/packages/ohm-js/index.d.ts +++ b/packages/ohm-js/index.d.ts @@ -13,7 +13,7 @@ declare namespace ohm { /** * grammarFromScriptElement was removed in Ohm v16.0. See - * https://git.io/Jwow5 for more info. + * https://ohmjs.org/d/gfs for more info. * @deprecated */ function grammarFromScriptElement(node?: unknown, namespace?: Namespace): Grammar; @@ -28,7 +28,7 @@ declare namespace ohm { /** * grammarsFromScriptElements was removed in Ohm v16.0. See - * https://git.io/Jwow5 for more info. + * https://ohmjs.org/d/gfs for more info. * @deprecated */ function grammarsFromScriptElements(nodeList?: unknown, namespace?: Namespace): Namespace; diff --git a/packages/ohm-js/scripts/data/index.d.ts.template b/packages/ohm-js/scripts/data/index.d.ts.template index dfbb62ce..1e95d919 100644 --- a/packages/ohm-js/scripts/data/index.d.ts.template +++ b/packages/ohm-js/scripts/data/index.d.ts.template @@ -12,7 +12,7 @@ declare namespace ohm { /** * grammarFromScriptElement was removed in Ohm v16.0. See - * https://git.io/Jwow5 for more info. + * https://ohmjs.org/d/gfs for more info. * @deprecated */ function grammarFromScriptElement(node?: unknown, namespace?: Namespace): Grammar; @@ -27,7 +27,7 @@ declare namespace ohm { /** * grammarsFromScriptElements was removed in Ohm v16.0. See - * https://git.io/Jwow5 for more info. + * https://ohmjs.org/d/gfs for more info. * @deprecated */ function grammarsFromScriptElements(nodeList?: unknown, namespace?: Namespace): Namespace; diff --git a/packages/ohm-js/src/Grammar.js b/packages/ohm-js/src/Grammar.js index aeb45d09..63a47f20 100644 --- a/packages/ohm-js/src/Grammar.js +++ b/packages/ohm-js/src/Grammar.js @@ -140,7 +140,7 @@ Grammar.prototype = { if (k === '_iter' || k === '_nonterminal') { details = `it should use a rest parameter, e.g. \`${k}(...children) {}\`. ` + - 'NOTE: this is new in Ohm v16 — see https://git.io/Jz4CI for details.'; + 'NOTE: this is new in Ohm v16 — see https://ohmjs.org/d/ati for details.'; } else { details = `expected ${expected}, got ${actual}`; } diff --git a/packages/ohm-js/src/errors.js b/packages/ohm-js/src/errors.js index bd928d6d..a59bf19c 100644 --- a/packages/ohm-js/src/errors.js +++ b/packages/ohm-js/src/errors.js @@ -168,7 +168,7 @@ function invalidParameter(ruleName, expr) { const syntacticVsLexicalNote = 'NOTE: A _syntactic rule_ is a rule whose name begins with a capital letter. ' + - 'See https://git.io/JiYgP for more details.'; + 'See https://ohmjs.org/d/svl for more details.'; function applicationOfSyntacticRuleFromLexicalContext(ruleName, applyExpr) { return createError( @@ -298,7 +298,7 @@ function missingSemanticAction(ctorName, name, type, stack) { if (ctorName === '_iter') { moreInfo = [ '\nNOTE: as of Ohm v16, there is no default action for iteration nodes — see ', - ' https://git.io/JRwtG for details.', + ' https://ohmjs.org/d/dsa for details.', ].join('\n'); } diff --git a/packages/ohm-js/src/main.js b/packages/ohm-js/src/main.js index c253fdd7..f143d5a2 100644 --- a/packages/ohm-js/src/main.js +++ b/packages/ohm-js/src/main.js @@ -295,13 +295,13 @@ function grammars(source, optNamespace) { function grammarFromScriptElement(optNode) { throw new Error( - 'grammarFromScriptElement was removed in Ohm v16.0. See https://git.io/Jwow5 for more info.' + 'grammarFromScriptElement was removed in Ohm v16.0. See https://ohmjs.org/d/gfs for more info.' ); } function grammarsFromScriptElements(optNodeOrNodeList) { throw new Error( - 'grammarsFromScriptElements was removed in Ohm v16.0. See https://git.io/Jwow5 for more info.' + 'grammarsFromScriptElements was removed in Ohm v16.0. See https://ohmjs.org/d/gfs for more info.' ); }