pax_global_header 0000666 0000000 0000000 00000000064 14316543224 0014516 g ustar 00root root 0000000 0000000 52 comment=ea38135ac5914db765abeb56df2fed7e5610b5a5
no-context-moo-ea38135/ 0000775 0000000 0000000 00000000000 14316543224 0014737 5 ustar 00root root 0000000 0000000 no-context-moo-ea38135/.github/ 0000775 0000000 0000000 00000000000 14316543224 0016277 5 ustar 00root root 0000000 0000000 no-context-moo-ea38135/.github/CONTRIBUTING.md 0000664 0000000 0000000 00000004035 14316543224 0020532 0 ustar 00root root 0000000 0000000
Remember...
Philosophy
----------
> _Some thoughts on what moo is/isn't, for dev types._
Moo is a very fast lexer.
The input to Moo is a character stream. The output is a list of tokens.
You define _rules_ for matching patterns in a stream. A rule defines both a pattern to match, and the `type` to label it with. A Token object tells the contents of the match (its `value`), its `type`, and the position in the stream.
Keywords are a natural extension to this model: they let you further specialise a pattern. When a keyword matches it relabels the token to instead have the `type` of the keyword.
The rules get compiled down to a single regular expression. At its core, moo is a fancy helper for combining rules into a RegExp, and working out which rule matched.
Moo provides primitives for manipulating the stream--`reset` and `save`--so that you can implement your own streaming strategy on top.
Under this view of moo, it seems hard to justify including `states` in moo itself--states could just as well be a library on top of moo, that performed a `save` and `reset` call every time it wanted to switch lexers! However, I think we can justify including states due to a) efficiency--the scheme above sounds expensive--and b) convenience. Stateful lexers are common enough that it's worth including them in the core of moo.
...as opposed to things like skipping whitespace tokens, or a scheme to generate INDENT and DEDENT tokens from Python-style indentation, which can very easily be a library. Providing support for that sort of thing inside moo itself would probably involve transformer functions, which would entail a polymorphic function call on the matched rule--which would reduce performance for everybody.
Similarly, error handling has to be in moo core, because it couldn't be added as a library. But it's simple enough, and returns enough information, for you to decide what to do about errors yourself--specific to your own application. (Usually, though, all you want to do is raise the error moo gives you!).
no-context-moo-ea38135/.github/feelings.png 0000664 0000000 0000000 00000221625 14316543224 0020611 0 ustar 00root root 0000000 0000000 PNG
IHDR | 3 l PLTE 0 tRNS *~YG:/,)(+.8@CHScsX'EZgpzn<
Row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