Files
2026-01-20 16:03:43 +00:00

22 lines
527 B
Plaintext

# Check that scopes for lambda arguments are properly handled
from lexer_example import foo_lexer
@with_lexer(foo_lexer)
grammar foo_grammar {
@main_rule main_rule <- list*(Example("example"))
}
@abstract
class FooNode implements Node[FooNode] {
@exported
fun prop(l: ASTList[Example]): Array[Int] =
# Nest two lambda expressions that define arguments with the same name
# (v).
l.map((v) => v.values().find((v) => v == 1))
}
class Example: FooNode {
fun values(): Array[Int] = [1]
}