token

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package token contains the definition of the lexical tokens of the TypeScript programming language.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind int

Kind is the set of lexical tokens of the TypeScript programming language.

const (
	// Special tokens.
	Illegal Kind = iota
	EOF

	// Comments.
	Comment     // // or /* */ at the beginning of a line
	LineComment // // or /* */ at the end of a line

	// Identifiers and literals.
	Ident  // main, const, extends, etc.
	Number // 12345
	String // "abc"

	// Operators.
	Or     // |
	Assign // =
	Minus  // -

	// Delimiters and punctuation.
	LParen    // (
	RParen    // )
	LBrack    // [
	RBrack    // ]
	LBrace    // {
	RBrace    // }
	LAngle    // <
	RAngle    // >
	Comma     // ,
	Dot       // .
	Colon     // :
	Semicolon // ;
	Question  // ?
)

func (Kind) IsLiteral

func (k Kind) IsLiteral() bool

func (Kind) String

func (k Kind) String() string

type Token

type Token struct {
	Kind Kind
	Text string
}

Token represents a lexical token of the TypeScript programming language. Identifiers and literals are accompanied by the corresponding text.

Jump to

Keyboard shortcuts

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