const EOF
pub const EOF = -1Purpose
Constant EOF, defining protocol or algorithm parameters.
#text/scannerToken scan: Ident/Int/Float/Char/String; source is an owning string.
const EOFpub const EOF = -1Constant EOF, defining protocol or algorithm parameters.
const IDENTpub const IDENT = -2Constant IDENT, defining protocol or algorithm parameters.
const SCAN_INTpub const SCAN_INT = -3Constant SCAN_INT, defining protocol or algorithm parameters.
const FLOATpub const FLOAT = -4Constant FLOAT, defining protocol or algorithm parameters.
const CHARpub const CHAR = -5Constant CHAR, defining protocol or algorithm parameters.
const SCAN_STRINGpub const SCAN_STRING = -6Constant SCAN_STRING, defining protocol or algorithm parameters.
const RAW_STRINGpub const RAW_STRING = -7Constant RAW_STRING, defining protocol or algorithm parameters.
const COMMENTpub const COMMENT = -8Constant COMMENT, defining protocol or algorithm parameters.
struct Scannerpub struct Scanner {
pub src string
pub pos int
pub line int
pub col int
pub tok int
pub text string
pub tok_line int
pub tok_col int
}Structure encapsulating src, pos, line, col, tok.
src stringpos intline intcol inttok inttext stringtok_line inttok_col intnewpub fn new(src &string) ScannerConstruct a new value of this type.
src &stringScanner — a value of this type
($&Scanner) peekpub fn (s $&Scanner) peek() intExecute peek on $&Scanner.
s $&ScannerScanner instance used by this call (exclusive borrow).int — a value of this type
($&Scanner) nextpub fn (s $&Scanner) next() intOperation on $&Scanner: take the next item, or end according to this type.
s $&ScannerScanner instance used by this call (exclusive borrow).int — a value of this type
($&Scanner) scanpub fn (s $&Scanner) scan() intExecute scan on $&Scanner.
s $&ScannerScanner instance used by this call (exclusive borrow).int — a value of this type
(Scanner) token_textpub fn (s Scanner) token_text() stringOperation on Scanner: token text.
s ScannerScanner instance used by this call (value receiver).string — result string
(Scanner) linepub fn (s Scanner) line() intExecute line on Scanner.
s ScannerScanner instance used by this call (value receiver).int — a value of this type
(Scanner) columnpub fn (s Scanner) column() intExecute column on Scanner.
s ScannerScanner instance used by this call (value receiver).int — a value of this type
(Scanner) tokenpub fn (s Scanner) token() intExecute token on Scanner.
s ScannerScanner instance used by this call (value receiver).int — a value of this type