handle php doc comments
This commit is contained in:
@@ -7,19 +7,20 @@ import (
|
||||
type Closure struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
position *node.Position
|
||||
params []node.Node
|
||||
uses []node.Node
|
||||
returnType node.Node
|
||||
stmts []node.Node
|
||||
}
|
||||
|
||||
func NewClosure(params []node.Node, uses []node.Node, returnType node.Node, stmts []node.Node, isStatic bool, isReturnRef bool) node.Node {
|
||||
func NewClosure(params []node.Node, uses []node.Node, returnType node.Node, stmts []node.Node, isStatic bool, isReturnRef bool, phpDocComment string) node.Node {
|
||||
return Closure{
|
||||
"Closure",
|
||||
map[string]interface{}{
|
||||
"isReturnRef": isReturnRef,
|
||||
"isStatic": isStatic,
|
||||
"isReturnRef": isReturnRef,
|
||||
"isStatic": isStatic,
|
||||
"phpDocComment": phpDocComment,
|
||||
},
|
||||
nil,
|
||||
params,
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
type Class struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
position *node.Position
|
||||
className node.Node
|
||||
modifiers []node.Node
|
||||
args []node.Node
|
||||
@@ -16,10 +16,12 @@ type Class struct {
|
||||
stmts []node.Node
|
||||
}
|
||||
|
||||
func NewClass(className node.Node, modifiers []node.Node, args []node.Node, extends node.Node, implements []node.Node, stmts []node.Node) node.Node {
|
||||
func NewClass(className node.Node, modifiers []node.Node, args []node.Node, extends node.Node, implements []node.Node, stmts []node.Node, phpDocComment string) node.Node {
|
||||
return Class{
|
||||
"Class",
|
||||
map[string]interface{}{},
|
||||
map[string]interface{}{
|
||||
"phpDocComment": phpDocComment,
|
||||
},
|
||||
nil,
|
||||
className,
|
||||
modifiers,
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
type ClassMethod struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
position *node.Position
|
||||
methodName node.Node
|
||||
modifiers []node.Node
|
||||
params []node.Node
|
||||
@@ -15,11 +15,12 @@ type ClassMethod struct {
|
||||
stmts []node.Node
|
||||
}
|
||||
|
||||
func NewClassMethod(methodName node.Node, modifiers []node.Node, returnsRef bool, params []node.Node, returnType node.Node, stmts []node.Node) node.Node {
|
||||
func NewClassMethod(methodName node.Node, modifiers []node.Node, returnsRef bool, params []node.Node, returnType node.Node, stmts []node.Node, phpDocComment string) node.Node {
|
||||
return ClassMethod{
|
||||
"ClassMethod",
|
||||
map[string]interface{}{
|
||||
"returnsRef": returnsRef,
|
||||
"returnsRef": returnsRef,
|
||||
"phpDocComment": phpDocComment,
|
||||
},
|
||||
nil,
|
||||
methodName,
|
||||
|
||||
@@ -7,15 +7,17 @@ import (
|
||||
type Constant struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
position *node.Position
|
||||
constantName node.Node
|
||||
expr node.Node
|
||||
}
|
||||
|
||||
func NewConstant(constantName node.Node, expr node.Node) node.Node {
|
||||
func NewConstant(constantName node.Node, expr node.Node, phpDocComment string) node.Node {
|
||||
return Constant{
|
||||
"Constant",
|
||||
map[string]interface{}{},
|
||||
map[string]interface{}{
|
||||
"phpDocComment": phpDocComment,
|
||||
},
|
||||
nil,
|
||||
constantName,
|
||||
expr,
|
||||
|
||||
@@ -7,18 +7,19 @@ import (
|
||||
type Function struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
position *node.Position
|
||||
functionName node.Node
|
||||
params []node.Node
|
||||
returnType node.Node
|
||||
stmts []node.Node
|
||||
}
|
||||
|
||||
func NewFunction(functionName node.Node, returnsRef bool, params []node.Node, returnType node.Node, stmts []node.Node) node.Node {
|
||||
func NewFunction(functionName node.Node, returnsRef bool, params []node.Node, returnType node.Node, stmts []node.Node, phpDocComment string) node.Node {
|
||||
return Function{
|
||||
"Function",
|
||||
map[string]interface{}{
|
||||
"returnsRef": returnsRef,
|
||||
"returnsRef": returnsRef,
|
||||
"phpDocComment": phpDocComment,
|
||||
},
|
||||
nil,
|
||||
functionName,
|
||||
|
||||
@@ -7,16 +7,18 @@ import (
|
||||
type Interface struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
position *node.Position
|
||||
interfaceName node.Node
|
||||
extends []node.Node
|
||||
stmts []node.Node
|
||||
}
|
||||
|
||||
func NewInterface(interfaceName node.Node, extends []node.Node, stmts []node.Node) node.Node {
|
||||
func NewInterface(interfaceName node.Node, extends []node.Node, stmts []node.Node, phpDocComment string) node.Node {
|
||||
return Interface{
|
||||
"Interface",
|
||||
map[string]interface{}{},
|
||||
map[string]interface{}{
|
||||
"phpDocComment": phpDocComment,
|
||||
},
|
||||
nil,
|
||||
interfaceName,
|
||||
extends,
|
||||
|
||||
@@ -7,15 +7,17 @@ import (
|
||||
type Property struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
position *node.Position
|
||||
variable node.Node
|
||||
expr node.Node
|
||||
}
|
||||
|
||||
func NewProperty(variable node.Node, expr node.Node) node.Node {
|
||||
func NewProperty(variable node.Node, expr node.Node, phpDocComment string) node.Node {
|
||||
return Property{
|
||||
"Property",
|
||||
map[string]interface{}{},
|
||||
map[string]interface{}{
|
||||
"phpDocComment": phpDocComment,
|
||||
},
|
||||
nil,
|
||||
variable,
|
||||
expr,
|
||||
|
||||
@@ -7,15 +7,17 @@ import (
|
||||
type Trait struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
position *node.Position
|
||||
traitName node.Node
|
||||
stmts []node.Node
|
||||
}
|
||||
|
||||
func NewTrait(traitName node.Node, stmts []node.Node) node.Node {
|
||||
func NewTrait(traitName node.Node, stmts []node.Node, phpDocComment string) node.Node {
|
||||
return Trait{
|
||||
"Trait",
|
||||
map[string]interface{}{},
|
||||
map[string]interface{}{
|
||||
"phpDocComment": phpDocComment,
|
||||
},
|
||||
nil,
|
||||
traitName,
|
||||
stmts,
|
||||
|
||||
Reference in New Issue
Block a user