Skript

Skript

788k Downloads

Arithmetic with expressions not working

Closed this issue · 3 comments

commented

Skript/Server Version

> sk info
[09:39:49 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[09:39:49 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[09:39:49 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[09:39:49 INFO]: [Skript] Server Version: 1.21.8-11-a5f2f61 (MC: 1.21.8)
[09:39:49 INFO]: [Skript] Skript Version: 2.12.0 (skriptlang-github)
[09:39:49 INFO]: [Skript] Installed Skript Addons: None
[09:39:49 INFO]: [Skript] Installed dependencies: None

Bug Description

When using arithmetic with an expression, it fails to parse.

Expected Behavior

It should parse as it did pre 2.12

Steps to Reproduce

simple code:

on load:
	set {_i} to (10 * 10) of diamond

Errors or Screenshots

error from above code:

[09:38:42 INFO]: Line 3: (test.sk)
[09:38:42 INFO]:     A 10 * 10 is not a valid type.
[09:38:42 INFO]:     Line: set {_i} to (10 * 10) of diamond

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
commented

This should be fixed by #8068

commented

I want to note that this will not fix the specific example: (10 * 10) of diamond this is invalid as 10 * 10 simplifies to a literal (100) and ExprXOf does not allow both inputs to be literals (as 100 of diamond should match the itemtype parser rather than this syntax)

commented

This error is simply the result of some weird attempt in SkriptParser. It is not an issue with literal specification (though the mentioned PR might prevent it from ever occurring in this case). I have linked a PR to fix the underlying issue that caused this error.