constructors return pointer

This commit is contained in:
z7zmey 2018-01-04 20:42:44 +02:00
parent 383a245370
commit dc8808a7d6
154 changed files with 154 additions and 154 deletions

View File

@ -8,7 +8,7 @@ type Argument struct {
}
func NewArgument(expression Node, variadic bool) Node {
return Argument{
return &Argument{
map[string]interface{}{
"variadic": variadic,
},

View File

@ -11,7 +11,7 @@ type Array struct {
}
func NewArray(items []node.Node) node.Node {
return Array{
return &Array{
map[string]interface{}{},
nil,
items,

View File

@ -12,7 +12,7 @@ type ArrayDimFetch struct {
}
func NewArrayDimFetch(variable node.Node, dim node.Node) node.Node {
return ArrayDimFetch{
return &ArrayDimFetch{
map[string]interface{}{},
nil,
variable,

View File

@ -12,7 +12,7 @@ type ArrayItem struct {
}
func NewArrayItem(key node.Node, val node.Node, byRef bool) node.Node {
return ArrayItem{
return &ArrayItem{
map[string]interface{}{
"byRef": byRef,
},

View File

@ -9,7 +9,7 @@ type Assign struct {
}
func NewAssign(variable node.Node, expression node.Node) node.Node {
return Assign{
return &Assign{
AssignOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type AssignRef struct {
}
func NewAssignRef(variable node.Node, expression node.Node) node.Node {
return AssignRef{
return &AssignRef{
AssignOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type BitwiseAnd struct {
}
func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
return BitwiseAnd{
return &BitwiseAnd{
AssignOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type BitwiseOr struct {
}
func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
return BitwiseOr{
return &BitwiseOr{
AssignOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type BitwiseXor struct {
}
func NewBitwiseXor(variable node.Node, expression node.Node) node.Node {
return BitwiseXor{
return &BitwiseXor{
AssignOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Concat struct {
}
func NewConcat(variable node.Node, expression node.Node) node.Node {
return Concat{
return &Concat{
AssignOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Div struct {
}
func NewDiv(variable node.Node, expression node.Node) node.Node {
return Div{
return &Div{
AssignOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Minus struct {
}
func NewMinus(variable node.Node, expression node.Node) node.Node {
return Minus{
return &Minus{
AssignOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Mod struct {
}
func NewMod(variable node.Node, expression node.Node) node.Node {
return Mod{
return &Mod{
AssignOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Mul struct {
}
func NewMul(variable node.Node, expression node.Node) node.Node {
return Mul{
return &Mul{
AssignOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Plus struct {
}
func NewPlus(variable node.Node, expression node.Node) node.Node {
return Plus{
return &Plus{
AssignOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Pow struct {
}
func NewPow(variable node.Node, expression node.Node) node.Node {
return Pow{
return &Pow{
AssignOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type ShiftLeft struct {
}
func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
return ShiftLeft{
return &ShiftLeft{
AssignOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type ShiftRight struct {
}
func NewShiftRight(variable node.Node, expression node.Node) node.Node {
return ShiftRight{
return &ShiftRight{
AssignOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type BitwiseAnd struct {
}
func NewBitwiseAnd(variable node.Node, expression node.Node) node.Node {
return BitwiseAnd{
return &BitwiseAnd{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type BitwiseOr struct {
}
func NewBitwiseOr(variable node.Node, expression node.Node) node.Node {
return BitwiseOr{
return &BitwiseOr{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type BitwiseXor struct {
}
func NewBitwiseXor(variable node.Node, expression node.Node) node.Node {
return BitwiseXor{
return &BitwiseXor{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type BooleanAnd struct {
}
func NewBooleanAnd(variable node.Node, expression node.Node) node.Node {
return BooleanAnd{
return &BooleanAnd{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type BooleanOr struct {
}
func NewBooleanOr(variable node.Node, expression node.Node) node.Node {
return BooleanOr{
return &BooleanOr{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Coalesce struct {
}
func NewCoalesce(variable node.Node, expression node.Node) node.Node {
return Coalesce{
return &Coalesce{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Concat struct {
}
func NewConcat(variable node.Node, expression node.Node) node.Node {
return Concat{
return &Concat{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Div struct {
}
func NewDiv(variable node.Node, expression node.Node) node.Node {
return Div{
return &Div{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Equal struct {
}
func NewEqual(variable node.Node, expression node.Node) node.Node {
return Equal{
return &Equal{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Greater struct {
}
func NewGreater(variable node.Node, expression node.Node) node.Node {
return Greater{
return &Greater{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type GreaterOrEqual struct {
}
func NewGreaterOrEqual(variable node.Node, expression node.Node) node.Node {
return GreaterOrEqual{
return &GreaterOrEqual{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Identical struct {
}
func NewIdentical(variable node.Node, expression node.Node) node.Node {
return Identical{
return &Identical{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type LogicalAnd struct {
}
func NewLogicalAnd(variable node.Node, expression node.Node) node.Node {
return LogicalAnd{
return &LogicalAnd{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type LogicalOr struct {
}
func NewLogicalOr(variable node.Node, expression node.Node) node.Node {
return LogicalOr{
return &LogicalOr{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type LogicalXor struct {
}
func NewLogicalXor(variable node.Node, expression node.Node) node.Node {
return LogicalXor{
return &LogicalXor{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Minus struct {
}
func NewMinus(variable node.Node, expression node.Node) node.Node {
return Minus{
return &Minus{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Mod struct {
}
func NewMod(variable node.Node, expression node.Node) node.Node {
return Mod{
return &Mod{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Mul struct {
}
func NewMul(variable node.Node, expression node.Node) node.Node {
return Mul{
return &Mul{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type NotEqual struct {
}
func NewNotEqual(variable node.Node, expression node.Node) node.Node {
return NotEqual{
return &NotEqual{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type NotIdentical struct {
}
func NewNotIdentical(variable node.Node, expression node.Node) node.Node {
return NotIdentical{
return &NotIdentical{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Plus struct {
}
func NewPlus(variable node.Node, expression node.Node) node.Node {
return Plus{
return &Plus{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Pow struct {
}
func NewPow(variable node.Node, expression node.Node) node.Node {
return Pow{
return &Pow{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type ShiftLeft struct {
}
func NewShiftLeft(variable node.Node, expression node.Node) node.Node {
return ShiftLeft{
return &ShiftLeft{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type ShiftRight struct {
}
func NewShiftRight(variable node.Node, expression node.Node) node.Node {
return ShiftRight{
return &ShiftRight{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Smaller struct {
}
func NewSmaller(variable node.Node, expression node.Node) node.Node {
return Smaller{
return &Smaller{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type SmallerOrEqual struct {
}
func NewSmallerOrEqual(variable node.Node, expression node.Node) node.Node {
return SmallerOrEqual{
return &SmallerOrEqual{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type Spaceship struct {
}
func NewSpaceship(variable node.Node, expression node.Node) node.Node {
return Spaceship{
return &Spaceship{
BinaryOp{
map[string]interface{}{},
nil,

View File

@ -11,7 +11,7 @@ type BitwiseNot struct {
}
func NewBitwiseNot(expression node.Node) node.Node {
return BitwiseNot{
return &BitwiseNot{
map[string]interface{}{},
nil,
expression,

View File

@ -11,7 +11,7 @@ type BooleanNot struct {
}
func NewBooleanNot(expression node.Node) node.Node {
return BooleanNot{
return &BooleanNot{
map[string]interface{}{},
nil,
expression,

View File

@ -9,7 +9,7 @@ type CastArray struct {
}
func NewCastArray(expr node.Node) node.Node {
return CastArray{
return &CastArray{
Cast{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type CastBool struct {
}
func NewCastBool(expr node.Node) node.Node {
return CastBool{
return &CastBool{
Cast{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type CastDouble struct {
}
func NewCastDouble(expr node.Node) node.Node {
return CastDouble{
return &CastDouble{
Cast{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type CastInt struct {
}
func NewCastInt(expr node.Node) node.Node {
return CastInt{
return &CastInt{
Cast{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type CastObject struct {
}
func NewCastObject(expr node.Node) node.Node {
return CastObject{
return &CastObject{
Cast{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type CastString struct {
}
func NewCastString(expr node.Node) node.Node {
return CastString{
return &CastString{
Cast{
map[string]interface{}{},
nil,

View File

@ -9,7 +9,7 @@ type CastUnset struct {
}
func NewCastUnset(expr node.Node) node.Node {
return CastUnset{
return &CastUnset{
Cast{
map[string]interface{}{},
nil,

View File

@ -12,7 +12,7 @@ type ClassConstFetch struct {
}
func NewClassConstFetch(class node.Node, constantName node.Node) node.Node {
return ClassConstFetch{
return &ClassConstFetch{
map[string]interface{}{},
nil,
class,

View File

@ -11,7 +11,7 @@ type Clone struct {
}
func NewClone(expression node.Node) node.Node {
return Clone{
return &Clone{
map[string]interface{}{},
nil,
expression,

View File

@ -14,7 +14,7 @@ type Closure struct {
}
func NewClosure(params []node.Node, uses []node.Node, returnType node.Node, stmts []node.Node, isStatic bool, isReturnRef bool, phpDocComment string) node.Node {
return Closure{
return &Closure{
map[string]interface{}{
"isReturnRef": isReturnRef,
"isStatic": isStatic,

View File

@ -11,7 +11,7 @@ type ClusureUse struct {
}
func NewClusureUse(variable node.Node, byRef bool) node.Node {
return ClusureUse{
return &ClusureUse{
map[string]interface{}{
"byRef": byRef,
},

View File

@ -11,7 +11,7 @@ type ConstFetch struct {
}
func NewConstFetch(constant node.Node) node.Node {
return ConstFetch{
return &ConstFetch{
map[string]interface{}{},
nil,
constant,

View File

@ -11,7 +11,7 @@ type Empty struct {
}
func NewEmpty(expression node.Node) node.Node {
return Empty{
return &Empty{
map[string]interface{}{},
nil,
expression,

View File

@ -11,7 +11,7 @@ type ErrorSuppress struct {
}
func NewErrorSuppress(expression node.Node) node.Node {
return ErrorSuppress{
return &ErrorSuppress{
map[string]interface{}{},
nil,
expression,

View File

@ -11,7 +11,7 @@ type Eval struct {
}
func NewEval(expression node.Node) node.Node {
return Eval{
return &Eval{
map[string]interface{}{},
nil,
expression,

View File

@ -11,7 +11,7 @@ type Exit struct {
}
func NewExit(expr node.Node, isDie bool) node.Node {
return Exit{
return &Exit{
map[string]interface{}{
"isDie": isDie,
},

View File

@ -12,7 +12,7 @@ type FunctionCall struct {
}
func NewFunctionCall(function node.Node, arguments []node.Node) node.Node {
return FunctionCall{
return &FunctionCall{
map[string]interface{}{},
nil,
function,

View File

@ -11,7 +11,7 @@ type Include struct {
}
func NewInclude(expression node.Node) node.Node {
return Include{
return &Include{
map[string]interface{}{},
nil,
expression,

View File

@ -11,7 +11,7 @@ type IncludeOnce struct {
}
func NewIncludeOnce(expression node.Node) node.Node {
return IncludeOnce{
return &IncludeOnce{
map[string]interface{}{},
nil,
expression,

View File

@ -12,7 +12,7 @@ type InstanceOf struct {
}
func NewInstanceOf(expr node.Node, class node.Node) node.Node {
return InstanceOf{
return &InstanceOf{
map[string]interface{}{},
nil,
expr,

View File

@ -11,7 +11,7 @@ type Isset struct {
}
func NewIsset(variables []node.Node) node.Node {
return Isset{
return &Isset{
map[string]interface{}{},
nil,
variables,

View File

@ -11,7 +11,7 @@ type List struct {
}
func NewList(items []node.Node) node.Node {
return List{
return &List{
map[string]interface{}{},
nil,
items,

View File

@ -13,7 +13,7 @@ type MethodCall struct {
}
func NewMethodCall(variable node.Node, method node.Node, arguments []node.Node) node.Node {
return MethodCall{
return &MethodCall{
map[string]interface{}{},
nil,
variable,

View File

@ -12,7 +12,7 @@ type New struct {
}
func NewNew(class node.Node, arguments []node.Node) node.Node {
return New{
return &New{
map[string]interface{}{},
nil,
class,

View File

@ -11,7 +11,7 @@ type PostDec struct {
}
func NewPostDec(variable node.Node) node.Node {
return PostDec{
return &PostDec{
map[string]interface{}{},
nil,
variable,

View File

@ -11,7 +11,7 @@ type PostInc struct {
}
func NewPostInc(variable node.Node) node.Node {
return PostInc{
return &PostInc{
map[string]interface{}{},
nil,
variable,

View File

@ -11,7 +11,7 @@ type PreDec struct {
}
func NewPreDec(variable node.Node) node.Node {
return PreDec{
return &PreDec{
map[string]interface{}{},
nil,
variable,

View File

@ -11,7 +11,7 @@ type PreInc struct {
}
func NewPreInc(variable node.Node) node.Node {
return PreInc{
return &PreInc{
map[string]interface{}{},
nil,
variable,

View File

@ -11,7 +11,7 @@ type Print struct {
}
func NewPrint(expression node.Node) node.Node {
return Print{
return &Print{
map[string]interface{}{},
nil,
expression,

View File

@ -12,7 +12,7 @@ type PropertyFetch struct {
}
func NewPropertyFetch(variable node.Node, property node.Node) node.Node {
return PropertyFetch{
return &PropertyFetch{
map[string]interface{}{},
nil,
variable,

View File

@ -11,7 +11,7 @@ type Require struct {
}
func NewRequire(expression node.Node) node.Node {
return Require{
return &Require{
map[string]interface{}{},
nil,
expression,

View File

@ -11,7 +11,7 @@ type RequireOnce struct {
}
func NewRequireOnce(expression node.Node) node.Node {
return RequireOnce{
return &RequireOnce{
map[string]interface{}{},
nil,
expression,

View File

@ -11,7 +11,7 @@ type ShellExec struct {
}
func NewShellExec(parts []node.Node) node.Node {
return ShellExec{
return &ShellExec{
map[string]interface{}{},
nil,
parts,

View File

@ -11,7 +11,7 @@ type ShortArray struct {
}
func NewShortArray(items []node.Node) node.Node {
return ShortArray{
return &ShortArray{
map[string]interface{}{},
nil,
items,

View File

@ -11,7 +11,7 @@ type ShortList struct {
}
func NewShortList(items []node.Node) node.Node {
return ShortList{
return &ShortList{
map[string]interface{}{},
nil,
items,

View File

@ -13,7 +13,7 @@ type StaticCall struct {
}
func NewStaticCall(class node.Node, call node.Node, arguments []node.Node) node.Node {
return StaticCall{
return &StaticCall{
map[string]interface{}{},
nil,
class,

View File

@ -12,7 +12,7 @@ type StaticPropertyFetch struct {
}
func NewStaticPropertyFetch(class node.Node, property node.Node) node.Node {
return StaticPropertyFetch{
return &StaticPropertyFetch{
map[string]interface{}{},
nil,
class,

View File

@ -13,7 +13,7 @@ type Ternary struct {
}
func NewTernary(condition node.Node, ifTrue node.Node, ifFalse node.Node) node.Node {
return Ternary{
return &Ternary{
map[string]interface{}{},
nil,
condition,

View File

@ -11,7 +11,7 @@ type UnaryMinus struct {
}
func NewUnaryMinus(expression node.Node) node.Node {
return UnaryMinus{
return &UnaryMinus{
map[string]interface{}{},
nil,
expression,

View File

@ -11,7 +11,7 @@ type UnaryPlus struct {
}
func NewUnaryPlus(expression node.Node) node.Node {
return UnaryPlus{
return &UnaryPlus{
map[string]interface{}{},
nil,
expression,

View File

@ -11,7 +11,7 @@ type Variable struct {
}
func NewVariable(varName node.Node) node.Node {
return Variable{
return &Variable{
map[string]interface{}{},
nil,
varName,

View File

@ -12,7 +12,7 @@ type Yield struct {
}
func NewYield(key node.Node, value node.Node) node.Node {
return Yield{
return &Yield{
map[string]interface{}{},
nil,
key,

View File

@ -11,7 +11,7 @@ type YieldFrom struct {
}
func NewYieldFrom(expression node.Node) node.Node {
return YieldFrom{
return &YieldFrom{
map[string]interface{}{},
nil,
expression,

View File

@ -10,7 +10,7 @@ type Identifier struct {
}
func NewIdentifier(token token.Token) Node {
return Identifier{
return &Identifier{
map[string]interface{}{
"value": token.Value,
},

View File

@ -9,7 +9,7 @@ type FullyQualified struct {
}
func NewFullyQualified(parts []node.Node) node.Node {
return FullyQualified{
return &FullyQualified{
Name{
map[string]interface{}{},
nil,

View File

@ -11,7 +11,7 @@ type Name struct {
}
func NewName(parts []node.Node) node.Node {
return Name{
return &Name{
map[string]interface{}{},
nil,
parts,

View File

@ -10,7 +10,7 @@ type NamePart struct {
}
func NewNamePart(value string) node.Node {
return NamePart{
return &NamePart{
map[string]interface{}{
"value": value,
},

View File

@ -9,7 +9,7 @@ type Relative struct {
}
func NewRelative(parts []node.Node) node.Node {
return Relative{
return &Relative{
Name{
map[string]interface{}{},
nil,

View File

@ -7,7 +7,7 @@ type Nullable struct {
}
func NewNullable(expression Node) Node {
return Nullable{
return &Nullable{
map[string]interface{}{},
nil,
expression,

View File

@ -9,7 +9,7 @@ type Parameter struct {
}
func NewParameter(variableType Node, variable Node, defaultValue Node, byRef bool, variadic bool) Node {
return Parameter{
return &Parameter{
map[string]interface{}{
"byRef": byRef,
"variadic": variadic,

View File

@ -10,7 +10,7 @@ type Dnumber struct {
}
func NewDnumber(value string) node.Node {
return Dnumber{
return &Dnumber{
map[string]interface{}{
"value": value,
},

View File

@ -11,7 +11,7 @@ type Encapsed struct {
}
func NewEncapsed(parts []node.Node) node.Node {
return Encapsed{
return &Encapsed{
map[string]interface{}{},
nil,
parts,

View File

@ -10,7 +10,7 @@ type EncapsedStringPart struct {
}
func NewEncapsedStringPart(value string) node.Node {
return EncapsedStringPart{
return &EncapsedStringPart{
map[string]interface{}{
"value": value,
},

Some files were not shown because too many files have changed in this diff Show More