This is a criticmarkup lezer grammar.
The characters for strings are taken from here.
It has Addition
, Deletion
, Comment
, Highlight
and Substitution
nodes. Those are the full nodes. That means for working with the text, you need to parse the individual nodes.
- Remove the 3 characters at the beginning and end
- Substitutions have a
DivideSubs
in the middle which is part of the tree. - A
Highlight
is only a highlight. If the intention is to have a comment with it, you need to check whether a comment follows immediately.
The tests are passing.
Things you'll need to do (see the language support example for a more detailed tutorial):
-
git grep EXAMPLE
and replace all instances with your language name. -
Rewrite the grammar in
src/syntax.grammar
to cover your language. See the Lezer system guide for information on this file format. -
Adjust the metadata in
src/index.ts
to work with your new grammar. (I only removed properties, do we need to add custom properties?) -
Adjust the grammar tests in
test/cases.txt
. -
Build (
npm run prepare
) and test (npm test
). (needs to be done each time the grammar is changed) -
Rewrite this readme file.
-
Optionally add a license.
-
Publish. If you want to use a
@codemirror/lang-...
package name, open an issue to ask for npm publish rights for that name.