token

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Copyright 2025 The Hulo Authors. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pos

type Pos int
const NoPos Pos = 0

The zero value for Pos is NoPos; there is no file and line information associated with it, and NoPos.IsValid() is false. NoPos is always smaller than any other Pos value. The corresponding Position value for NoPos is the zero value for Position.

func (Pos) IsValid

func (p Pos) IsValid() bool

IsValid reports whether the position is valid.

type Token

type Token uint32
const (
	ILLEGAL Token = iota // ILLEGAL

	ADD // +
	SUB // -
	MUL // *
	DIV // /
	MOD // %

	EQU // EQU
	NEQ // NEQ
	LSS // LSS
	LEQ // LEQ
	GTR // GTR
	GEQ // GEQ

	AND // AND
	OR  // OR
	NOT // NOT

	ADD_ASSIGN // +=
	SUB_ASSIGN // -=
	MUL_ASSIGN // *=
	DIV_ASSIGN // /=
	MOD_ASSIGN // %=

	// This is the bitwise and operator
	BITAND // &
	// This is the bitwise or operator
	BITOR // |
	// This is the bitwise xor or Exclusive or operator
	BITXOR // ^

	ANDAND // &&
	OROR   // ||

	ASSIGN        // =
	DOUBLE_ASSIGN // ==

	COMMA // ,
	SEMI  // ;

	RdrOut // >
	AppOut // >>
	RdrIn  // <

	// Unary Operators
	TILDE // ~
	EXCL  // !

	COLON        // :
	DOUBLE_COLON // ::

	LPAREN // (
	RPAREN // )
	LBRACE // {
	RBRACE // }
	LBRACK // [
	RBRACK // ]

	AT // @

	REM  // Rem
	IF   // if
	GOTO // goto
	FOR  // for
	DO   // do
	IN   // in
	CALL // Call

	EOF // EOF
)

func (Token) IsValid

func (t Token) IsValid() bool

func (Token) String

func (i Token) String() string

Jump to

Keyboard shortcuts

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