Releases: ohmjs/ohm
Ohm v16.3.0
Browser bundles: ohm.js • ohm.min.js
New features
- Added support for ES6-style Unicode code point escapes (
\u{...}
) inside terminal expressions. This can be used to specify code points above0xFFFF
. - Range expressions can now match a single code point, rather than being limited to a single, 16-bit code unit. E.g.,
"😇".."😈"
is now a valid range expression.
Bug fixes
- [#357] The "wrong number of arguments for rule" error message now includes the line and column where the error occurred.
Ohm v16.2.0
Browser bundles: ohm.js • ohm.min.js
- Add proper support for ES modules via a Rollup build step (#350)
Ohm v16.1.1
Browser bundles: ohm.js • ohm.min.js
- Eliminates circular dependencies in some internal modules to enable use with Rollup (see #344).
Ohm v16.1.0
Browser bundles: ohm.js • ohm.min.js
Ohm v16.1.0 adds one new feature: the built-in applySyntactic
rule, which allows a syntactic rule to be applied in a lexical context. See #136 for more details.
Ohm v16.0.0
Browser bundles: ohm.js • ohm.min.js
Ohm v16 is primarily about improving the experience of using Ohm with TypeScript. In order to do that, we needed to make some minor breaking changes. With the major version change, we also took the opportunity to clean up and simplify some parts of the API.
All of the breaking changes are described below. For more information about how to modify your existing code to work with Ohm v16, see the upgrade guide.
Breaking changes:
API
- [2519de5]
grammarFromScriptElement
andgrammarsFromScriptElements
have been removed. - [74ff254] The ohm-js package now requires an ES2017 environment. This means that very old browsers (e.g., Internet Explorer and Edge 14 and below) are no longer supported. See caniuse for an overview.
- There is no longer a default semantic action for iteration nodes. Release notes: default semantic actions.
- The
_iter
and_nonterminal
actions now take a variable number of arguments, rather than a singleNode[]
argument. Release notes: args to _iter and _nonterminal actions. - (TypeScript only): On semantics objects, the methods
addOperation
,extendOperation
,addAttribute
, andextendAttribute
now have a required type parameter, which is the return type of the operation (or the type of the attribute). The related typesAction
andActionDict
are similarly parameterized by the return type of the semantic actions. Release notes: type parameters for operations and actions.
Other notable changes:
- [7d69cde] Node.primitiveValue is now deprecated — Node.sourceString is equivalent, and should be used instead.
- Improvements and additions to the TypeScript declarations (index.d.ts) to make them more accurate and comprehensive.
- [37a2091] The
generateExample
method has been removed from the PExpr class. (It was never part of Ohm's public API.) - [bcbb864] Removed the
ohm-js
executable, as it was only ever intended for internal use. The new @ohm-js/cli package can now be used to generate grammar bundles.