ohm

A library and language for building parsers, interpreters, compilers, etc.

MIT License

Downloads
576.1K
Stars
4.9K
Committers
39
ohm - Ohm v17.1.0 Latest Release

Published by pdubroy over 1 year ago

NPM
Browser bundles: ohm.jsohm.min.js

New features:

  • Added extractExamples to the extras module, which can extract example inputs — written with a special comment syntax — from grammar definitions.
ohm - Ohm v17.0.4

Published by pdubroy over 1 year ago

NPM
Browser bundles: ohm.jsohm.min.js

Fixes

  • [c2e552d]: Add _buildGrammar back to exports. (It's a private API used by the Ohm Editor.)
  • [4d9ee89]: Ensure ohm.version reports the correct value. Due to a change in the build scripts, it was stuck at '17.0.0'.
ohm - Ohm v17.0.3

Published by pdubroy over 1 year ago

NPM
Browser bundles: ohm.jsohm.min.js

Release notes

Breaking changes:

  • [#424]: any now consumes an entire code point (i.e., a full Unicode character), not just a single, 16-bit code unit.
  • [55c787b]: The namespace helpers (namespace, extendNamespace) have been removed. (These were always optional.)
  • [bea0be9]: When used as an ES module, the main 'ohm-js' module now has only named exports (i.e., no default export). The same is true for ohm-js/extras.
  • [#395]: In generated type definitions, action dictionary types now inherit from BaseActionDict<T>, a new supertype of ActionDict<T>.
  • [9e32f8d]: ohm.util is removed from the public API. getLineAndColumn and getLineAndColumn have been moved into the extras module.
  • [#398]: Changed the default behavior 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).

Other notable changes:

  • [#416]: Fix crash when calling toString on a non-root node
  • [13c8991]: The deprecated grammarFromScriptElement and grammarsFromScriptElements functions have been entirely removed.
  • Improvements to the TypeScript types:
    • [#407]: Added types for the built-in asIteration operation
    • [#410]: Added types for Interval.getLineAndColumn
  • [#368]: The primitiveValue property of nodes, which was deprecated in Ohm v16, has now been completely removed.
ohm - Ohm v16.6.0

Published by pdubroy almost 2 years ago

NPM
Browser bundles: ohm.jsohm.min.js

Bug fixes

  • Fixed an issue with the Interval types: they no longer have an inputStream property; but they do have a sourceString property.

New features

  • Added type information for remaining methods of Interval
ohm - Ohm v16.5.0

Published by pdubroy almost 2 years ago

NPM
Browser bundles: ohm.jsohm.min.js

New features

  • [#410] Added type information for Interval.getLineAndColumn()
  • [#407] Added type information for built-in asIteration operation
ohm - Ohm v16.4.0

Published by pdubroy about 2 years ago

NPM
Browser bundles: ohm.jsohm.min.js

New features

  • [#390] Added type information for ohm.pexprs
ohm - Ohm v16.3.4

Published by pdubroy over 2 years ago

NPM
Browser bundles: ohm.jsohm.min.js

Bug fixes

  • Proper fix for #374.
ohm - Ohm v16.3.3

Published by pdubroy over 2 years ago

NPM
Browser bundles: ohm.jsohm.min.js

Bug fixes

  • [#374] Fixed incorrect type annotation for Node.isOptional()
ohm - Ohm v16.3.2

Published by pdubroy over 2 years ago

NPM
Browser bundles: ohm.jsohm.min.js

Bug fixes

ohm - Ohm v16.3.1

Published by pdubroy over 2 years ago

NPM
Browser bundles: ohm.jsohm.min.js

Bug fixes

  • [#366]: Fix #363 by removing imports of ohm-js from extras (it’s not required)
ohm - Ohm v16.3.0

Published by pdubroy over 2 years ago

NPM
Browser bundles: ohm.jsohm.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 above 0xFFFF.
  • 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 - Ohm v16.2.0

Published by pdubroy almost 3 years ago

NPM
Browser bundles: ohm.jsohm.min.js

  • Add proper support for ES modules via a Rollup build step (#350)
ohm - Ohm v16.1.1

Published by pdubroy almost 3 years ago

NPM
Browser bundles: ohm.jsohm.min.js

  • Eliminates circular dependencies in some internal modules to enable use with Rollup (see #344).
ohm - Ohm v16.1.0

Published by pdubroy almost 3 years ago

NPM
Browser bundles: ohm.jsohm.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 - Ohm v16.0.0

Published by pdubroy about 3 years ago

NPM
Browser bundles: ohm.jsohm.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 and grammarsFromScriptElements 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 single Node[] argument. Release notes: args to _iter and _nonterminal actions.
  • (TypeScript only): On semantics objects, the methods 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.

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.