Skip to content

Commit

Permalink
Update to Solidity 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Latrasis committed Sep 14, 2016
1 parent b132af3 commit 5dcb586
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
9 changes: 5 additions & 4 deletions lib/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ const path = require('path')
const rawFilePath = process.argv[2];

const dirPath = path.dirname(rawFilePath)
const filePath = path.basename(rawFilePath)
var filePath = path.basename(rawFilePath)
const input = {}; input[filePath] = fs.readFileSync(rawFilePath, 'utf8');

function parseErrors(dirPath, errors) {

return errors
.map(err => {
if(err.includes('Internal compiler error')) return {text: err, filePath};
Expand All @@ -19,12 +20,12 @@ function parseErrors(dirPath, errors) {
const raw_error_range = err.match(/\:\d+:\d+\:/)[0].split(':').slice(1,3)
const line = parseInt(raw_error_range[0])-1;

const raw_error_range_segment = err.split('Error:')[1].split('\n')[2];
const raw_error_range_segment = err.split(/Error:|Warning:/)[1].split('\n')[2];

const start= raw_error_range_segment.indexOf('^')
const end = raw_error_range_segment.lastIndexOf('^')
const end = raw_error_range_segment.lastIndexOf('^')+1

const text = err.split('Error:')[1].split('\n')[0];
const text = err.split(/Error:|Warning:/)[1].split('\n')[0];

return {text, filePath, range: [[line, start], [line, end]]}
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"postinstall": "node ./formatSolc.js"
},
"dependencies": {
"solc": "^0.3.5",
"solc": "^0.4.1",
"atom-linter": "^4.3.4"
},
"providedServices": {
Expand Down
2 changes: 2 additions & 0 deletions test/lary.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pragma solidity ^0.4.1;

library Lary {
function say() constant returns(string) {
return 'Hello';
Expand Down
2 changes: 2 additions & 0 deletions test/sample.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pragma solidity ^0.4.1;

import "lary.sol";

contract Sample {
Expand Down

0 comments on commit 5dcb586

Please sign in to comment.