Skip to content

Commit 18c764c

Browse files
committed
wasm: fix compiler to be backwards compatible with old prop name
1 parent 6be2d75 commit 18c764c

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

packages/wasm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ohm-js/wasm",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "Compile Ohm.js grammars to WebAsssembly",
55
"main": "dist/index.js",
66
"bin": {

packages/wasm/src/Compiler.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,9 @@ export class Compiler {
918918
case pexprs.Terminal:
919919
return ir.terminal(exp.obj);
920920
case pexprs.UnicodeChar:
921-
return ir.unicodeChar(exp.categoryOrProp);
921+
// Support older versions of ohm-js (<= 17.2.1).
922+
// TODO: Remove this eventually.
923+
return ir.unicodeChar(exp.categoryOrProp ?? exp['category']);
922924
default:
923925
throw new Error(`not handled: ${exp.constructor.name}`);
924926
}

0 commit comments

Comments
 (0)