A library and language for building parsers, interpreters, compilers, etc.
MIT License
Browser bundles: ohm.js • ohm.min.js
extractExamples
to the extras
module, which can extract example inputs — written with a special comment syntax — from grammar definitions.Published by pdubroy over 1 year ago
Browser bundles: ohm.js • ohm.min.js
_buildGrammar
back to exports. (It's a private API used by the Ohm Editor.)ohm.version
reports the correct value. Due to a change in the build scripts, it was stuck at '17.0.0'.Published by pdubroy over 1 year ago
Browser bundles: ohm.js • ohm.min.js
any
now consumes an entire code point (i.e., a full Unicode character), not just a single, 16-bit code unit.namespace
, extendNamespace
) have been removed. (These were always optional.)ohm-js/extras
.BaseActionDict<T>
, a new supertype of ActionDict<T>
.ohm.util
is removed from the public API. getLineAndColumn
and getLineAndColumn
have been moved into the extras
module.toAST
for the built-in list rules (ListOf
and friends). Both the syntactic (ListOf
, ...) and lexical versions (listOf
, ...) are now represented as arrays, with the separators discarded. Previously, the syntactic versions were represented by arrays, but with separators included, and the lexical versions were represented as strings (just like other lexical rules).toString
on a non-root nodegrammarFromScriptElement
and grammarsFromScriptElements
functions have been entirely removed.asIteration
operationInterval.getLineAndColumn
primitiveValue
property of nodes, which was deprecated in Ohm v16, has now been completely removed.Published by pdubroy almost 2 years ago
Browser bundles: ohm.js • ohm.min.js
inputStream
property; but they do have a sourceString
property.Published by pdubroy almost 2 years ago
Browser bundles: ohm.js • ohm.min.js
Interval.getLineAndColumn()
asIteration
operationPublished by pdubroy about 2 years ago
Published by pdubroy over 2 years ago
Published by pdubroy over 2 years ago
Browser bundles: ohm.js • ohm.min.js
Node.isOptional()
Published by pdubroy over 2 years ago
Browser bundles: ohm.js • ohm.min.js
...
) not working in the Ohm EditorPublished by pdubroy over 2 years ago
Browser bundles: ohm.js • ohm.min.js
Published by pdubroy over 2 years ago
Browser bundles: ohm.js • ohm.min.js
\u{...}
) inside terminal expressions. This can be used to specify code points above 0xFFFF
."😇".."😈"
is now a valid range expression.Published by pdubroy almost 3 years ago
Browser bundles: ohm.js • ohm.min.js
Published by pdubroy almost 3 years ago
Browser bundles: ohm.js • ohm.min.js
Published by pdubroy almost 3 years ago
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.
Published by pdubroy about 3 years ago
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.
API
grammarFromScriptElement
and grammarsFromScriptElements
have been removed._iter
and _nonterminal
actions now take a variable number of arguments, rather than a single Node[]
argument. Release notes: args to _iter and _nonterminal actions.
addOperation
, extendOperation
, addAttribute
, and extendAttribute
now have a required type parameter, which is the return type of the operation (or the type of the attribute). The related types Action
and ActionDict
are similarly parameterized by the return type of the semantic actions. Release notes: type parameters for operations and actions.
generateExample
method has been removed from the PExpr class. (It was never part of Ohm's public API.)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.