The Wayback Machine - http://web.archive.org/web/20200824083719/https://github.com/AssemblyScript/assemblyscript/issues/1125
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

Fix parsing of unusual trailing expressions separated by whitespace #1125

Open
MaxGraey opened this issue Feb 26, 2020 · 1 comment
Open

Fix parsing of unusual trailing expressions separated by whitespace #1125

MaxGraey opened this issue Feb 26, 2020 · 1 comment

Comments

@MaxGraey
Copy link
Member

@MaxGraey MaxGraey commented Feb 26, 2020

The issue described in next examples:

function add(y: i32): i32 {
  let x = y 234;
  return x + y;
}

function foo(): i32 {
  return 123 456;
}

interpreted currently as:

function add(y: i32): i32 {
  let x = y;
  234; // skip as unreachable
  return x + y;
}

function foo(): i32 {
  return 123;
  456; // skip as unreachable
}

And normally compiled, but should be compiler error.

@MaxGraey MaxGraey changed the title [Parser] Interpret tail expressions as unrechables [Parser] Interpret tail expressions divided via space as unrechables Feb 26, 2020
@dcodeIO dcodeIO added bug and removed enhancement labels May 28, 2020
@dcodeIO dcodeIO changed the title [Parser] Interpret tail expressions divided via space as unrechables Fix parsing of unusual trailing expressions separated by whitespace May 28, 2020
@MaxGraey
Copy link
Member Author

@MaxGraey MaxGraey commented Jul 3, 2020

Btw it should expect , after walk-through spaces and come across to new token which not a comma or semicolon in such contexts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.