token

package
v0.0.0-...-12a5152 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: MIT Imports: 6 Imported by: 1

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 ScanError

type ScanError struct {
	Pos Pos
	Err error
}

func (*ScanError) Error

func (e *ScanError) Error() 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() (tok 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
	Whitespace
	Comment
	DocComment

	Ident
	Int
	Float
	String
	Var
	InlineHTML

	OpenTag     // <?php
	CloseTag    // ?>
	Dollar      // $
	Backslash   // \
	Qmark       // ?
	Lparen      // (
	Rparen      // )
	Lbrack      // [
	Rbrack      // ]
	Lbrace      // {
	Rbrace      // }
	Add         // +
	Sub         // -
	Assign      // =
	Lt          // <
	Gt          // >
	Period      // .
	Comma       // ,
	Colon       // :
	DoubleColon // ::
	Semicolon   // ;
	Ellipsis    // ...
	Or          // |
	And         // &
	Quo         // /
	Shl         // <<
	Shr         // >>
	Arrow       // ->
	DoubleArrow // =>

	Abstract   // abstract
	As         // as
	Break      // break
	Case       // case
	Catch      // catch
	Class      // class
	Clone      // clone
	Const      // const
	Continue   // continue
	Declare    // declare
	Default    // default
	Do         // do
	Else       // else
	Extends    // extends
	Final      // final
	Finally    // finally
	Fn         // fn
	For        // for
	Foreach    // foreach
	Function   // function
	Goto       // goto
	If         // if
	Implements // implements
	Instanceof // instanceof
	Insteadof  // insteadof
	Interface  // interface
	Namespace  // namespace
	New        // new
	Private    // private
	Protected  // protected
	Public     // public
	Return     // return
	Static     // static
	Switch     // switch
	Throw      // throw
	Trait      // trait
	Try        // try
	Use        // use
	While      // while

)

func (Type) String

func (i Type) String() string

Source Files

  • token.go
  • type_string.go

Jump to

Keyboard shortcuts

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