mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 14:18:42 +01:00
18 lines
626 B
Plaintext
18 lines
626 B
Plaintext
// Groups store attributes by named group
|
|
|
|
#!key //not combined
|
|
#!group(key=combined)
|
|
#!group(key=value, key=2, key=false)
|
|
class GroupedKeys {}
|
|
|
|
var ungroupedKeys = GroupedKeys.attributes.self[null]
|
|
var groupedKeys = GroupedKeys.attributes.self["group"]
|
|
|
|
System.print(ungroupedKeys.count) // expect: 1
|
|
System.print(groupedKeys.count) // expect: 1
|
|
System.print(ungroupedKeys.containsKey("key")) // expect: true
|
|
var groupedKey = groupedKeys["key"]
|
|
System.print(groupedKey.count) // expect: 4
|
|
System.print(groupedKey) // expect: [combined, value, 2, false]
|
|
|