github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/asm/internal/lex/slice.go (about)

     1  // Copyright 2015 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package lex
     6  
     7  import (
     8  	"github.com/shogo82148/std/cmd/internal/src"
     9  )
    10  
    11  // A Slice reads from a slice of Tokens.
    12  type Slice struct {
    13  	tokens []Token
    14  	base   *src.PosBase
    15  	line   int
    16  	pos    int
    17  }
    18  
    19  func NewSlice(base *src.PosBase, line int, tokens []Token) *Slice
    20  
    21  func (s *Slice) Next() ScanToken
    22  
    23  func (s *Slice) Text() string
    24  
    25  func (s *Slice) File() string
    26  
    27  func (s *Slice) Base() *src.PosBase
    28  
    29  func (s *Slice) SetBase(base *src.PosBase)
    30  
    31  func (s *Slice) Line() int
    32  
    33  func (s *Slice) Col() int
    34  
    35  func (s *Slice) Close()