1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 15:38:49 +02:00
Commit Graph

10 Commits

Author SHA1 Message Date
Rowan Tommins 55a15f32ce Improve output of tokens in Parse Errors
Currently, unexpected tokens in the parser are shown as the text
found, plus the internal token name, including the notorious
"unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM)".

This commit replaces that with a more user-friendly format, with
two main types of token:

* Tokens which always represent the same text are shown like
  'unexpected token "::"' and 'expected "::"'
* Tokens which have variable text are given a user-friendly
  name, and show like 'unexpected identifier "foo"', and
  'expected identifer'.

A few tokens have special cases:

* unexpected token """ -> unexpected double-quote mark
* unexpected quoted string "'foo'" -> unexpected single-quoted
  string "foo"
* unexpected quoted string ""foo"" -> unexpected double-quoted
  string "foo"
* unexpected illegal character "_" -> unexpected character 0xNN
  (where _ is almost certainly a control character, and NN is the
   hexadecimal value of the byte)

The \ token has a special case in the implementation just to stop
bison making a mess of escaping it and it coming out as \\
2020-07-13 11:07:40 +02:00
Christopher Jones d002d6d56d Unmatched %s was still diffing on Linux. Now it matches the whitespace at a minimum 2011-09-01 19:27:14 +00:00
Pierre Joye e44ad565f0 - error msg may vary (parser) 2011-08-31 23:12:35 +00:00
Xinchen Hui 1f3536a019 Fixed testing failed 2011-08-30 12:11:03 +00:00
Felipe Pena c85ff1249c - Fixed tests 2011-06-24 19:23:25 +00:00
Marcus Boerger af3f48b7e1 Research reveals that the error text depends on the tools and their
versions used to create the language parser.
2003-11-29 12:51:37 +00:00
foobar d0f9ba8955 - Fix expected output. 2003-11-29 07:29:42 +00:00
Marcus Boerger f40ecad640 Errro message has changed 2003-11-26 08:45:42 +00:00
Marcus Boerger cb1976cb13 MFB: Fix test 2003-05-03 17:30:46 +00:00
foobar fc8d7c2a8e Added test case for bug #21820 2003-04-25 08:33:25 +00:00