parser

package
v0.0.0-...-cdade1c Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2017 License: MIT Imports: 10 Imported by: 6

Documentation

Index

Constants

View Source
const (
	NamedBlockDefault = iota
	NamedBlockAppend
	NamedBlockPrepend
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Assignment

type Assignment struct {
	SourcePosition
	X          string
	Expression string
}

type Attribute

type Attribute struct {
	SourcePosition
	Name      string
	Value     string
	IsRaw     bool
	Condition string
}

type Block

type Block struct {
	SourcePosition
	Children []Node
}

func (*Block) CanInline

func (b *Block) CanInline() bool

type Comment

type Comment struct {
	SourcePosition
	Value  string
	Block  *Block
	Silent bool
}

type Condition

type Condition struct {
	SourcePosition
	Positive   *Block
	Negative   *Block
	Expression string
}

type Doctype

type Doctype struct {
	SourcePosition
	Value string
}

func (*Doctype) String

func (d *Doctype) String() string

type Each

type Each struct {
	SourcePosition
	X          string
	Y          string
	Expression string
	Block      *Block
}

type Mixin

type Mixin struct {
	SourcePosition
	Block *Block
	Name  string
	Args  []string
}

type MixinCall

type MixinCall struct {
	SourcePosition
	Name string
	Args []string
}

type NamedBlock

type NamedBlock struct {
	Block
	Name     string
	Modifier int
}

type Node

type Node interface {
	Pos() SourcePosition
}

type Parser

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

func ByteParser

func ByteParser(input []byte) (*Parser, error)

func FileParser

func FileParser(filename string) (*Parser, error)

func StringParser

func StringParser(input string) (*Parser, error)

func VirtualFileParser

func VirtualFileParser(filename string, fs http.FileSystem) (*Parser, error)

func (*Parser) Parse

func (p *Parser) Parse() *Block

func (*Parser) SetFilename

func (p *Parser) SetFilename(filename string)

func (*Parser) SetVirtualFilesystem

func (p *Parser) SetVirtualFilesystem(fs http.FileSystem)

type SourcePosition

type SourcePosition struct {
	LineNum     int
	ColNum      int
	TokenLength int
	Filename    string
}

func (*SourcePosition) Pos

func (s *SourcePosition) Pos() SourcePosition

type Tag

type Tag struct {
	SourcePosition
	Block          *Block
	Name           string
	IsInterpolated bool
	Attributes     []Attribute
}

func (*Tag) IsRawText

func (t *Tag) IsRawText() bool

func (*Tag) IsSelfClosing

func (t *Tag) IsSelfClosing() bool

type Text

type Text struct {
	SourcePosition
	Value string
	Raw   bool
}

Jump to

Keyboard shortcuts

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