Registry / devops / lark-js

lark-js

JSON →
library0.1.4pypypiunverified

An extension to the Lark parser library that generates standalone JavaScript parsers. Current version 0.1.4 (infrequent releases).

pip install lark-js
INSTALL
IMPORT
SIG · LARK-JS
L
lark-js
devopspythonv0.1.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Lark_JS
from larkjs import Lark_JS
from lark_js import Lark_JS

Generate a JavaScript standalone parser from a Lark grammar.

from lark import Lark from lark_js import Lark_JS grammar = ''' start: "a" ''' parser = Lark(grammar) lark_js = Lark_JS(parser) js_code = lark_js.generate() print(js_code)
Debug
Known issues
gotchaLark_JS expects a Lark object, not a string grammar directly.
fix
Instantiate Lark first, then pass it to Lark_JS.
affects: all
gotchaThe generated JavaScript requires a runtime (lark.js) on the client side.
fix
Include the lark.js runtime in your HTML/Node project (available via npm).
affects: all
deprecatedSome Lark grammar features (e.g., dynamic terminals) may not be fully supported in JS generation.
fix
Check the lark-js documentation for supported grammar features.
affects: <=0.1.4
Upgrade
Version history
0.1.4latest on PyPI · released May 16, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
lark-js — pip install lark-js · libregistry