token

package
v0.0.0-...-9f3482b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Quote

func Quote(s string) string

Quote a string if needed.

If needed s is surrounded with double quotes. Backslashes \ and double quotes " will be escaped with backslashes.

func Unquote

func Unquote(s string) string

Unquote a string if needed.

If s is surrounded by double quotes, escaped backslashes and double quotes will be unescaped. The surrounding quotes will be removed.

Types

type T

type T struct {
	// Raw string including double quotes.
	// Use String() for a cleaned up version.
	Str  string
	Type Type
	Line int
	Col  int
}

func (T) DebugString

func (t T) DebugString() string

func (T) String

func (t T) String() string

type Type

type Type int
const (
	EOF Type = iota
	Linefeed
	Whitespace
	Comment
	BraceOpen
	BraceClose
	QuotedValue
	UnquotedValue
	Invalid
)

func (Type) String

func (i Type) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL