Lines Matching refs:scanner

33 	Pos scanner.Position
46 func (f *File) Pos() scanner.Position {
47 return scanner.Position{
55 func (f *File) End() scanner.Position {
74 p.accept(scanner.EOF)
79 Name: p.scanner.Filename,
89 p.scanner.Filename = filename
96 p.scanner.Filename = filename
102 scanner scanner.Scanner member
113 p.scanner.Init(r)
114 p.scanner.Error = func(sc *scanner.Scanner, msg string) {
117 p.scanner.Mode = scanner.ScanIdents | scanner.ScanInts | scanner.ScanStrings |
118 scanner.ScanRawStrings | scanner.ScanComments
124 pos := p.scanner.Position
126 pos = p.scanner.Pos()
145 p.errorf("expected %s, found %s", scanner.TokenString(tok),
146 scanner.TokenString(p.tok))
155 if p.tok != scanner.EOF {
156 p.tok = p.scanner.Scan()
157 if p.tok == scanner.Comment {
159 for p.tok == scanner.Comment {
160 lines := strings.Split(p.scanner.TokenText(), "\n")
161 if len(comments) > 0 && p.scanner.Position.Line > comments[len(comments)-1].End().Line+1 {
165 comments = append(comments, &Comment{lines, p.scanner.Position})
166 p.tok = p.scanner.Scan()
177 case scanner.Ident:
178 ident := p.scanner.TokenText()
179 pos := p.scanner.Position
181 p.accept(scanner.Ident)
193 scanner.TokenString(p.tok))
195 case scanner.EOF:
199 scanner.TokenString(p.tok))
205 func (p *parser) parseAssignment(name string, namePos scanner.Position,
210 pos := p.scanner.Position
250 func (p *parser) parseModule(typ string, typPos scanner.Position) *Module {
253 lbracePos := p.scanner.Position
262 rbracePos := p.scanner.Position
281 for p.tok == scanner.Ident {
299 name := p.scanner.TokenText()
300 namePos := p.scanner.Position
301 p.accept(scanner.Ident)
302 pos := p.scanner.Position
336 p.errorf("subtraction not supported: %s", p.scanner.String())
344 pos scanner.Position) (*Operator, error) {
390 func (p *parser) addMaps(map1, map2 []*Property, pos scanner.Position) ([]*Property, error) {
433 pos := p.scanner.Position
450 case scanner.Ident:
452 case '-', scanner.Int: // Integer might have '-' sign ahead ('+' is only treated as operator now)
454 case scanner.String:
462 scanner.TokenString(p.tok))
470 switch text := p.scanner.TokenText(); text {
473 LiteralPos: p.scanner.Position,
492 NamePos: p.scanner.Position,
497 p.accept(scanner.Ident)
502 str, err := strconv.Unquote(p.scanner.TokenText())
509 LiteralPos: p.scanner.Position,
512 p.accept(scanner.String)
518 literalPos := p.scanner.Position
522 if p.tok != scanner.Int {
523 p.errorf("expected int; found %s", scanner.TokenString(p.tok))
527 str += p.scanner.TokenText()
539 p.accept(scanner.Int)
544 lBracePos := p.scanner.Position
562 rBracePos := p.scanner.Position
573 lBracePos := p.scanner.Position
580 rBracePos := p.scanner.Position