A CodeMirror
Language support extension for WKT(Well Known Text) files.
Template forked from codemirror/lang-example.
- Well Known Text
- that production rules are given in section 7.2.2 - 7.2.5
- Coordinate Reference System
- SQL Access
https://www.loc.gov/preservation/digital/formats/fdd/fdd000548.shtml
Test case expressions taken from;
This is an example of how the grammar is tested, pretty nice!
Author's notes;
- https://marijnhaverbeke.nl/blog/lezer.html
- Lezer was inspired by Atom's parser; https://tree-sitter.github.io/tree-sitter/index.html
- https://www.youtube.com/watch?v=1qIee0aHOhY
- hey his blog is great...
community projects
- how would I go about validating something like polygon winding order?
This is an example repository containing a minimal CodeMirror language support package. The idea is to clone it, rename it, and edit it to create support for a new language.
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. -
Adjust the grammar tests in
test/cases.txt
. -
Build (
npm run prepare
) and test (npm test
). -
Rewrite this readme file.
-
Optionally add a license.
-
Publish. Put your package on npm under a name like
codemirror-lang-EXAMPLE
.