parser

package
v0.0.0-...-b04ab11 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamedBlockDefault = iota
	NamedBlockAppend
	NamedBlockPrepend
)
View Source
const DebugParser = false

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetLoader

type AssetLoader func(name string) ([]byte, error)

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 Buffered

type Buffered struct {
	SourcePosition
	Expression string
	Escaped    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 AssetParser

func AssetParser(filename string, assetLoader AssetLoader) (*Parser, error)

func FileParser

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

func StringParser

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

func (*Parser) FileName

func (p *Parser) FileName(fileName string)

func (*Parser) Parse

func (p *Parser) Parse() *Block

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