token

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File added in v0.1.0

type File struct {
	Name  string // absolute path
	Base  int
	Lines []Pos // index is line number - 1. value is the position of the start of each line
	Size  int
}

type FileSet

type FileSet struct {
	Base  int
	Files []*File
}

func NewFileSet added in v0.1.0

func NewFileSet() *FileSet

func (*FileSet) AddFile added in v0.1.0

func (fs *FileSet) AddFile(filename string, base int, size int) *File

func (*FileSet) Position added in v0.1.0

func (fs *FileSet) Position(pos Pos) *Position

type Pos

type Pos int
var NoPos Pos = 0

type Position added in v0.1.0

type Position struct {
	Filename string // filename, if any
	Offset   int    // offset, starting at 0
	Line     int    // line number, starting at 1
	Column   int    // column number, starting at 1 (byte count)
}

func (*Position) String added in v0.1.0

func (p *Position) String() string

type Token

type Token string
var ADD Token = "+"

Token

var AND Token = "&"
var INT Token = "INT"

Kind

var STRING Token = "STRING"
var SUB Token = "-"

func (Token) String

func (tok Token) String() string

Jump to

Keyboard shortcuts

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