cyber
cyber copied to clipboard
Implement map block syntax.
trafficstars
Running the example from the docs in the playground:
colors = {}:
red: 0xFF0000
green: 0x00FF00
blue: 0x0000FF
dump func (c):
print c.red
print c.green
print c.blue
-- Nested map.
darker {}:
red: 0xAA0000
green: 0x00AA00
blue: 0x0000AA
gives the following error:
ParseError: Expected end of line or file, got colon
main:1:12:
colors = {}:
^
Thanks for catching this. The documentation is ahead of the implementation, and this is one such case. You can expect this feature will land though. One thing that may change is the initializer syntax.