Closed WaterSo0910 closed 9 months ago
[Update] I found that there exists other things can trigger this more than throw
😭
Can you share some code that I can test? Just formatting is not fully tested feature...
Tks for reply. I'd like to highlight the specific scenarios:
throw
import "./msg_types";
contract Messenger { owner: Address; // Router Address sourceAddress: Address; init(owner: Address){ self.owner = owner; }
receive(msg: BuildMessenger){
if (msg.sourceAddress != self.sourceAddress) {
throw(113);
}
}
}
2. Usage of `with` without a following word like Ownable
import "./msg_types"; import "@stdlib/ownable";
contract Messenger with { owner: Address; // Router Address sourceAddress: Address; init(owner: Address){ self.owner = owner; }
receive(msg: BuildMessenger){
if (msg.sourceAddress != self.sourceAddress) {}
}
}
Additionally, perhaps there are other scenarios that haven't been discovered yet
I'd appreciate it if you could look into this and advise on a potential fix or workaround. Thank you for your support and dedication to this awesome project. 👍
throw
fixed on 1.0.4with without a following word like Ownable
is not a valid case. The parser doesn't expect this, because it is the same as write if
and didn't continue the input. I don't know why the tact-parser doesn't warn this issue, but I decided that for such cases the code will be remain the same after the formating. And only for a valid code the formatting feature will be applied.LGTM. Thanks a lot for contributing this neccesary dev tool :+1:
you are welcome, thank you too!
I just use this extension and after saving on format, my code just disappear.
And I found that if there exists
throw
in the tact file, then it will trigger this abnormal behaviour.