diff --git a/.travis.yml b/.travis.yml index efb0983..1bbb11e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,7 @@ language: node_js node_js: - - "8" + - "10" + +script: + - npm run eslint + - npm test diff --git a/src/ASTBuilder.js b/src/ASTBuilder.js index 7d4c68a..818aed1 100644 --- a/src/ASTBuilder.js +++ b/src/ASTBuilder.js @@ -108,9 +108,16 @@ const transformAST = { }, PragmaDirective(ctx) { + // this converts something like >= 0.5.0 <0.7.0 + // in >=0.5.0 <0.7.0 + const value = ctx + .pragmaValue() + .children[0].children.map(x => toText(x)) + .join(" ") + return { name: toText(ctx.pragmaName()), - value: toText(ctx.pragmaValue()) + value } }, diff --git a/test/ast.js b/test/ast.js index 77d3bff..f56645a 100644 --- a/test/ast.js +++ b/test/ast.js @@ -79,7 +79,7 @@ describe('AST', () => { "~0.3.11",, "~1.3", "~10", "=0.0.1", "=0.6", "=1", "<=1.1.1", "<=11.11", "<=111", - "<0.5.11"] + "<0.5.11", ">=0.6.7 <0.7.0"] versions.forEach(function (version) { it("PragmaDirective " + version, function() { var ast = parser.parse("pragma solidity " + version + ";")