solidity-parser / parser

A Solidity parser for JS built on top of a robust ANTLR4 grammar
MIT License
157 stars 44 forks source link

The parser will report error if there is an avariable named `global` in solidity code #115

Closed jmp0x7c00 closed 8 months ago

jmp0x7c00 commented 8 months ago

example code:

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract Test{
   function test() public pure returns (uint){
      uint global = 0;
      global ++;
      return global;
   }
}

it can be compiled successfully on remix: image

but an exception was thrown when I use the parser to parse it