mirror of https://github.com/rwxrob/bonzai
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
473 B
Go
29 lines
473 B
Go
package mark_test
|
|
|
|
import (
|
|
"github.com/rwxrob/bonzai/mark"
|
|
"github.com/rwxrob/scan"
|
|
)
|
|
|
|
func ExamplePlain() {
|
|
s := scan.New("some thing here")
|
|
//s.TraceX()
|
|
s.X(mark.Plain)
|
|
s.Print()
|
|
s.Tree.Root.Print()
|
|
// Output:
|
|
// <EOD>
|
|
// {"T":1,"N":[{"T":10,"V":"some thing here"}]}
|
|
}
|
|
|
|
func ExampleBracketed() {
|
|
s := scan.New("<thing>")
|
|
s.TraceX()
|
|
s.X(mark.Bracketed)
|
|
s.Print()
|
|
s.Tree.Root.Print()
|
|
// Output:
|
|
// <EOD>
|
|
// {"T":1,"N":[{"T":10,"V":"some thing here"}]}
|
|
}
|