matchers

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitKeywordMatcher

func InitKeywordMatcher(newKeywords []string) func() func(r rune, currentText *string) MatcherResult

func InitSymbolMatcher

func InitSymbolMatcher(newSymbols []string) func() func(r rune, currentText *string) MatcherResult

func StartFloatMatcher

func StartFloatMatcher() func(r rune, currentText *string) MatcherResult

func StartIdentifierMatcher

func StartIdentifierMatcher() func(r rune, currentText *string) MatcherResult

func StartIntegerMatcher

func StartIntegerMatcher() func(r rune, currentText *string) MatcherResult

func StartStringMatcher

func StartStringMatcher() func(r rune, currentText *string) MatcherResult

func StartWhitespaceMatcher

func StartWhitespaceMatcher() func(r rune, currentText *string) MatcherResult

func StartWordMatcher

func StartWordMatcher() func(r rune, currentText *string) MatcherResult

Types

type MatcherResult

type MatcherResult struct {
	Token      *Token
	Err        error
	Precedence int8
}

type Token added in v1.0.2

type Token struct {
	Type   TokenType
	Value  string
	Line   int
	Column int
}

func (*Token) Equals added in v1.0.3

func (t *Token) Equals(ot *Token) bool

type TokenType added in v1.0.2

type TokenType int
const (
	SYSTEM     TokenType = iota
	WORD       TokenType = iota
	WHITESPACE TokenType = iota
	INTEGER    TokenType = iota
	FLOAT      TokenType = iota
	STRING     TokenType = iota
	SYMBOL     TokenType = iota
	KEYWORD    TokenType = iota
	IDENTIFIER TokenType = iota
)

func (TokenType) String added in v1.0.2

func (mt TokenType) String() string

Jump to

Keyboard shortcuts

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