| [MacOS/Linux] | Coverage |
|---|---|
This parser is a clean rewrite of JuDoc's parser and will eventually replace it but could (in principle) also be used to build parsers for other simple markup languages like Common Mark. In fact JuDoc currently relies on Julia's Markdown parser (in stdlib) which does not support Common Mark and so this could be worthwhile.
This package is currently not registered and rather allows to work and test the parser independently of the rest of the machinery. Feel free to fork it though.
Simple Parser is for people who don't want to bother themselves with grammar etc and just want to assume that their parser is doing something similar to what a human would do when reading something like Markdown and does it with some efficiency.
The steps are:
- Find tokens (read the text once and build a list of anything that could mark something to do),
- Find blocks (convert single Tokens groups of Tokens into something that must be processed later on as a block).
- Assemble blocks (convert specific blocks into groups of blocks such as indented lines)
A pass goes over all characters in the text, specific characters trigger a "Pattern" check which is effectively a look-ahead:
- either looking up a single character or a fixed number of characters (e.g.: does this look like "abc"),
- or a greedy look-up taking characters as long as they meet a rule (e.g.: is this a bunch of letters).
What to do is contained in a tokens dictionary.
Placeholder for example