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

Simulator throws errors on multi-line array #26

Open
spencerkee opened this issue Feb 4, 2021 · 1 comment
Open

Simulator throws errors on multi-line array #26

spencerkee opened this issue Feb 4, 2021 · 1 comment

Comments

@spencerkee
Copy link

This line succeeds:
byte incomingNeighborData[3] = {0,0,0};
but the following line:

byte incomingNeighborData[3] = {
  0,
  0,
  0
};

gives the error SyntaxError: expected expression, got '}'

@xyfeng
Copy link
Collaborator

xyfeng commented Feb 21, 2021

The parser code of converting c++ to javascript is very premature, it can only handle simple c++ structures. There are some ideas of using c++ interpreter libraries / web assembly to solve this issue, I haven't found time to work on it, for the time being, please write your array in one line fashion, or declare it first then assign values after. Thanks.

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

2 participants