Add expression functions with context boundaries

This commit is contained in:
pavel 2026-08-27 23:05:49 +02:00
commit 773c34f3f4
18 changed files with 391 additions and 52 deletions

View file

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