Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Print statement #73

Open
vihanb opened this issue Aug 6, 2016 · 0 comments
Open

Proposal: Print statement #73

vihanb opened this issue Aug 6, 2016 · 0 comments
Labels

Comments

@vihanb
Copy link
Member

vihanb commented Aug 6, 2016

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)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant