Skip to content

Commit

Permalink
fix version consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
ichiriac committed Jan 2, 2020
1 parent 6e65b82 commit 66f79ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 24 deletions.
10 changes: 6 additions & 4 deletions src/index.js
Expand Up @@ -91,12 +91,14 @@ const engine = function(options) {
options.parser.php7 = true;
options.parser.php73 = true;
}
options.lexer.php7 = options.parser.php7;
options.lexer.php73 = options.parser.php73;
options.lexer.php74 = options.parser.php74;
}
combine(options, this);
}

// same version flags based on parser options
this.lexer.php7 = this.parser.php7;
this.lexer.php73 = this.parser.php73;
this.lexer.php74 = this.parser.php74;
}
};

/**
Expand Down
29 changes: 9 additions & 20 deletions test/snapshot/__snapshots__/arrowfunc.test.js.snap
Expand Up @@ -183,37 +183,26 @@ Program {
"name": "var",
},
"operator": "=",
"right": Call {
"right": Closure {
"arguments": Array [],
"kind": "call",
"what": ClassReference {
"kind": "classreference",
"name": "fn",
"resolution": "uqn",
},
"body": undefined,
"byref": false,
"isStatic": false,
"kind": "arrowfunc",
"nullable": false,
"type": null,
},
},
"kind": "expressionstatement",
},
ExpressionStatement {
"expression": undefined,
"kind": "expressionstatement",
},
],
"errors": Array [
Error {
"expected": ";",
"kind": "error",
"line": 1,
"message": "Parse Error : syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ';' on line 1",
"token": "'=>' (T_DOUBLE_ARROW)",
},
Error {
"expected": "EXPR",
"kind": "error",
"line": 1,
"message": "Parse Error : syntax error, unexpected '=>' (T_DOUBLE_ARROW) on line 1",
"token": "'=>' (T_DOUBLE_ARROW)",
"message": "Parse Error : syntax error, unexpected ';' on line 1",
"token": "';'",
},
],
"kind": "program",
Expand Down

0 comments on commit 66f79ad

Please sign in to comment.