Maurice Makaay
|
41f8733e99
|
Pfff, okay, so today I found a rather nice way of writing a parser that can hold some internal state, while stell holding on to the basic principle of having a function signature the applies to every parse handler in the system. By using methods instead of stand-alone functions, it is possible to let the accompanying struct hold on to the required state. Implemented this principle for the two calculator example projects. The rest is quite broken now, sorry :-p
|
2019-05-27 23:24:07 +00:00 |
Maurice Makaay
|
f7d1e28fa1
|
Dropped the whole channel support for the parser internals. It seems a nice idea to work with, but it's hard to predict how much buffering the channel should have to make all parsers work. When the buffer is too small, then a StateHandler that emits more items than can be buffered will end up in a deadlock and stall the application. It is easy enough to replace the channel with a slice of Items, so I did.
|
2019-05-26 11:32:45 +00:00 |
Maurice Makaay
|
c6fde2cf4e
|
A big round of getting-ya-terminology-straight.
|
2019-05-26 09:25:34 +00:00 |
Maurice Makaay
|
2751c78003
|
Got rid of the full On()...etc chains for both code clarity and usability clarity. Working on good examples and shaving the API's accordingly.
|
2019-05-25 22:53:04 +00:00 |
Maurice Makaay
|
bb1e462892
|
Ah, found a good way to document larger examples which need function definitions and such. Let's see if this works in godoc nicely.
|
2019-05-25 14:37:38 +00:00 |