Godep vendoring for external packages
This commit is contained in:
2
vendor/github.com/mattn/anko/ast/doc.go
generated
vendored
Normal file
2
vendor/github.com/mattn/anko/ast/doc.go
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
// Package ast implements abstruct-syntax-tree for anko.
|
||||
package ast
|
||||
201
vendor/github.com/mattn/anko/ast/expr.go
generated
vendored
Normal file
201
vendor/github.com/mattn/anko/ast/expr.go
generated
vendored
Normal file
@@ -0,0 +1,201 @@
|
||||
package ast
|
||||
|
||||
// Expr provides all of interfaces for expression.
|
||||
type Expr interface {
|
||||
Pos
|
||||
expr()
|
||||
}
|
||||
|
||||
// ExprImpl provide commonly implementations for Expr.
|
||||
type ExprImpl struct {
|
||||
PosImpl // ExprImpl provide Pos() function.
|
||||
}
|
||||
|
||||
// expr provide restraint interface.
|
||||
func (x *ExprImpl) expr() {}
|
||||
|
||||
// NumberExpr provide Number expression.
|
||||
type NumberExpr struct {
|
||||
ExprImpl
|
||||
Lit string
|
||||
}
|
||||
|
||||
// StringExpr provide String expression.
|
||||
type StringExpr struct {
|
||||
ExprImpl
|
||||
Lit string
|
||||
}
|
||||
|
||||
// ArrayExpr provide Array expression.
|
||||
type ArrayExpr struct {
|
||||
ExprImpl
|
||||
Exprs []Expr
|
||||
}
|
||||
|
||||
// PairExpr provide one of Map key/value pair.
|
||||
type PairExpr struct {
|
||||
ExprImpl
|
||||
Key string
|
||||
Value Expr
|
||||
}
|
||||
|
||||
// MapExpr provide Map expression.
|
||||
type MapExpr struct {
|
||||
ExprImpl
|
||||
MapExpr map[string]Expr
|
||||
}
|
||||
|
||||
// IdentExpr provide identity expression.
|
||||
type IdentExpr struct {
|
||||
ExprImpl
|
||||
Lit string
|
||||
}
|
||||
|
||||
// UnaryExpr provide unary minus expression. ex: -1, ^1, ~1.
|
||||
type UnaryExpr struct {
|
||||
ExprImpl
|
||||
Operator string
|
||||
Expr Expr
|
||||
}
|
||||
|
||||
// AddrExpr provide referencing address expression.
|
||||
type AddrExpr struct {
|
||||
ExprImpl
|
||||
Expr Expr
|
||||
}
|
||||
|
||||
// DerefExpr provide dereferencing address expression.
|
||||
type DerefExpr struct {
|
||||
ExprImpl
|
||||
Expr Expr
|
||||
}
|
||||
|
||||
// ParenExpr provide parent block expression.
|
||||
type ParenExpr struct {
|
||||
ExprImpl
|
||||
SubExpr Expr
|
||||
}
|
||||
|
||||
// BinOpExpr provide binary operator expression.
|
||||
type BinOpExpr struct {
|
||||
ExprImpl
|
||||
Lhs Expr
|
||||
Operator string
|
||||
Rhs Expr
|
||||
}
|
||||
|
||||
type TernaryOpExpr struct {
|
||||
ExprImpl
|
||||
Expr Expr
|
||||
Lhs Expr
|
||||
Rhs Expr
|
||||
}
|
||||
|
||||
// CallExpr provide calling expression.
|
||||
type CallExpr struct {
|
||||
ExprImpl
|
||||
Func interface{}
|
||||
Name string
|
||||
SubExprs []Expr
|
||||
VarArg bool
|
||||
Go bool
|
||||
}
|
||||
|
||||
// AnonCallExpr provide anonymous calling expression. ex: func(){}().
|
||||
type AnonCallExpr struct {
|
||||
ExprImpl
|
||||
Expr Expr
|
||||
SubExprs []Expr
|
||||
VarArg bool
|
||||
Go bool
|
||||
}
|
||||
|
||||
// MemberExpr provide expression to refer menber.
|
||||
type MemberExpr struct {
|
||||
ExprImpl
|
||||
Expr Expr
|
||||
Name string
|
||||
}
|
||||
|
||||
// ItemExpr provide expression to refer Map/Array item.
|
||||
type ItemExpr struct {
|
||||
ExprImpl
|
||||
Value Expr
|
||||
Index Expr
|
||||
}
|
||||
|
||||
// SliceExpr provide expression to refer slice of Array.
|
||||
type SliceExpr struct {
|
||||
ExprImpl
|
||||
Value Expr
|
||||
Begin Expr
|
||||
End Expr
|
||||
}
|
||||
|
||||
// FuncExpr provide function expression.
|
||||
type FuncExpr struct {
|
||||
ExprImpl
|
||||
Name string
|
||||
Stmts []Stmt
|
||||
Args []string
|
||||
VarArg bool
|
||||
}
|
||||
|
||||
// LetExpr provide expression to let variable.
|
||||
type LetExpr struct {
|
||||
ExprImpl
|
||||
Lhs Expr
|
||||
Rhs Expr
|
||||
}
|
||||
|
||||
// LetsExpr provide multiple expression of let.
|
||||
type LetsExpr struct {
|
||||
ExprImpl
|
||||
Lhss []Expr
|
||||
Operator string
|
||||
Rhss []Expr
|
||||
}
|
||||
|
||||
// AssocExpr provide expression to assoc operation.
|
||||
type AssocExpr struct {
|
||||
ExprImpl
|
||||
Lhs Expr
|
||||
Operator string
|
||||
Rhs Expr
|
||||
}
|
||||
|
||||
// NewExpr provide expression to make new instance.
|
||||
type NewExpr struct {
|
||||
ExprImpl
|
||||
Name string
|
||||
SubExprs []Expr
|
||||
}
|
||||
|
||||
// ConstExpr provide expression for constant variable.
|
||||
type ConstExpr struct {
|
||||
ExprImpl
|
||||
Value string
|
||||
}
|
||||
|
||||
type ChanExpr struct {
|
||||
ExprImpl
|
||||
Lhs Expr
|
||||
Rhs Expr
|
||||
}
|
||||
|
||||
type Type struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
type MakeChanExpr struct {
|
||||
ExprImpl
|
||||
Type string
|
||||
SizeExpr Expr
|
||||
}
|
||||
|
||||
type MakeArrayExpr struct {
|
||||
ExprImpl
|
||||
Type string
|
||||
LenExpr Expr
|
||||
CapExpr Expr
|
||||
}
|
||||
28
vendor/github.com/mattn/anko/ast/pos.go
generated
vendored
Normal file
28
vendor/github.com/mattn/anko/ast/pos.go
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
package ast
|
||||
|
||||
// Position provides interface to store code locations.
|
||||
type Position struct {
|
||||
Line int
|
||||
Column int
|
||||
}
|
||||
|
||||
// Pos interface provies two functions to get/set the position for expression or statement.
|
||||
type Pos interface {
|
||||
Position() Position
|
||||
SetPosition(Position)
|
||||
}
|
||||
|
||||
// PosImpl provies commonly implementations for Pos.
|
||||
type PosImpl struct {
|
||||
pos Position
|
||||
}
|
||||
|
||||
// Position return the position of the expression or statement.
|
||||
func (x *PosImpl) Position() Position {
|
||||
return x.pos
|
||||
}
|
||||
|
||||
// SetPosition is a function to specify position of the expression or statement.
|
||||
func (x *PosImpl) SetPosition(pos Position) {
|
||||
x.pos = pos
|
||||
}
|
||||
127
vendor/github.com/mattn/anko/ast/stmt.go
generated
vendored
Normal file
127
vendor/github.com/mattn/anko/ast/stmt.go
generated
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
package ast
|
||||
|
||||
// Stmt provides all of interfaces for statement.
|
||||
type Stmt interface {
|
||||
Pos
|
||||
stmt()
|
||||
}
|
||||
|
||||
// StmtImpl provide commonly implementations for Stmt..
|
||||
type StmtImpl struct {
|
||||
PosImpl // StmtImpl provide Pos() function.
|
||||
}
|
||||
|
||||
// stmt provide restraint interface.
|
||||
func (x *StmtImpl) stmt() {}
|
||||
|
||||
// ExprStmt provide expression statement.
|
||||
type ExprStmt struct {
|
||||
StmtImpl
|
||||
Expr Expr
|
||||
}
|
||||
|
||||
// IfStmt provide "if/else" statement.
|
||||
type IfStmt struct {
|
||||
StmtImpl
|
||||
If Expr
|
||||
Then []Stmt
|
||||
ElseIf []Stmt // This is array of IfStmt
|
||||
Else []Stmt
|
||||
}
|
||||
|
||||
// TryStmt provide "try/catch/finally" statement.
|
||||
type TryStmt struct {
|
||||
StmtImpl
|
||||
Try []Stmt
|
||||
Var string
|
||||
Catch []Stmt
|
||||
Finally []Stmt
|
||||
}
|
||||
|
||||
// ForStmt provide "for in" expression statement.
|
||||
type ForStmt struct {
|
||||
StmtImpl
|
||||
Var string
|
||||
Value Expr
|
||||
Stmts []Stmt
|
||||
}
|
||||
|
||||
// CForStmt provide C-style "for (;;)" expression statement.
|
||||
type CForStmt struct {
|
||||
StmtImpl
|
||||
Expr1 Expr
|
||||
Expr2 Expr
|
||||
Expr3 Expr
|
||||
Stmts []Stmt
|
||||
}
|
||||
|
||||
// LoopStmt provide "for expr" expression statement.
|
||||
type LoopStmt struct {
|
||||
StmtImpl
|
||||
Expr Expr
|
||||
Stmts []Stmt
|
||||
}
|
||||
|
||||
// BreakStmt provide "break" expression statement.
|
||||
type BreakStmt struct {
|
||||
StmtImpl
|
||||
}
|
||||
|
||||
// ContinueStmt provide "continue" expression statement.
|
||||
type ContinueStmt struct {
|
||||
StmtImpl
|
||||
}
|
||||
|
||||
// ForStmt provide "return" expression statement.
|
||||
type ReturnStmt struct {
|
||||
StmtImpl
|
||||
Exprs []Expr
|
||||
}
|
||||
|
||||
// ThrowStmt provide "throw" expression statement.
|
||||
type ThrowStmt struct {
|
||||
StmtImpl
|
||||
Expr Expr
|
||||
}
|
||||
|
||||
// ModuleStmt provide "module" expression statement.
|
||||
type ModuleStmt struct {
|
||||
StmtImpl
|
||||
Name string
|
||||
Stmts []Stmt
|
||||
}
|
||||
|
||||
// VarStmt provide statement to let variables in current scope.
|
||||
type VarStmt struct {
|
||||
StmtImpl
|
||||
Names []string
|
||||
Exprs []Expr
|
||||
}
|
||||
|
||||
// SwitchStmt provide switch statement.
|
||||
type SwitchStmt struct {
|
||||
StmtImpl
|
||||
Expr Expr
|
||||
Cases []Stmt
|
||||
}
|
||||
|
||||
// CaseStmt provide switch/case statement.
|
||||
type CaseStmt struct {
|
||||
StmtImpl
|
||||
Expr Expr
|
||||
Stmts []Stmt
|
||||
}
|
||||
|
||||
// DefaultStmt provide switch/default statement.
|
||||
type DefaultStmt struct {
|
||||
StmtImpl
|
||||
Stmts []Stmt
|
||||
}
|
||||
|
||||
// LetsStmt provide multiple statement of let.
|
||||
type LetsStmt struct {
|
||||
StmtImpl
|
||||
Lhss []Expr
|
||||
Operator string
|
||||
Rhss []Expr
|
||||
}
|
||||
7
vendor/github.com/mattn/anko/ast/token.go
generated
vendored
Normal file
7
vendor/github.com/mattn/anko/ast/token.go
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
package ast
|
||||
|
||||
type Token struct {
|
||||
PosImpl // StmtImpl provide Pos() function.
|
||||
Tok int
|
||||
Lit string
|
||||
}
|
||||
Reference in New Issue
Block a user