{"_id":"@codincod/codemirror-lang-erlang","name":"@codincod/codemirror-lang-erlang","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@codincod/codemirror-lang-erlang","version":"0.1.0","description":"Erlang language support for the CodeMirror code editor","keywords":["beam","code","codemirror","editor","erlang","otp"],"author":{"name":"CodinCod","email":"hello@codincod.com"},"license":"MIT","type":"module","main":"dist/index.cjs","exports":{"import":"./dist/index.js","require":"./dist/index.cjs"},"module":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"scripts":{"build":"rm -rf dist && lezer-generator src/erlang.grammar -o src/parser.js && cm-buildhelper src/erlang.ts","build-debug":"lezer-generator src/erlang.grammar --names -o src/parser.js && cm-buildhelper src/erlang.ts","prepare":"npm run build","test":"npm run build && node --test \"test/*.test.ts\"","corpus":"npm run build && node ../lezer-survey/src/cli.ts measure --group top","gaps":"npm run build && node ../lezer-survey/src/cli.ts gaps --group top"},"dependencies":{"@codemirror/autocomplete":"^6.0.0","@codemirror/language":"^6.0.0","@lezer/common":"^1.0.0","@lezer/highlight":"^1.0.0","@lezer/lr":"^1.0.0"},"devDependencies":{"@codemirror/buildhelper":"^1.0.2","@codemirror/state":"^6.7.1","@lezer/generator":"^1.7.0","typescript":"^5.6.0"},"homepage":"https://codincod.com/","repository":{"type":"git","url":"https://codeberg.org/reeven/codemirror-lang-erlang"},"gitHead":"73983ca4f477dcdaf82cec0dd9574a6d3bb8e66c","_id":"@codincod/codemirror-lang-erlang@0.1.0","_nodeVersion":"25.0.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-saor4n7PcYjpt4bmDzSHsskQMXM+YTOR76eEPOiVSA98+HnlUidmVgGnq/Qkh+8dH6eVI1a7EWPw/jL+tOey+g==","shasum":"024bc2f7af24db474bfa4c0e16146799642e84a8","tarball":"https://registry.npmjs.org/@codincod/codemirror-lang-erlang/-/codemirror-lang-erlang-0.1.0.tgz","fileCount":14,"unpackedSize":142168,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDTZRf5JMJs9pOT2iZLFVrPZTYeGE6K0+HwdsG4SU3f7QIgZZOff5DzCDW0hjW56ecMsPw2PWUyZzN6eXcu6L/+Kzg="}]},"_npmUser":{"name":"juicemitapfelndrin","email":"juicemitapfelndrin@gmail.com"},"directories":{},"maintainers":[{"name":"juicemitapfelndrin","email":"juicemitapfelndrin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/codemirror-lang-erlang_0.1.0_1786041026722_0.2202582321399955"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-06T18:30:26.573Z","0.1.0":"2026-08-06T18:30:26.900Z","modified":"2026-08-06T18:30:27.100Z"},"maintainers":[{"name":"juicemitapfelndrin","email":"juicemitapfelndrin@gmail.com"}],"description":"Erlang language support for the CodeMirror code editor","homepage":"https://codincod.com/","keywords":["beam","code","codemirror","editor","erlang","otp"],"repository":{"type":"git","url":"https://codeberg.org/reeven/codemirror-lang-erlang"},"author":{"name":"CodinCod","email":"hello@codincod.com"},"license":"MIT","readme":"# @codincod/codemirror-lang-erlang\n\nErlang language support for [CodeMirror 6](https://codemirror.net/), built on a\n[Lezer](https://lezer.codemirror.net/) grammar written from scratch. No Lezer\ngrammar for Erlang existed before this one.\n\n```bash\nnpm install @codincod/codemirror-lang-erlang\n```\n\n```js\nimport {EditorView, basicSetup} from \"codemirror\"\nimport {erlang} from \"@codincod/codemirror-lang-erlang\"\n\nnew EditorView({\n  doc: \"-module(hello).\\n-export([world/0]).\\n\\nworld() -> io:format(\\\"hello~n\\\").\\n\",\n  extensions: [basicSetup, erlang()],\n  parent: document.body\n})\n```\n\n`erlang()` returns the language with completion for keywords, guards and the\ncorner of OTP people reach for. `erlangLanguage` is the language alone, and\n`parser` the Lezer parser under it.\n\n## What it reads\n\nOTP 29's Erlang, which is every version before it plus the parts that arrived\nlate: `maybe` blocks, sigils (`~\"binary\"`, `~B/verbatim/`), triple-quoted\nstrings, `-doc` and `-moduledoc`, the strict generators `<:-` and `<:=`, zip\ngenerators, map comprehensions, `-nominal` types, and the record declarations\nOTP 29 writes as `-record #point{x, y}.`\n\nTwo dialects come with it, because most published Erlang is written in one of\nthem rather than in a module. A form may be a bare expression, which is what\nthe shell is handed, and a pasted shell session is read as what was typed at\neach prompt and the term printed under it.\n\nMeasured against 8923 files of OTP, RabbitMQ, EMQX, ejabberd, Cowboy, rebar3\nand thirteen other projects: 98.11% parse with no error node.\n\n## What it does not read\n\nA `-define` whose body is not an expression. `-define(F(T, R), T:R -> ok)` is\na fragment of a clause and the preprocessor pastes it into place; nothing that\nparses Erlang before the preprocessor runs can read it as anything.\n\n## Development\n\n```bash\nnpm test        # the parse specs and the editor tests\nnpm run corpus  # error-node count over a directory of real Erlang\nnpm run gaps    # what it could not parse, grouped by shape\n```\n\n`npm run corpus` and `npm run gaps` want\n[lezer-survey](https://codeberg.org/reeven/lezer-survey) checked out beside\nthis repository, and a path: `npm run corpus -- ~/corpora/erlang`.\n\n## Licence\n\nMIT.\n","readmeFilename":"README.md","_rev":"1-2f4a189aa1bf635f1d57a19e79653ff2"}