Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Annotation struct { Identifier string `parser:"'#' '[' @Ident"` Attrs []*NameValue `parser:"('(' (@@ (',' @@)*)? ')')?"` Empty struct{} `parser:"']'"` }
Annotation an specified identifier and it's attribute list. `#[ident]` `#[ident(k1=v1,k2=v2)]`
func Match ¶
func Match(s string) (*Annotation, error)
Match 匹配注解 `#[ident]` `#[ident(k1=v1,k2=v2)]`
func (*Annotation) IsHeadless ¶
func (a *Annotation) IsHeadless() bool
`#[ident]` only, not contain any attributes.
type Annotations ¶
type Annotations []*Annotation
func (Annotations) ContainHeadless ¶
func (a Annotations) ContainHeadless(identifier string) bool
ContainHeadless contain headless
func (Annotations) Find ¶
func (a Annotations) Find(identifier string) Annotations
func (Annotations) FindValue ¶
func (a Annotations) FindValue(identifier, name string) []Value
type BoolList ¶
type BoolList struct {
Value []Boolean `parser:"'[' (@('true' | 'false') (',' @('true' | 'false'))*)? ']'"`
}
type FloatList ¶
type FloatList struct {
Value []float64 `parser:"'[' (@Float (',' (@Float | @Int))*)? ']'"`
}
NOTE: FloatList float list. must be first is float.
type IntegerList ¶
type IntegerList struct {
Value []int64 `parser:"'[' (@Int (',' @Int)*)? ']'"`
}
type NameValue ¶
type NameValue struct { // name Name string `parser:"@Ident '='"` // one of follow // String, Integer, Float, Bool, // StringList, IntegerList, FloatList, BoolList, Value Value `parser:"@@"` }
NameValue like `#[ident(name=value]`
type StringList ¶
type StringList struct {
Value []string `parser:"'[' (@String (',' @String)*)? ']'"`
}
Click to show internal directories.
Click to hide internal directories.