Closed schungx closed 2 years ago
Also, if I change the script to:
Although minus
is defined in __static__.d.rhai
:
module static;
op minus(int, int) -> int;
Nevertheless, custom operators may do weird things to the grammar though, so you can decide whether it is prudent to support it out-of-the-box.
Operators are ignored in the HIR right now (#66), the parser needs to know the allowed operator keywords so we need to process the definition files, and reparse the rest if the set of known custom keywords change.
The other issue is a bug, let
definitions are ignored in definitions right now, if you change it to const, it will be recognized.
Huh, apparently let
s were parsed but were missing from the AST definition.
The other issue is a bug,
let
definitions are ignored in definitions right now, if you change it to const, it will be recognized.
Got it. But if it is const
, won't it be an error to assign to it?
Got it. But if it is
const
, won't it be an error to assign to it?
Yes, renaming it to const is just a temporary fix, I'm working on the lsp to accept and not to ignore let
-s in definitions.
The let
issue has been fixed, and custom operators are tracked in the other issue.
In the
definitions
example, when I click openscript.rhai
:However,
hello_there
is already defined in__scope__.d.rhai
: