Skip to content
/ jsont Public

Go JSON Tokenizer that also emits insignificant tokens (like whitespaces)

License

Notifications You must be signed in to change notification settings

dawi/jsont

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsont

A JSON tokenizer that also emits insignificant tokens like whitespaces.

{ "Hello" : "World" }

Will be split into the following tokens:

|{| |"Hello"| |:| |"World"| |}|

Usage

tokenizer := jsont.NewTokenizer(strings.NewReader(jsonInput))

for tokenizer.Next() {
	token := tokenizer.Token()
	fmt.Println(token.Type)
	fmt.Println(token.Value)
}                                                                                                                                   

if tokenizer.Error() != nil {
	fmt.Println(tokenizer.Error())
}

Disclaimer

About

Go JSON Tokenizer that also emits insignificant tokens (like whitespaces)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages