Package-Level Type Names (only one, which is exported)
/* sort exporteds by: | */
Scanner defines a lexical scanner
Error is called for each error encountered. If no Error
function is set, the error is reported to os.Stderr.
ErrorCount is incremented by one for each error encountered.
// Source buffer for advancing and scanning
// length of last character in bytes
// length of last line in characters (for correct column reporting)
// previous position, used for peek() method
// Source buffer for immutable access
Source Position
// current position
// token text end position
tokPos is the start position of most recently scanned token; set by
Scan. The Filename field is always left untouched by the Scanner. If
an error is reported (via Error) and Position is invalid, the scanner is
not inside a token.
// token text start position
Scan scans the next token and returns the token.
err prints the error of any scanning to s.Error function. If the function is
not defined, by default it prints them to os.Stderr
next reads the next rune from the bufferred reader. Returns the rune(0) if
an error occurs (or io.EOF is returned).
peek returns the next rune without advancing the reader.
recentPosition returns the position of the character immediately after the
character or token returned by the last call to Scan.
scanDigits scans a rune with the given base for n times. For example an
octal notation \184 would yield in scanDigits(ch, 8, 3)
scanEscape scans an escape sequence
scanExponent scans the remaining parts of an exponent after the 'e' or 'E'
rune.
scanFraction scans the fraction after the '.' rune
scanIdentifier scans an identifier and returns the literal string
scanMantissa scans the mantissa beginning from the rune. It returns the next
non decimal rune. It's used to determine wheter it's a fraction or exponent.
scanNumber scans a HCL number definition starting with the given rune
scanString scans a quoted string
unread unreads the previous read Rune and updates the source position
func New(src []byte) *Scanner
Package-Level Functions (total 7, in which 1 are exported)
New creates and initializes a new instance of Scanner using src as
its source content.
digitVal returns the integer value of a given octal,decimal or hexadecimal rune
isHexadecimal returns true if the given rune is a decimal number
isHexadecimal returns true if the given rune is a decimal digit
isHexadecimal returns true if the given rune is an hexadecimal number
isHexadecimal returns true if the given rune is a letter
isWhitespace returns true if the rune is a space, tab, newline or carriage return
Package-Level Constants (only one, which is unexported)
eof represents a marker rune for the end of the reader.
The pages are generated with Goldsv0.3.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.