From e672c2c2dbd4a580da5405379089a5ce51d93e27 Mon Sep 17 00:00:00 2001 From: Ioan CHIRIAC Date: Fri, 24 Apr 2020 15:45:36 +0200 Subject: [PATCH] fix scalar definition into exp list (related to #532) --- src/parser.js | 5 +++++ src/parser/expr.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/parser.js b/src/parser.js index fd1bfb474..3d4cab0b4 100644 --- a/src/parser.js +++ b/src/parser.js @@ -231,6 +231,11 @@ const parser = function (lexer, ast) { this.tok.T_FILE, this.tok.T_DIR, this.tok.T_NS_C, + '"', + 'b"', + 'B"', + "-", + this.tok.T_NS_SEPARATOR, ].map(mapIt) ), }; diff --git a/src/parser/expr.js b/src/parser/expr.js index d5a93564b..f7df754c6 100644 --- a/src/parser/expr.js +++ b/src/parser/expr.js @@ -359,7 +359,7 @@ module.exports = { let value = null; let key = null; result = this.node("yield"); - if (this.next().is("EXPR") || this.is("SCALAR")) { + if (this.next().is("EXPR")) { // reads the yield return value value = this.read_expr(); if (this.token === this.tok.T_DOUBLE_ARROW) {