zigself icon indicating copy to clipboard operation
zigself copied to clipboard

Make parser allow a slot list at top level

Open sin-ack opened this issue 3 years ago • 0 comments

Currently we only allow slot lists in objects. This prevents the following from being valid code:

| foo. bar |
foo: 123.
bar: 456.
foo * bar; asString printLine.

There is no reason for the top-level context to not be a method object (in fact, the runtime already wraps the top-level context in a method object before activating it!). Therefore it makes equal sense to have the parser allow a slot list to be valid there.

sin-ack avatar Aug 12 '22 10:08 sin-ack