duaraghav8 / solparse

Solidity Parser for Solium
https://www.npmjs.com/package/solparse
29 stars 15 forks source link

Support all version literal patterns #30

Open duaraghav8 opened 6 years ago

duaraghav8 commented 6 years ago
pragma solidity 0.4.0;
pragma solidity ^0.4.0;
pragma solidity >= 0.4.0;
pragma solidity <= 0.4.0;
pragma solidity < 0.4.0;
pragma solidity > 0.4.0;
pragma solidity != 0.4.0;
pragma solidity >=0.4.0 <0.4.8; // from https://github.com/ethereum/solidity/releases/tag/v0.4.0

pragma solidity 0.4;
pragma solidity ^0.4;
pragma solidity >= 0.4;
pragma solidity <= 0.4;
pragma solidity < 0.5;
pragma solidity > 0.4;
pragma solidity != 0.4;
pragma solidity >=0.4 <=0.4;

pragma solidity 0;
pragma solidity v0;
pragma solidity ^0;
pragma solidity >= 0;
pragma solidity <= 0;
pragma solidity < 1;
pragma solidity > 0;
pragma solidity != 0;
pragma solidity >=0 <=1;

All version literals must be supported