Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PolylangLexer = lexer.MustSimple([]lexer.SimpleRule{
{Name: "Ident", Pattern: `[a-zA-Z_.][a-zA-Z0-9_.]*`},
{Name: "String", Pattern: `'[^']*'`},
{Name: "Punct", Pattern: `\[|]|[,:;={}()?!@]`},
{Name: "whitespace", Pattern: `\s+`},
})
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type CompoundStatement ¶
type CompoundStatement struct {
If *If `parser:"@@"`
}
type Expression ¶
type If ¶
type If struct {
Pos lexer.Position
Condition *Expression `parser:"'if' '(' @@ ')'"`
Statements []*Statement `parser:"'{' @@* '}'"`
Else []*Statement `parser:"( 'else' '{' @@* '}' )?"`
}
type Index ¶
type Index struct {
Pos lexer.Position
Unique bool `parser:"'@' ( @'unique' | 'index' )"`
Fields []*IndexField `parser:"'(' @@ ( ',' @@ )* ')' ';'"`
}
type IndexField ¶
type Polylang ¶
type Polylang struct {
Pos lexer.Position
Collection *Collection
}
type SimpleStatement ¶
type SimpleStatement struct {
Small *SmallStatement `parser:"| @@ ';'"`
}
type SmallStatement ¶
type SmallStatement struct {
Throw *Expression `parser:"'throw' @@"`
Expression *Expression `parser:"| @@"`
}
type Statement ¶
type Statement struct {
CompoundStatement
SimpleStatement
}
Click to show internal directories.
Click to hide internal directories.