I just tried to set up a truffle project and tried to compile a contract I have already written.
When I do so I get the following error message:
/usr/lib/node_modules/truffle/node_modules/solidity-parser/index.js:39
throw e;
^
SyntaxError: Expected "contract", "import", "library", comment, end of input, end of line or whitespace but "p" found. Line: 1, Column: 1
at peg$buildException (/usr/lib/node_modules/truffle/node_modules/solidity-parser/build/imports_parser.js:423:14)
at Object.peg$parse [as parse] (/usr/lib/node_modules/truffle/node_modules/solidity-parser/build/imports_parser.js:3355:13)
at Object.module.exports.parse (/usr/lib/node_modules/truffle/node_modules/solidity-parser/index.js:34:23)
at /usr/lib/node_modules/truffle/lib/profiler.js:134:36
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
The first line the compiler is complaining about is:
pragma solidity ^0.4.0;
As far as I know there is no way I could let that line out. Is there a solution that lets me use Truffle with the most recent version of solidity?
Thank you in advance.
solc --version
give? If I use v0.3.6, I get the same error on thepragma
line.