According to the official documentation, this is allowed and the parser seems to support this. However, when parsing contracts like this, the value associated with the PragmaDirective doesn't have any spaces:
Is there any reason for omitting the spaces? Unfortunately, this precludes the use of other modules that already parse version strings that follow the npm specification. This suggests that it would be better to keep the original format.
Contracts such as the Ballot contract shown in the official documentation use pragma versions that follow the same syntax as npm:
According to the official documentation, this is allowed and the parser seems to support this. However, when parsing contracts like this, the value associated with the
PragmaDirective
doesn't have any spaces:Is there any reason for omitting the spaces? Unfortunately, this precludes the use of other modules that already parse version strings that follow the npm specification. This suggests that it would be better to keep the original format.