scanner

package
v0.2.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

Scanner is a structure containing the information of where the scanner cursor is located and the input text for the scanner.

func (*Scanner) GetIndentLevel

func (s *Scanner) GetIndentLevel() int

GetIndentLevel returns the level of indentation for a line.

func (*Scanner) Init

func (s *Scanner) Init(input string)

Init instantiates a new scanner with the input text.

func (*Scanner) Next

func (s *Scanner) Next() (token Token, err error)

Next moves the cursor to the next token.

func (*Scanner) NextLine

func (s *Scanner) NextLine() (err error)

NextLine moves the cursor to the next line if possible.

func (*Scanner) Peak

func (s *Scanner) Peak() Token

Peak grabs the current token.

func (*Scanner) PeakLine

func (s *Scanner) PeakLine() string

PeakLine grabs the current active line in the scanner.

func (*Scanner) SetToken added in v0.1.4

func (s *Scanner) SetToken(input string)

SetToken sets the token equal to the input string.

type Token

type Token struct {
	Data string
}

Token is the structure containing a scanned token.

func (*Token) IsBoolean added in v0.1.4

func (t *Token) IsBoolean() bool

IsBoolean returns if the current token is a boolean.

func (*Token) IsBracket added in v0.1.8

func (t *Token) IsBracket() bool

IsBracket returns if the current token begins a bracketed set

func (*Token) IsBranch added in v0.1.4

func (t *Token) IsBranch() bool

IsBranch returns if the current token defines a branch keyword.

func (*Token) IsChecksum added in v0.1.4

func (t *Token) IsChecksum() bool

IsChecksum returns uf the current token begins with a valid checksum header.

func (*Token) IsClass

func (t *Token) IsClass() bool

IsClass returns if the current token is begins a class definition.

func (*Token) IsComment

func (t *Token) IsComment() bool

IsComment returns if the token is a comment.

func (*Token) IsCommit added in v0.2.2

func (t *Token) IsCommit() bool

IsCommit returns if the current token is an commit keyword.

func (*Token) IsDependency

func (t *Token) IsDependency() bool

IsDependency returns if the current token begins with a valid version header.

func (*Token) IsExpand added in v0.1.5

func (t *Token) IsExpand() bool

IsExpand returns if the current token is an expand keyword.

func (*Token) IsExtension added in v0.2.9

func (t *Token) IsExtension() bool

IsExtension returns if the current token is an extension keyword.

func (*Token) IsFunction

func (t *Token) IsFunction() bool

IsFunction returns if the current token begins a function.

func (*Token) IsGitURL added in v0.1.5

func (t *Token) IsGitURL() bool

IsGitURL returns if the current token begins with a valid GitURL header.

func (*Token) IsHomepage

func (t *Token) IsHomepage() bool

IsHomepage returns if the current token begins with a homepage variable declaration.

func (*Token) IsList added in v0.2.6

func (t *Token) IsList() bool

IsList returns if the current token is an list declaration.

func (*Token) IsMaintainers added in v0.2.6

func (t *Token) IsMaintainers() bool

IsMaintainers returns if the current token is an maintainers keyword.

func (*Token) IsString

func (t *Token) IsString() bool

IsString returns if the current token begins a string.

func (*Token) IsSubmodule added in v0.1.4

func (t *Token) IsSubmodule() bool

IsSubmodule returns if the current token is a submodule keyword.

func (*Token) IsTag added in v0.2.9

func (t *Token) IsTag() bool

IsTag returns if the current token is an tag keyword.

func (*Token) IsURL

func (t *Token) IsURL() bool

IsURL returns if the current token begins with a valid URL header.

func (*Token) IsVersion

func (t *Token) IsVersion() bool

IsVersion returns if the current token begins with a valid version header.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL