Skip to content

v2.scanner #

fn new_scanner #

fn new_scanner(prefs &pref.Preferences, mode Mode) &Scanner

enum Mode #

@[flag]
enum Mode {
	normal
	scan_comments
	skip_interpolation
}

struct Scanner #

struct Scanner {
	pref               &pref.Preferences
	mode               Mode
	skip_interpolation bool
mut:
	file        &token.File = &token.File{}
	src         string
	insert_semi bool
pub mut:
	offset int // current char offset
	pos    int // token offset (start of current token)
	lit    string
	// strings literals & interpolation
	in_str_incomplete   bool
	in_str_inter        bool
	str_inter_cbr_depth int
	str_quote           u8
}

fn (Scanner) init #

fn (mut s Scanner) init(file &token.File, src string)

fn (Scanner) scan #

fn (mut s Scanner) scan() token.Token