handle php doc comments

This commit is contained in:
vadim
2018-01-02 13:53:55 +02:00
parent 30187b1db1
commit 2051e3a23d
13 changed files with 4494 additions and 4497 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,