cyber icon indicating copy to clipboard operation
cyber copied to clipboard

Implement map block syntax.

Open gpanders opened this issue 2 years ago • 1 comments
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 = {}:
^

gpanders avatar Jan 27 '23 23:01 gpanders

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.

fubark avatar Jan 28 '23 00:01 fubark