token

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pos

type Pos struct {
	Line, Column int
}

func (Pos) String

func (p Pos) String() string

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

func NewScanner

func NewScanner(r io.Reader) *Scanner

func (*Scanner) Err added in v0.2.0

func (s *Scanner) Err() error

func (*Scanner) Next

func (s *Scanner) Next() Token

type Token

type Token struct {
	Type Type
	Text string
	Pos  Pos
}

func (Token) String

func (t Token) String() string

type Type

type Type uint
const (
	Illegal Type = iota
	EOF
	Newline // \n
	Whitespace

	Ident
	Tag
	Var
	String
	Int
	Other

	OpenDoc  // /**
	CloseDoc // */

	Asterisk  // *
	Backslash // \
	Qmark     // ?
	Lparen    // (
	Rparen    // )
	Lbrack    // [
	Rbrack    // ]
	Lbrace    // {
	Rbrace    // }
	Lt        // <
	Gt        // >
	Comma     // ,
	Colon     // :
	Ellipsis  // ...
	Or        // |
	And       // &

	This     // $this
	Array    // array
	Callable // callable
	Static   // static

)

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