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

Remove the need for semicolons after function declarations #4

Open
ijchen opened this issue Feb 17, 2024 · 0 comments
Open

Remove the need for semicolons after function declarations #4

ijchen opened this issue Feb 17, 2024 · 0 comments

Comments

@ijchen
Copy link
Owner

ijchen commented Feb 17, 2024

Currently, all statements (notably including function declarations) require a semicolon to terminate them:

fn add(a, b) {
    return a + b;
} // <-- Note the lack of trailing semicolon

add(1, 1);
Syntax Error: unexpected token (invalid token following statement)
| example.ice line 5, col 1 to 3
| 
| add(1, 1);
| ^^^

This is annoying, tedious, and unexpected to programmers coming from other C-like languages. This requirement should be removed.

Unresolved questions:

  • Does this have to be a special case, or can we make a more general change to the syntax of the language?
  • What role does a semicolon fulfill / what is its meaning?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant