From 1e7ec7553a97ce8daf3e919c60ca05f525abec32 Mon Sep 17 00:00:00 2001 From: Maurice Makaay Date: Tue, 28 May 2019 23:59:02 +0000 Subject: [PATCH] Tiny fix in variable naming, because the test had grown in a different direction. --- examples_state_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples_state_test.go b/examples_state_test.go index 6366bb2..50a2da1 100644 --- a/examples_state_test.go +++ b/examples_state_test.go @@ -13,9 +13,9 @@ import ( "git.makaay.nl/mauricem/go-parsekit" ) -type letterCollection []string +type chunks []string -func (l *letterCollection) AddChopped(s string, chunkSize int) *parsekit.Error { +func (l *chunks) AddChopped(s string, chunkSize int) *parsekit.Error { parser := parsekit.NewParser(func(p *parsekit.ParseAPI) { for p.On(parsekit.C.MinMax(1, chunkSize, parsekit.A.AnyRune)).Accept() { *l = append(*l, p.BufLiteral()) @@ -26,11 +26,11 @@ func (l *letterCollection) AddChopped(s string, chunkSize int) *parsekit.Error { } func Example_usingSliceAsParserState() { - letters := &letterCollection{} - letters.AddChopped("This string will", 4) - letters.AddChopped("be cut to bits!!!!!!", 8) + chunks := &chunks{} + chunks.AddChopped("This string will", 4) + chunks.AddChopped("be cut to bits!!!!!!", 8) - fmt.Printf("Matches = %q", *letters) + fmt.Printf("Matches = %q", *chunks) // Output: // Matches = ["This" " str" "ing " "will" "be cut t" "o bits!!" "!!!!"] }