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

Whitespace parser quirks #1736

Open
berekuk opened this issue Apr 25, 2023 · 1 comment
Open

Whitespace parser quirks #1736

berekuk opened this issue Apr 25, 2023 · 1 comment
Labels
Parser Lexical and syntactic grammar and its implementation

Comments

@berekuk
Copy link
Collaborator

berekuk commented Apr 25, 2023

  1. x = [[5]]; x[0] [0] is allowed, but x = [[5]]; x [0][0] is not.
  2. x = {foo: 5}; x .foo is not allowed.

JS allows all of these.

@berekuk berekuk added the Parser Lexical and syntactic grammar and its implementation label Apr 25, 2023
@github-project-automation github-project-automation bot moved this to 🆕 To prioritize in Main project Apr 25, 2023
@berekuk
Copy link
Collaborator Author

berekuk commented Apr 26, 2023

If we allow new lines, this creates an unfortunate uncertainty:

arr = [3,4,5]
x = arr
[0]

This could be interpreted in two different ways.

Less of a problem with .foo, because it's not a valid expression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Parser Lexical and syntactic grammar and its implementation
Projects
Status: 🔖 Later
Development

No branches or pull requests

1 participant