diff --git a/src/Behat/Gherkin/Parser.php b/src/Behat/Gherkin/Parser.php index decd52eb..101f324f 100644 --- a/src/Behat/Gherkin/Parser.php +++ b/src/Behat/Gherkin/Parser.php @@ -566,11 +566,13 @@ protected function parseExamples() */ protected function parseTable() { + $table = $this->parseTableRows(); + try { - return new TableNode($this->parseTableRows()); + return new TableNode($table); } catch(NodeException $e) { throw new ParserException( - $e->getMessage() . $this->file ? ' in file '.$this->file : '', + $e->getMessage() . ($this->file ? ' in file '.$this->file : ''), 0, $e );