2 Commits

Author SHA1 Message Date
amery b94c917736 Merge branch 'pr-amery-readme' 2023-08-31 15:15:31 +00:00
amery 94cd60d407 README: add initial description of the package
and badges

Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-08-31 15:13:11 +00:00
+4 -2
View File
@@ -25,7 +25,7 @@ better understanding of the ideas behind **asciigoat**.
### lexer.Reader ### lexer.Reader
The lexer package provides [`lexer.Reader`][godoc-lexer-reader] which is The lexer package provides [`lexer.Reader`][godoc-lexer-reader] which is
actually an [`io.RuneScanner`](https://pkg.go.dev/io#RuneScanner) actually [`io.RuneScanner`](https://pkg.go.dev/io#RuneScanner)
that buffers accepted runes until you are ready to that buffers accepted runes until you are ready to
[emit](https://pkg.go.dev/asciigoat.org/core/lexer#Reader.Emit) or [emit](https://pkg.go.dev/asciigoat.org/core/lexer#Reader.Emit) or
[discard](https://pkg.go.dev/asciigoat.org/core/lexer#Reader.Discard). [discard](https://pkg.go.dev/asciigoat.org/core/lexer#Reader.Discard).
@@ -35,6 +35,7 @@ that buffers accepted runes until you are ready to
[`lexer.Position`](https://pkg.go.dev/asciigoat.org/core/lexer#Position) [`lexer.Position`](https://pkg.go.dev/asciigoat.org/core/lexer#Position)
is a `(Line, Column)` pair with methods to facilitate tracking is a `(Line, Column)` pair with methods to facilitate tracking
your position on the source [Reader](https://pkg.go.dev/io#Reader). your position on the source [Reader](https://pkg.go.dev/io#Reader).
...
### lexer.Error ### lexer.Error
@@ -44,8 +45,9 @@ token position and hint attached.
### lexer.StateFn ### lexer.StateFn
At the heart of **asciigoat** we have _state functions_ as proposed on [Rob Pike's famous talk](https://www.youtube.com/watch?v=HxaD_trXwRE) which return the next _state function_ parsing is done. At the heart of **asciigoat** we can _state functions_ as proposed on [Rob Pike's famous talk](https://www.youtube.com/watch?v=HxaD_trXwRE) which return the next _state function_ parsing is done.
Additionally there is a [`Run()`](https://pkg.go.dev/asciigoat.org/lexer#Run) helper that implements the loop. Additionally there is a [`Run()`](https://pkg.go.dev/asciigoat.org/lexer#Run) helper that implements the loop.
...
### rune checkers ### rune checkers