Closed VinnyVicious closed 3 months ago
Not easily, because Rhai uses a recursive-descent parser, which means that the first token must always be deterministic.
Since Rhai allows any statements block as an expression (JavaScript doesn't), so there is no way to easily distinguish whether {
is the beginning of a hash literal or the beginning of a statements block.
Understood, that makes total sense. Thank you for the detailed explanation!
In order to define an object, Rhai uses
#{
. Could this be changed to just{
? If not, how is the language structured to deal with such syntax customizations?