@@ -29,14 +29,18 @@ function parse(text, parsers, options) {
2929 : `hex"${ ctx . value . slice ( 4 , - 1 ) } "` ;
3030 } ,
3131 ElementaryTypeName ( ctx ) {
32+ // We avoid making changes for bytes1 since the type 'byte' was removed
33+ // in v0.8.0
34+ // See the breaking changes in https://docs.soliditylang.org/en/v0.8.0/080-breaking-changes.html#silent-changes-of-the-semantics
35+ // The type byte has been removed. It was an alias of bytes1.
36+ // TODO once we decide to keep track of the pragma, we can implement this again.
37+
3238 if ( options . explicitTypes === 'always' ) {
3339 if ( ctx . name === 'uint' ) ctx . name = 'uint256' ;
3440 if ( ctx . name === 'int' ) ctx . name = 'int256' ;
35- if ( ctx . name === 'byte' ) ctx . name = 'bytes1' ;
3641 } else if ( options . explicitTypes === 'never' ) {
3742 if ( ctx . name === 'uint256' ) ctx . name = 'uint' ;
3843 if ( ctx . name === 'int256' ) ctx . name = 'int' ;
39- if ( ctx . name === 'bytes1' ) ctx . name = 'byte' ;
4044 }
4145 } ,
4246 BinaryOperation ( ctx ) {
@@ -56,7 +60,12 @@ function parse(text, parsers, options) {
5660 ctx . left = tryHug ( ctx . left , [ '*' , '/' , '%' ] ) ;
5761 break ;
5862 case '**' :
59- ctx . left = tryHug ( ctx . left , [ '**' ] ) ;
63+ // We avoid making changes here since the order of precedence of the
64+ // operators for ** changed in v0.8.0
65+ // See the breaking changes in https://docs.soliditylang.org/en/v0.8.0/080-breaking-changes.html#silent-changes-of-the-semantics
66+ // Exponentiation is right associative, i.e., the expression a**b**c
67+ // is parsed as a**(b**c). Before 0.8.0, it was parsed as (a**b)**c.
68+ // TODO once we decide to keep track of the pragma, we can implement this again.
6069 break ;
6170 case '<<' :
6271 case '>>' :
0 commit comments