token

package
v0.0.0-...-b6e707d Latest Latest
Warning

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

Go to latest
Published: May 1, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package token defines tokens of GoCaml source codes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind int
const (
	ILLEGAL Kind = iota
	COMMENT
	LPAREN
	RPAREN
	IDENT
	BOOL
	NOT
	INT
	FLOAT
	MINUS
	PLUS
	MINUS_DOT
	PLUS_DOT
	STAR_DOT
	SLASH_DOT
	EQUAL
	LESS_GREATER
	LESS_EQUAL
	LESS
	GREATER
	GREATER_EQUAL
	IF
	THEN
	ELSE
	LET
	IN
	REC
	COMMA
	ARRAY_MAKE
	DOT
	LESS_MINUS
	SEMICOLON
	STAR
	SLASH
	BAR_BAR
	AND_AND
	ARRAY_LENGTH
	STRING_LITERAL
	PERCENT
	MATCH
	WITH
	BAR
	SOME
	NONE
	MINUS_GREATER
	FUN
	COLON
	TYPE
	LBRACKET_BAR
	BAR_RBRACKET
	LBRACKET
	RBRACKET
	EXTERNAL
	EOF
)

type Token

type Token struct {
	Kind  Kind
	Start locerr.Pos
	End   locerr.Pos
	File  *locerr.Source
}

Token instance for GoCaml. It contains its location information and kind.

func (*Token) String

func (tok *Token) String() string

String returns an information of token. This method is used mainly for debug purpose.

func (*Token) Value

func (tok *Token) Value() string

Value returns the corresponding a string part of code.

Jump to

Keyboard shortcuts

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