Documentation ¶
Overview ¶
much of this code was inspired (meaning copied) from craftinginterpreters
Index ¶
Constants ¶
View Source
const ( ModeNone = 0 // nothing special ModeStrictCapitalization = (1 << iota) // report capitalization errors ModeAlias // interpret the tokens as alias (enables *arg syntax) )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct { // Optional Filename to name the source // this file is read if Source is nil FileName string // Optional ddp-source-code // if nil, FileName is read Source []byte // the mode used during scanning ScannerMode Mode // ErrorHandler used during scanning // May be nil ErrorHandler ddperror.Handler }
Options on where to get the source-tokens from
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
func New ¶
returns a new scanner, or error if one could not be created prefers src, but if src is nil it attempts to read the source-code from filePath
Click to show internal directories.
Click to hide internal directories.