Lexer-specific errors
const ( UnsupportedRuneError string = "Don't know what to do with rune: %q" UnterminatedQuotedStringError string = "Unterminated quoted string" BadNumberSyntax string = "Bad number syntax: %q" )
General lexer constants
const (
EOF = -1
)
AdditionalAlphaNumRunes rune vars
var AdditionalAlphaNumRunes = map[rune]bool{ '>': true, '<': true, '=': true, '-': true, '+': true, '*': true, '&': true, '_': true, '/': true, '?': true, }
func AtomName(atomType AtomType) string
AtomName returns the name of the atom for a given atom value
Atom object
type Atom struct { Type AtomType Pos Pos Value string }
AtomType atom type
type AtomType int
Lexer atom constants
const ( AtomError AtomType = iota AtomEOF AtomLeftParen AtomRightParen AtomLeftVect AtomRightVect AtomIdent AtomString AtomChar AtomFloat AtomInt AtomComplex // Ok, these aren't really atoms but ... AtomQuote AtomQuasiQuote AtomUnquote AtomUnquoteSplice )
Lexer object
type Lexer struct {
// contains filtered or unexported fields
}
func Lex(name, input string) *Lexer
Lex returns a lexer constructor
func (l *Lexer) NextAtom() Atom
NextAtom method
func (l *Lexer) PrintAtoms()
PrintAtoms prints the value of String()
func (l *Lexer) String() string
Pos position type
type Pos int