lexer

package
v0.0.0-...-0effba1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package lexer includes functionality for scanning a Plan source file into a sequence of tokens.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Scan

func Scan(source []byte) <-chan Lexeme

Scan scans the given Plan source, producing a sequence of lexical tokens.

Once the end of the file is reached, or an error is encountered, the channel will be closed, resulting in an endless sequence of EndOfFile tokens.

Types

type Lexeme

type Lexeme struct {
	Token    token.Token
	Position token.Position
	Value    string
}

Lexeme describes a token, its position, and its textual value.

func (Lexeme) String

func (l Lexeme) String() string

Jump to

Keyboard shortcuts

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