Cheddar icon indicating copy to clipboard operation
Cheddar copied to clipboard

Proposal: Print statement

Open vihanb opened this issue 7 years ago • 0 comments

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)]

vihanb avatar Aug 06 '16 20:08 vihanb