Conversation
|
This is the "export using" statement and actually much easier to implement than I thought. |
c71320c to
fb58f4a
Compare
|
What about |
2323490 to
67739e9
Compare
67739e9 to
af6dd26
Compare
4ee70a9 to
849e8ed
Compare
980f3ad to
10e1dbc
Compare
|
This is ready for review, the name of the keyword is still up for debate. |
|
Idea for test: It should work even though neither |
|
Maybe or something similar to check global and non-global using together? In general this looks good, but may need a few more tests. |
6f3398a to
1a1ca44
Compare
80052b6 to
2e3394d
Compare
0723c25 to
4794861
Compare
4794861 to
672951c
Compare
|
If I see it correctly, the |
ekpyron
left a comment
There was a problem hiding this comment.
Looks good in general apart from the missing json ast part - but I also need another look after a rebase.
|
AST Json tests need updating. Looking at the rest regardless. |
libsolidity/ast/ASTJsonImporter.cpp
Outdated
| !_node.isMember("libraryName"), | ||
| _node["typeName"].isNull() ? nullptr : convertJsonToASTNode<TypeName>(_node["typeName"]) | ||
| _node["typeName"].isNull() ? nullptr : convertJsonToASTNode<TypeName>(_node["typeName"]), | ||
| _node.isMember("global") && _node["global"].asBool() |
There was a problem hiding this comment.
| _node.isMember("global") && _node["global"].asBool() | |
| _node.isMember("global") && memberAsBool(_node, "global") |
?
Or only memberAsBool or is the idea to default to false instead of raising an error?
There was a problem hiding this comment.
The idea is to default to false.
There was a problem hiding this comment.
_node.isMember("global") && memberAsBool(_node, "global") would still be more graceful I guess, if global is there and not a boolean, but yeah, fine either way.
There was a problem hiding this comment.
Now it won't default to false anymore, though, will it :-)? But yeah, it also doesn't have to, so also fine.
|
Just for the sake of completeness, it could have some tests for |
|
Added the test. |
|
I'm mainly wondering if we need more tests at this point... So maybe coverage is already fine... |
ekpyron
left a comment
There was a problem hiding this comment.
Looks good to me - should be squashed before merging, though.
|
Added another semantic test and squashed. |
This comment was marked as spam.
This comment was marked as spam.
…8.13 See argotorg/solidity#12288 It's impossible to specify a newly introduced keyword optionally in the YML spec directly or even as an additional inline parser (`null` definitions are treated as an undefined parser and error out), so this adds versioning to the UsingDirective to add the new `global` contextual keyword.
The alternative syntax for this is
The disadvantage is that you can only have one
usingstatement per type and you cannot "mix" e.g. multiple modules, i.e. you cannot doexport using Modulename for MyFloat; export using {f, g, h} for MyFloat;We can of course change the
usingstatement so thatusing {f, M} for MyFloat;is equivalent tousing f for MyFloat; using M for MyFloat- currently modules and libraries cannot be used inside the braces.