token

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 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

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       // :
	DoubleColon // ::
	Ellipsis    // ...
	Or          // |
	And         // &
	Assign      // =

	This     // $this
	Array    // array
	Object   // object
	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