parser

package
v0.0.0-...-3d8df2e Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

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

Parser generates a stream of Tags from a stream of Tokens

func NewParser

func NewParser(data string) *Parser

NewParser creates a new Parser for the specified string

func (*Parser) IsDone

func (p *Parser) IsDone() bool

IsDone returns true if there are no more Tokens to read

func (*Parser) Next

func (p *Parser) Next() (t *Tag, err error)

Next reads the next available Tag

func (*Parser) Parse

func (p *Parser) Parse()

Parse the Tokens from the Lexer until EOF or an error

func (*Parser) ParseAll

func (p *Parser) ParseAll() (tags []Tag, err error)

ParseAll Tags until EOF or an error

type Tag

type Tag struct {
	Indent   int
	Name     string
	ID       string
	Attrs    map[string]string
	Content  string
	Children []Tag
	Error    error
}

Tag is the Parser's representation of an HTML tag

Jump to

Keyboard shortcuts

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