Open sjbarag opened 5 years ago
@sjbarag Using your provided example, I don't get any errors.
Here's a test also proving this already works.
it('supports one-line functions separated by colons', () => {
let { tokens } = brs.lexer.Lexer.scan(`
sub main(): print "Hello world!": end sub
`);
let { statements, errors } = brs.parser.Parser.parse(tokens);
expect(errors.length).toEqual(0);
expect(statements).toMatchSnapshot();
});
Heck, that's because I posted the wrong snippet :sweat_smile: Looks like the issue is an as type
clause before the :
. I updated the example in the description inline. Sorry about that!
Like #230 and #195,
:
can be used to turn a function into a oneliner! They look neato and are supported by RBI but not bybrs
. MWE: