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

Evaluate selection (Ctrl+Shift+E) does not parse underscores #97324

Open
Cykyrios opened this issue Sep 22, 2024 · 2 comments · May be fixed by #97754
Open

Evaluate selection (Ctrl+Shift+E) does not parse underscores #97324

Cykyrios opened this issue Sep 22, 2024 · 2 comments · May be fixed by #97754

Comments

@Cykyrios
Copy link
Contributor

Tested versions

v4.3.1.rc.custom_build [d40fc50]
4.4 on latest master

System information

Godot v4.3.1.rc (d40fc50) - Manjaro Linux #1 SMP PREEMPT_DYNAMIC Wed Aug 7 16:19:28 UTC 2024 - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 7900 XT (RADV NAVI31) - AMD Ryzen 9 7900X 12-Core Processor (24 Threads)

Issue description

In the script editor, selecting an expression and pressing the shortcut for Evaluate Selection does just what the name suggests, e.g. selecting 10+24 will transform the selection into 34. However, for larger numbers, or any number where you put underscores for readability, e.g. 500+10_000, all characters starting from the underscore are ignored, which results in 510 instead of 10500.

Steps to reproduce

  • Type an expression in the script editor, with one number containing an underscore.
  • Press the Evaluate Selection shortcut (or select it from the context menu).
  • The result will not consider any characters after the underscore and will simply remove them.

Minimal reproduction project (MRP)

N/A

@AThousandShips
Copy link
Member

AThousandShips commented Sep 22, 2024

This is a limitation in the way this class parses things, it's very basic, in the same way "1_000".is_valid_int() returns false, and that's where things would need to be improved for this to work

But this is quite an advanced part of formatting

Will make a PR to document the fact that the string methods do not support this formatting

@HolonProduction
Copy link
Member

Worth noting that #97218 uses the expression parser as well, so it will be effected by this as well.

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

Successfully merging a pull request may close this issue.

3 participants