scanner

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: MIT Imports: 5 Imported by: 6 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StripCR

func StripCR(b []byte, comment bool) []byte

StripCR removes carriage return characters.

Types

type ErrorHandler

type ErrorHandler func(pos source.FilePos, msg string)

ErrorHandler is an error handler for the scanner.

type Mode

type Mode int

Mode represents a scanner mode.

const (
	ScanComments Mode = 1 << iota
	DontInsertSemis
)

List of scanner modes.

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

Scanner reads the Tengo source text.

func NewScanner

func NewScanner(file *source.File, src []byte, errorHandler ErrorHandler, mode Mode) *Scanner

NewScanner creates a Scanner.

func (*Scanner) ErrorCount

func (s *Scanner) ErrorCount() int

ErrorCount returns the number of errors.

func (*Scanner) Scan

func (s *Scanner) Scan() (tok token.Token, literal string, pos source.Pos)

Scan returns a token, token literal and its position.

Jump to

Keyboard shortcuts

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