diff options
| author | Akim Demaille <akim.demaille@gmail.com> | 2020-02-01 07:07:28 +0100 |
|---|---|---|
| committer | kocsismate <kocsismate@woohoolabs.com> | 2020-02-01 14:21:53 +0100 |
| commit | 4cbffd89d9e82d81a26746aadca27ad061cab43a (patch) | |
| tree | 5758a2142048208443671c486f0855cd2c72855c /ext/json/json_parser.y | |
| parent | 2127a37b833a863e28a4692e7394613b89c89290 (diff) | |
| download | php-git-4cbffd89d9e82d81a26746aadca27ad061cab43a.tar.gz | |
Clean up the generation of the parsers
Prefer '%define api.value.type' to '#define YYSTYPE', so that Bison
know the type.
Use '%code requires' to declare what is needed to define the api.value.type
(that code is output in the generated header before the generated
definition of YYSTYPE).
Prefer '%define api.prefix' inside the grammar file to '-p' outside,
as anyway the functions defined in the file actually use this prefix.
Prefer `%param` to both `%parse-param` and `%lex-param`.
Closes GH-5138
Diffstat (limited to 'ext/json/json_parser.y')
| -rw-r--r-- | ext/json/json_parser.y | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/json/json_parser.y b/ext/json/json_parser.y index 833a772807..4705e498a6 100644 --- a/ext/json/json_parser.y +++ b/ext/json/json_parser.y @@ -41,10 +41,9 @@ int json_yydebug = 1; } -%define api.pure full %define api.prefix {php_json_yy} -%lex-param { php_json_parser *parser } -%parse-param { php_json_parser *parser } +%define api.pure full +%param { php_json_parser *parser } %union { zval value; |
