Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Conversation

@vaivaswatha
Copy link
Contributor

@vaivaswatha vaivaswatha commented Nov 13, 2020

I will not squash-merge this PR as I intend to continue working on this branch for further for polynetwork support. Since I now have a format commit too, I'll just squash merge it and deal with the merge back to polynetwork branch later.

Co-authored-by: Anton Trunov <anton@zilliqa.com>
| "to_nat" -> Builtin_to_nat
| _ -> raise (SyntaxError (sprintf "\"%s\" is not a builtin" s, loc))
| _ -> (
let err = SyntaxError (sprintf "\"%s\" is not a builtin" s, loc) in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, if we care for speed, we should not create an error prematurely, only when it's not really needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem like that expensive an object to create right? Compared to regex for example. I put it at the beginning because it has two uses.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll remove that comment as the code we have now seems short enough (compared to longer thing I had before)

Co-authored-by: Anton Trunov <anton@zilliqa.com>
@anton-trunov
Copy link
Contributor

LGTM! Just one tiny nit: can we also have a test case with failing parsing of the new syntactic element? (i.e. to_bystrx). Just to see we catch the error and the location makes sense.

@vaivaswatha
Copy link
Contributor Author

LGTM! Just one tiny nit: can we also have a test case with failing parsing of the new syntactic element? (i.e. to_bystrx). Just to see we catch the error and the location makes sense.

Done

@vaivaswatha vaivaswatha merged commit 33b519e into master Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants