parser

package
v0.0.0-...-878775e Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(lines []SourceLine) ([]byte, error)

decorate error in line number

Types

type SourceLine

type SourceLine struct {
	Str string
}

func Lines

func Lines(in io.Reader) ([]SourceLine, error)

func SliceHigherIndents

func SliceHigherIndents(lines []SourceLine, indent int) []SourceLine

return slice of the elements at the head of lines that have an indent level higher than indent

func (SourceLine) IndentLevel

func (s SourceLine) IndentLevel() int

func (SourceLine) IsComment

func (s SourceLine) IsComment() bool

func (*SourceLine) NextToken

func (s *SourceLine) NextToken() (string, error)

note: this modifies the line and invalidates IndentLevel() and IsComment()

func (SourceLine) NextTokenType

func (s SourceLine) NextTokenType() string

Jump to

Keyboard shortcuts

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