From d90023af5faeb08e6fdb75206ffb67a4c551be2c Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 6 Jul 2019 09:09:51 +0200 Subject: [PATCH] doc: fix inaccuracies wrt --define and --force-define The doc says that -Dfoo=bar is the same as %define foo "bar". It is not: the quotes are not added (and it makes a difference). * doc/bison.texi (Tuning the Parser): Fix the definition of -D/-F * src/getargs.c (usage): Likewise. --- doc/bison.texi | 11 ++++++++--- src/getargs.c | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/doc/bison.texi b/doc/bison.texi index 0478d792..c0b14383 100644 --- a/doc/bison.texi +++ b/doc/bison.texi @@ -10694,9 +10694,14 @@ it is not already defined, so that the debugging facilities are compiled. @itemx --define=@var{name}[=@var{value}] @itemx -F @var{name}[=@var{value}] @itemx --force-define=@var{name}[=@var{value}] -Each of these is equivalent to @samp{%define @var{name} "@var{value}"} -(@pxref{%define Summary}) except that Bison processes multiple definitions -for the same @var{name} as follows: +Each of these is equivalent to @samp{%define @var{name} @var{value}} +(@pxref{%define Summary}). Note that the delimiters are part of +@var{value}: @option{-Dapi.value.type=union}, +@option{-Dapi.value.type=@{union@}} and @option{-Dapi.value.type="union"} +correspond to @samp{%define api.value.type union}, @samp{%define +api.value.type @{union@}} and @samp{%define api.value.type "union"}. + +Bison processes multiple definitions for the same @var{name} as follows: @itemize @item diff --git a/src/getargs.c b/src/getargs.c index e0d647fe..f2585114 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -404,10 +404,10 @@ Tuning the Parser:\n\ -t, --debug instrument the parser for tracing\n\ same as '-Dparse.trace'\n\ --locations enable location support\n\ - -D, --define=NAME[=VALUE] similar to '%define NAME \"VALUE\"'\n\ - -F, --force-define=NAME[=VALUE] override '%define NAME \"VALUE\"'\n\ + -D, --define=NAME[=VALUE] similar to '%define NAME VALUE'\n\ + -F, --force-define=NAME[=VALUE] override '%define NAME VALUE'\n\ -p, --name-prefix=PREFIX prepend PREFIX to the external symbols\n\ - deprecated by '-Dapi.prefix=PREFIX'\n\ + deprecated by '-Dapi.prefix={PREFIX}'\n\ -l, --no-lines don't generate '#line' directives\n\ -k, --token-table include a table of token names\n\ -y, --yacc emulate POSIX Yacc\n\