Add a way to clarify ambiguous classinfos #7677
Unanswered
abandonedaccount6235
asked this question in
Suggestions
Replies: 2 comments
|
i agree with your thoughts about it being part of the literal parser and i like the overall idea |
0 replies
|
I'm just strongly against the design of |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I would like propose adding a syntax to clarify ambiguous type literals in Skript.
Currently, certain words can refer to multiple types, which can lead to confusion and errors in scripting. For instance,
blackcould refer to a color or a variant of a wolf. Horrifically,unknownhas over ten different matching types. This ambiguity can make it impossible for the parser to understand the intended meaning, especially in complex scripts.To address this issue, I suggest introducing a syntax that allows users to specify the type explicitly by using the pattern
<.+> (%classinfo%). For example:black (the wolf variant). This would clearly indicate to the parser that we are referring to the wolf variant rather than the color. We could even take it a step further and allow users to opt into a mode which forces them to specify the type when a type literal is ambiguous.My guess is that adding support for this directly to the type literal parser itself would be best. I worry that implementing it as an expression might affect parse times, but I would love more thoughts on that.
All reactions