Compare commits
2 Commits
v0.3.7
..
b94c917736
| Author | SHA1 | Date | |
|---|---|---|---|
| b94c917736 | |||
| 94cd60d407 |
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user