Unaccepted @var{variable}s produce an error.
Some of the accepted @var{variable}s are described below.
-@deffn Directive {%define api.namespace} "@var{namespace}"
+@deffn Directive {%define api.namespace} @{@var{namespace}@}
@itemize
@item Languages(s): C++
For example, if you specify:
@example
-%define api.namespace "foo::bar"
+%define api.namespace @{foo::bar@}
@end example
Bison uses @code{foo::bar} verbatim in references such as:
lexical analyzer function. For example, if you specify:
@example
-%define api.namespace "foo"
+%define api.namespace @{foo@}
%name-prefix "bar::"
@end example
@end deffn
@c ================================================== namespace
-@deffn Directive %define namespace @var{namespace}
+@deffn Directive %define namespace @{@var{namespace}@}
Obsoleted by @code{api.namespace}
@c namespace
@end deffn
# is specified, then Bison should accept the input, but compilation will fail,
# so don't check compilation.
m4_pushdef([AT_TEST],
-[AT_BISON_OPTION_PUSHDEFS([%language "C++" %define api.namespace "$1"])
+[AT_BISON_OPTION_PUSHDEFS([%language "C++" %define api.namespace {$1}])
AT_DATA_GRAMMAR([[input.y]],
[[%language "C++"
-%define api.namespace "]$1["
+%define api.namespace {]$1[}
%union { int i; }
%define global_tokens_and_yystype
%locations
[[%define api.push_pull both
%define lr.keep_unreachable_states maybe
%define namespace "foo"
-%define api.namespace "foo"
+%define api.namespace {foo}
%define variant
%%
start: %empty;
%define namespace "foo"
^^^^^^^^^
input.y:4.9-21: error: %define variable 'api.namespace' redefined
- %define api.namespace "foo"
+ %define api.namespace {foo}
^^^^^^^^^^^^^
input.y:3.9-17: previous definition
%define namespace "foo"
AT_DATA([[input.y]],
[[%language "C++"
%defines
-%define api.namespace "]$1["
+%define api.namespace {]$1[}
%%
start: %empty;
]])
[m4_bpatsubsts([$1],
[%\(language\|skeleton\) "?\([^\" ]*\)"?],
[\2],
- [%define "?\([-A-Za-z0-9_.]+\)"? \("[^\"]+"\|[-A-Za-z0-9_.]+\)],
+ [%define "?\([-A-Za-z0-9_.]+\)"? \({[^\}]+}\|"[^\"]+"\|[-A-Za-z0-9_.]+\)],
[\1=\2],
[%define "?\([-A-Za-z0-9_.]+\)"?],
[\1],
[$2])])
# AT_NAME_PREFIX: also consider api.namespace.
m4_pushdef([AT_NAME_PREFIX],
-[m4_bmatch([$3], [\(%define api\.\(namespace\|prefix\)\|%name-prefix\) ".*"],
- [m4_bregexp([$3], [\(%define api\.\(namespace\|prefix\)\|%name-prefix\) "\([^""]*\)"], [\3])],
- [yy])])
+[m4_bmatch([$3], [\(%define api\.\(namespace\|prefix\)\|%name-prefix\) .*],
+ [m4_bregexp([$3],
+ [\(%define api\.\(namespace\|prefix\)\|%name-prefix\) [\{\"]\([^""]*\)[\"\}]],
+ [\3])],
+ [yy])])
m4_pushdef([AT_TOKEN_CTOR_IF],
[m4_bmatch([$3], [%define api\.token\.constructor], [$1], [$2])])
m4_pushdef([AT_TOKEN_PREFIX],