token

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package token contains constants which are used when lexing a program written in the cozy language, as done by the parser.

Index

Constants

View Source
const (
	AND             = "&&"
	ASSIGN          = "="
	ASTERISK        = "*"
	ASTERISK_EQUALS = "*="
	BANG            = "!"
	BIT_AND         = "&"
	BIT_XOR         = "^"
	BIT_NOT         = "~"
	BIT_OR          = "|"
	COLON           = ":"
	COMMA           = ","
	CURRENT_ARGS    = "..."
	DOCSTRING       = "DOCSTRING"
	ELSE            = "ELSE"
	EOF             = "EOF"
	EQ              = "=="
	FALSE           = "FALSE"
	FLOAT           = "FLOAT"
	FOR             = "FOR"
	FOREACH         = "FOREACH"
	FUNCTION        = "FUNCTION"
	GT              = ">"
	GT_EQUALS       = ">="
	IDENT           = "IDENT"
	IF              = "IF"
	ILLEGAL         = "ILLEGAL"
	IMPORT          = "IMPORT"
	IN              = "IN"
	INT             = "INT"
	LBRACE          = "{"
	LBRACKET        = "["
	BIT_LEFT_SHIFT  = "<<"
	LET             = "LET"
	BIT_RIGHT_SHIFT = ">>"
	LPAREN          = "("
	LT              = "<"
	LT_EQUALS       = "<="
	MINUS           = "-"
	MINUS_EQUALS    = "-="
	MINUS_MINUS     = "--"
	MOD             = "%"
	MUTABLE         = "MUTABLE"
	NOT_EQ          = "!="
	NULL            = "null"
	OR              = "||"
	PERIOD          = "."
	PLUS            = "+"
	PLUS_EQUALS     = "+="
	PLUS_PLUS       = "++"
	POW             = "**"
	QUESTION        = "?"
	RANGE           = ".."
	RBRACE          = "}"
	RBRACKET        = "]"
	RETURN          = "RETURN"
	RPAREN          = ")"
	SEMICOLON       = ";"
	SLASH           = "/"
	SLASH_EQUALS    = "/="
	SPREAD          = "...."
	STRING          = "STRING"
	TRUE            = "TRUE"
)

pre-defined Type

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	Type    Type
	Literal string
}

Token struct represent the lexer token

type Type

type Type string

Type is a string

func LookupIdentifier

func LookupIdentifier(identifier string) Type

LookupIdentifier used to determinate whether identifier is keyword nor not

Jump to

Keyboard shortcuts

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