Cheddar
Cheddar copied to clipboard
Proposal: Print statement
This proposal outlines the proposed print
statement.
Overview
print
as an unary operator results in odd an unexpected behavior. This is often undesired and also requires unnecessary parenthesis around ternaries:
print (true ? 1 : 2)
Definition
This will define print
in two places:
-
tokenizer/states/print.es6
-
interpreter/states/print.es6
as StatementPrint
. The code is exactly the same as the operator print
Formal Grammar
EBNF
@ = "print", [(newline | expression)]