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

Syntax error in variables while editing script #5

Closed
QinomeD opened this issue Feb 7, 2024 · 8 comments
Closed

Syntax error in variables while editing script #5

QinomeD opened this issue Feb 7, 2024 · 8 comments

Comments

@QinomeD
Copy link

QinomeD commented Feb 7, 2024

Issue type:

  • 🐛 Bug

Short description:

When adding a reassignment (smth like let str = "test"; str = "test 2"), the variable card gives me a syntax error (for example in display panels). Reinserting the variable card solves the issue (it's still annoying regardless).

Steps to reproduce the problem:

  1. Add a variable to your script, for example let str = "Hi InDy"
  2. Use this variable in a variable card and insert it into a connected display panel
  3. The variable's value is displayed properly
  4. Reassign the variable in your script, like str += " and InScripting!"
  5. Display Panel shows an X, hovering over the X in display panel's GUI shows that it's a SyntaxError (depends on what type of variable you are reassigning)

Expected behaviour:

New value displays correctly.


Versions:

  • This mod: 1.19.2-1.0.0
  • Minecraft: 1.19.2
  • Forge: 43.3.7

Log file:

@rubensworks
Copy link
Member

Thanks for reporting!

@rubensworks
Copy link
Member

Could you share the syntax error message you're getting?

@QinomeD
Copy link
Author

QinomeD commented Feb 7, 2024

Sure, one sec!

@QinomeD
Copy link
Author

QinomeD commented Feb 7, 2024

image
image
This is for the number type, for some reason syntax error says there's no ar symbol, but I use arr, so idk

@QinomeD
Copy link
Author

QinomeD commented Feb 7, 2024

image
image
This happens for reassigning array values

@rubensworks
Copy link
Member

The script variable probably got updated while you were typing, at which point the line was not complete yet and would result in a syntax error.
So I don't think the re-assignment itself is the problem.

Not sure yet what a good solution to this could be...

@QinomeD
Copy link
Author

QinomeD commented Feb 7, 2024

oh yeah, it's actually not only reassigning, I just didn't really test anything, since just changing the value manually didn't trigger the error

maybe the variable should be updated when the player stops writing?

@rubensworks
Copy link
Member

Note to self: consider invalidating errored variables, but only those that errored due to the currently edited script.

@rubensworks rubensworks changed the title Syntax error on reassigning a variable in script Syntax error in variables while editing script Feb 7, 2024
rubensworks added a commit to CyclopsMC/IntegratedDynamics that referenced this issue Apr 13, 2024
@rubensworks rubensworks moved this to Done in Maintenance Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants