Documentation ¶
Index ¶
- Constants
- type Assignment
- type BinaryOp
- type BinaryOperator
- type BlockElement
- type CodeBlock
- type Conditional
- type Expression
- type FunctionCall
- type GotoNode
- type InfiniteLoop
- type Inline
- type InlineCode
- type Link
- type Literal
- type Loop
- type Node
- type Option
- type Paragraph
- type Script
- type Statement
- type StatementBlock
- type Symbol
- type Text
- type Type
- type UnaryOp
- type UnaryOperator
Constants ¶
View Source
const ( StringType = "string" BooleanType = "bool" NumberType = "number" SymbolType = "symbol" NullType = "null" )
type tags
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assignment ¶
type Assignment struct { Name Symbol Val Expression }
statements
func (Assignment) CompareStatement ¶
func (n Assignment) CompareStatement(b Statement) bool
type BinaryOp ¶
type BinaryOp struct { Operator BinaryOperator LeftArg Expression RightArg Expression }
expressions
func (BinaryOp) CompareExpression ¶
func (a BinaryOp) CompareExpression(b Expression) bool
type BinaryOperator ¶
type BinaryOperator string
expressions
const ( AddOp BinaryOperator = "add" SubOp BinaryOperator = "sub" MulOp BinaryOperator = "mul" DivOp BinaryOperator = "div" ModOp BinaryOperator = "mod" GtOp BinaryOperator = "gt" GteOp BinaryOperator = "gte" LtOp BinaryOperator = "lt" LteOp BinaryOperator = "lte" EqOp BinaryOperator = "eq" NeqOp BinaryOperator = "neq" AndOp BinaryOperator = "and" OrOp BinaryOperator = "or" ConcatOp BinaryOperator = "concat" )
binary operators
type BlockElement ¶
type BlockElement interface {
CompareBlock(b BlockElement) bool
}
block elements
type CodeBlock ¶
type CodeBlock struct {
Code []Statement
}
block elements
func (CodeBlock) CompareBlock ¶
func (n CodeBlock) CompareBlock(b BlockElement) bool
type Conditional ¶
type Conditional struct { Cond Expression Consequent Statement Alternate Statement }
statements
func (Conditional) CompareStatement ¶
func (n Conditional) CompareStatement(b Statement) bool
type FunctionCall ¶
type FunctionCall struct { Name Symbol Params []Expression }
statements
func (FunctionCall) CompareStatement ¶
func (n FunctionCall) CompareStatement(b Statement) bool
type InfiniteLoop ¶
type InfiniteLoop struct {
Consequent Statement
}
statements
func (InfiniteLoop) CompareStatement ¶
func (n InfiniteLoop) CompareStatement(b Statement) bool
type InlineCode ¶
type InlineCode struct {
Expr Expression
}
inlines
func (InlineCode) CompareInline ¶
func (n InlineCode) CompareInline(b Inline) bool
type Link ¶
block elements
func (Link) CompareBlock ¶
func (n Link) CompareBlock(b BlockElement) bool
type Literal ¶
type Literal struct { Type Type Val interface{} }
expressions
func (Literal) CompareExpression ¶
func (a Literal) CompareExpression(b Expression) bool
type Loop ¶
type Loop struct { Cond Expression Consequent Statement }
statements
func (Loop) CompareStatement ¶
type Node ¶
type Node struct { Name Symbol Body []BlockElement }
top level elements
func (Node) CompareNode ¶
type Option ¶
type Option []Link
block elements
func (Option) CompareBlock ¶
func (n Option) CompareBlock(b BlockElement) bool
type Paragraph ¶
type Paragraph []Inline
block elements
func (Paragraph) CompareBlock ¶
func (n Paragraph) CompareBlock(b BlockElement) bool
type StatementBlock ¶
type StatementBlock []Statement
statements
func (StatementBlock) CompareStatement ¶
func (n StatementBlock) CompareStatement(b Statement) bool
type UnaryOp ¶
type UnaryOp struct { Operator UnaryOperator Arg Expression }
expressions
func (UnaryOp) CompareExpression ¶
func (a UnaryOp) CompareExpression(b Expression) bool
type UnaryOperator ¶
type UnaryOperator string
expressions
const ( IncOp UnaryOperator = "inc" DecOp UnaryOperator = "dec" NotOp UnaryOperator = "not" NegOp UnaryOperator = "neg" )
unary operators
Click to show internal directories.
Click to hide internal directories.