diff options
| author | Shulhan <ms@kilabit.info> | 2023-12-13 01:53:54 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-12-13 01:55:08 +0700 |
| commit | a246ce37711974a23c77452a84ac74c7bf0af7d3 (patch) | |
| tree | 8e9448404dd07df0dc06f66287efc868370fb7c9 /lib/parser/parser_example_test.go | |
| parent | 77c0cbe885985e6ccaf530226a34b24fef65b27e (diff) | |
| download | pakakeh.go-a246ce37711974a23c77452a84ac74c7bf0af7d3.tar.xz | |
lib/parser: removed, this package has been merged into lib/strings
Diffstat (limited to 'lib/parser/parser_example_test.go')
| -rw-r--r-- | lib/parser/parser_example_test.go | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/lib/parser/parser_example_test.go b/lib/parser/parser_example_test.go deleted file mode 100644 index b4c4c9f5..00000000 --- a/lib/parser/parser_example_test.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2019, Shulhan <ms@kilabit.info>. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package parser - -import ( - "fmt" - "strings" -) - -func ExampleNew() { - content := "[test]\nkey = value" - p := New(content, "=[]") - - for { - token, del := p.Token() - token = strings.TrimSpace(token) - fmt.Printf("%q %q\n", token, del) - if del == 0 { - break - } - } - // Output: - // "" '[' - // "test" ']' - // "key" '=' - // "value" '\x00' -} - -func ExampleParser_TokenTrimSpace() { - var ( - content = " 1 , \r\t\f, 2 , 3 , 4 , " - p = New(content, `,`) - - tok string - r rune - ) - for { - tok, r = p.TokenTrimSpace() - fmt.Printf("%q\n", tok) - if r == 0 { - break - } - } - // Output: - // "1" - // "" - // "2" - // "3" - // "4" - // "" -} |
