nings-archive / slang

An open-source interpreter for The Source
0 stars 0 forks source link

Implement ES6 arrow functions #8

Open ning-y opened 6 years ago

ning-y commented 6 years ago

Braces and return keyword should be optional.

ning-y commented 6 years ago

Minor fix with d45e6e6, but requires explicit return with braces.

remo5000 commented 6 years ago

New specification: Arrow functions should only return expressions (without a return statement) ( name | ( parameters ) ) => expression

remo5000 commented 6 years ago

Note that as of cc2079a Arrow functions are represented as [Object object] but should be represented in a textual format (like functions)