Skip to content

Proposal: Print statement #73

@vihanb

Description

@vihanb

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions