Add a small syntax cheatsheet
I grouped all Nearley matching constructs in one block to make them easier to find and compare with other languages.
-
"if"- matchifliterally -
"if"i- matchifcase-insensitive -
.- match any symbol except newline -
[^]- match anything including newline -
[a-zA-Z]- match symbols in range -
[^a-zA-Z]- match symbols not in range -
:+- match previous construction one or more time -
:*- match zero times or more -
:?- zero time or one time
As I am editing this from the GitHub, I can not preview and format it to proper HTML, but I hope it makes documentation already a bit more useful. The completely undocumented thing was [^] and . behavior from #348 and #400.
Can you also include the constructs for tokens matched by custom lexers?
Can you also include the constructs for tokens matched by custom lexers?
I wish I could, but for now I am not sure what are those custom lexers, and what constructs they produce. Still trying to build my first Nearly parser.
I've found that there are .md files that I should edit instead of .html. Fixed now.
As a side note, have you considered telling GitHub to serve content from the docs/ folder?
https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site
That would make it a little bit more intuitive for new users..
Preview https://abitrolly.github.io/nearley/docs/grammar.html#matching-rules