ConsenSysMesh / solidity-parser

Solidity Parser in Javascript
138 stars 54 forks source link

Using curly braces '{' '}' within string of contract causes parser to fail #38

Closed D-Nice closed 7 years ago

D-Nice commented 7 years ago

Issue

A contract having any string containing a curly brace causes the parser to break, and stops any compilation.

Steps to Reproduce

Add

string break = "}";

to any contract

Expected Behavior

To compile just fine, as with solc and browser-solidity.

Actual Results

SyntaxErrors

SyntaxError: Expected "contract", "import", "library", "pragma", "using", comment, end of
input, end of line or whitespace but "\"" found.

or

SyntaxError: Expected "{", "}", any character, comment, end of line or whitespace but end
of input found.

Environment

Previously mentioned on https://github.com/ConsenSys/truffle/issues/309#issuecomment-265824189