mirror of
https://github.com/AdaCore/langkit.git
synced 2026-02-12 12:28:12 -08:00
22 lines
527 B
Plaintext
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]
|
|
}
|