solidity icon indicating copy to clipboard operation
solidity copied to clipboard

Type identifier string in AST is ambiguous with linear parser

Open michprev opened this issue 3 years ago • 0 comments

Description

Type identifier strings generated in Types.cpp cannot be unambiguously decoded with linear parser because of these escape sequences: https://github.com/ethereum/solidity/blob/49a2db99e69b5608c24064659528dc1d92b21fef/libsolidity/ast/Types.cpp#L262-L271

An example may be t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$ where (parsing from left to right) the last 4 symbols (_$_$) can be decoded as )) or ,$ (this one would end up as an invalid type string, but it would require branching of the parser).

Do you have an example implementation of a type identifier strings decoder?

Environment

  • Compiler version: since 0.4.9
  • Target EVM version (as per compiler settings): -
  • Framework/IDE (e.g. Truffle or Remix): -
  • EVM execution environment / backend / blockchain client: -
  • Operating system: -

michprev avatar Aug 07 '22 11:08 michprev