ast

package
v0.0.0-...-f5aabfc Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg struct {
	*Dimension
	*Number
	*Str
	*Ident
	TypeID byte
}

Arg ::= DIMENSION | NUMBER | STRING | IDENT

func (*Arg) String

func (a *Arg) String() string

type AttrExpr

type AttrExpr struct {
	Left, Right *Ident
	Token       token.Token
	TypeID      byte
}

AttrExpr ::= S* [ namespace_prefix ]? IDENT S*

[ [ PREFIXMATCH |
    SUFFIXMATCH |
    SUBSTRINGMATCH |
    '=' |
    INCLUDES |
    DASHMATCH ] S* [ IDENT | STRING ] S*
]?

func (*AttrExpr) String

func (ae *AttrExpr) String() string

type Attrib

type Attrib struct {
	*AttrExpr
}

Attrib ::= '[' AttrExpr ']'

func (*Attrib) String

func (a *Attrib) String() string

type Class

type Class struct {
	Name string
}

Class ::= '.' Name

func (*Class) String

func (c *Class) String() string

type Dimension

type Dimension struct {
	A, B     int
	Aop, Bop string
}

Dimension ::= an + b

func (*Dimension) String

func (d *Dimension) String() string

type Expression

type Expression interface {
	String() string
	// contains filtered or unexported methods
}

Expression is a type maker

type FunctionalPseudo

type FunctionalPseudo struct {
	Token token.Token
	*Arg
}

FunctionalPseudo ::= FUNCTION S* arg ')'

func (*FunctionalPseudo) String

func (fp *FunctionalPseudo) String() string

type Group

type Group struct {
	Selectors []Expression
}

Group ::= selector [ COMMA S* selector ]*

func (*Group) String

func (g *Group) String() string

type HArg

type HArg struct {
	*Ident
	*Universal
	*Hash
	*Class
	*Attrib
	*Pseudo
	*Group
	*RSelector
	TypeID byte
}

HArg ::= ... | Group | RSelector

func (*HArg) String

func (ha *HArg) String() string

type Has

type Has struct {
	*HArg
}

Has ::= https://drafts.csswg.org/selectors-4/#has-pseudo

func (*Has) String

func (h *Has) String() string

type Hash

type Hash struct {
	Name string
}

Hash ::= '#' Name

func (*Hash) String

func (h *Hash) String() string

type Ident

type Ident struct {
	Value string
}

Ident ::= string

func (*Ident) String

func (i *Ident) String() string

type NArg

type NArg struct {
	*Ident
	*Universal
	*Hash
	*Class
	*Attrib
	*Pseudo
	*Group
	*Sequence
	TypeID byte
}

NArg ::= type_selector | universal | HASH | class | attrib | pseudo | group | sequence

func (*NArg) String

func (na *NArg) String() string

type Negation

type Negation struct {
	*NArg
}

Negation ::= NOT S* negation_arg S* ')' negation_arg ::= ident | universal | HASH | class | attrib | pseudo

func (*Negation) String

func (n *Negation) String() string

type Number

type Number struct {
	Value int
}

Number ::= int

func (*Number) String

func (n *Number) String() string

type Pseudo

type Pseudo struct {
	*Ident
	*FunctionalPseudo
	Token  token.Token
	TypeID byte
}

Pseudo ::= ':' ':'? [ IDENT | functional_pseudo ]

func (*Pseudo) String

func (p *Pseudo) String() string

type RSelector

type RSelector struct {
	Expr  Expression
	Token token.Token
}

RSelector ::= <relative-selector> = <combinator>? <complex-selector>

func (*RSelector) String

func (rs *RSelector) String() string

type Selector

type Selector struct {
	Left  Expression
	Right Expression
	Token token.Token
}

Selector ::= simple_selector_sequence [ combinator simple_selector_sequence ]*

func (*Selector) String

func (s *Selector) String() string

type Sequence

type Sequence struct {
	Expression
	Exprs []Expression
}

Sequence ::= [ type_selector | universal ]

  		 simple_sequence*
		 | simple_sequence+

func (*Sequence) String

func (s *Sequence) String() string

type Str

type Str struct {
	Value string
}

Str ::= string

func (*Str) String

func (s *Str) String() string

type Universal

type Universal struct {
	Token token.Token
}

Universal ::= '*'

func (*Universal) String

func (u *Universal) String() string

Jump to

Keyboard shortcuts

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