z_mirror/luapls
git clone https://git.raiguard.me/z_mirror/luapls
5c64afc
main
1package ast 2 3func (node * AssignmentStatement )GetSemanticChildren () []Node { 4return []Node {& node .Vars ,& node .Exps } 5} 6 7func (node * BooleanLiteral )GetSemanticChildren () []Node { 8return []Node {} 9} 10 11func (node * BreakStatement )GetSemanticChildren () []Node { 12return []Node {} 13} 14 15func (node * DoStatement )GetSemanticChildren () []Node { 16return []Node {& node .Body } 17} 18 19func (node * ForInStatement )GetSemanticChildren () []Node { 20return []Node {& node .Names ,& node .Exps ,& node .Body } 21} 22 23func (node * ForStatement )GetSemanticChildren () (children []Node ) { 24children = append (children ,& node .Start ,& node .Finish ) 25if node .Step != nil { 26children = append (children ,node .Step ) 27 } 28children = append (children ,& node .Body ) 29return children 30} 31 32func (node * FunctionCall )GetSemanticChildren () []Node { 33return []Node {node .Name ,& node .Args } 34} 35 36func (node * FunctionExpression )GetSemanticChildren () []Node { 37return []Node {& node .Params ,& node .Body } 38} 39 40func (node * FunctionStatement )GetSemanticChildren () []Node { 41return []Node {node .Name ,& node .Params ,& node .Body } 42} 43 44func (node * GotoStatement )GetSemanticChildren () []Node { 45if node .Name != nil { 46return []Node {node .Name } 47 } 48return []Node {} 49} 50 51func (node * Identifier )GetSemanticChildren () []Node { 52return []Node {} 53} 54 55func (node * IfClause )GetSemanticChildren () []Node { 56return []Node {node .Condition ,& node .Body } 57} 58 59func (node * IfStatement )GetSemanticChildren () (children []Node ) { 60for _ ,clause := range node .Clauses { 61children = append (children ,clause ) 62 } 63return children 64} 65 66func (node * IndexExpression )GetSemanticChildren () []Node { 67return []Node {node .Prefix ,node .Inner } 68} 69 70func (node * InfixExpression )GetSemanticChildren () []Node { 71return []Node {node .Left ,node .Right } 72} 73 74func (node * LabelStatement )GetSemanticChildren () []Node { 75return []Node {node .Name } 76} 77 78func (node * Invalid )GetSemanticChildren () []Node { 79return []Node {} 80} 81 82func (node * LocalStatement )GetSemanticChildren () (children []Node ) { 83children = append (children ,& node .Names ) 84if node .Exps != nil { 85children = append (children ,node .Exps ) 86 } 87return children 88} 89 90func (node * NilLiteral )GetSemanticChildren () []Node { 91return []Node {} 92} 93 94func (node * NumberLiteral )GetSemanticChildren () []Node { 95return []Node {} 96} 97 98func (node * Pair [T ])GetSemanticChildren () []Node { 99return []Node {node .Node } 100} 101 102func (p * Punctuated [T ])GetSemanticChildren () (n []Node ) { 103for i := 0 ;i < len (p .Pairs );i ++ { 104n = append (n ,& p .Pairs [i ]) 105 } 106return n 107} 108 109func (node * PrefixExpression )GetSemanticChildren () []Node { 110return []Node {node .Right } 111} 112 113func (node * RepeatStatement )GetSemanticChildren () []Node { 114return []Node {& node .Body ,node .Condition } 115} 116 117func (node * ReturnStatement )GetSemanticChildren () []Node { 118return []Node {node .Exps } 119} 120 121func (node * SemicolonStatement )GetSemanticChildren () []Node { 122return []Node {} 123} 124 125func (node * StringLiteral )GetSemanticChildren () []Node { 126return []Node {} 127} 128 129func (node * TableArrayField )GetSemanticChildren () []Node { 130return []Node {node .Expr } 131} 132 133func (node * TableSimpleKeyField )GetSemanticChildren () []Node { 134return []Node {& node .Name ,node .Expr } 135} 136 137func (node * TableExpressionKeyField )GetSemanticChildren () []Node { 138return []Node {node .Name ,node .Expr } 139} 140 141func (node * TableLiteral )GetSemanticChildren () []Node { 142return []Node {& node .Fields } 143} 144 145func (node * Vararg )GetSemanticChildren () []Node { 146return []Node {} 147} 148 149func (node * WhileStatement )GetSemanticChildren () []Node { 150return []Node {node .Condition ,& node .Body } 151}