Add expression functions with context boundaries
This commit is contained in:
parent
5085ae51aa
commit
773c34f3f4
18 changed files with 391 additions and 52 deletions
|
|
@ -1221,12 +1221,18 @@ func stmtsMatch(stmts []Stmt, match func(Expr) bool) bool {
|
|||
|
||||
func programExprMatches(program *Program, match func(Expr) bool) bool {
|
||||
for _, fn := range program.Functions {
|
||||
if fn.ExpressionBody != nil && exprMatches(fn.ExpressionBody, match) {
|
||||
return true
|
||||
}
|
||||
if stmtsMatch(fn.Body, match) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
for _, class := range program.Classes {
|
||||
for _, fn := range class.Methods {
|
||||
if fn.ExpressionBody != nil && exprMatches(fn.ExpressionBody, match) {
|
||||
return true
|
||||
}
|
||||
if stmtsMatch(fn.Body, match) {
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue