-*- Autoconf -*-
# Language-independent M4 Macros for Bison.
-# Copyright (C) 2002, 2004-2010 Free Software Foundation, Inc.
+
+# Copyright (C) 2002, 2004-2012 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
# For example:
#
-# b4_error([[warn]], [[invalid value for `%s': %s]], [[foo]], [[3]])
+# b4_error([[warn]], [[invalid value for '%s': %s]], [[foo]], [[3]])
m4_define([b4_error],
[b4_cat([[@]$1[(]$2[]]dnl
[m4_if([$#], [2], [],
#
# For example:
#
-# b4_warn([[invalid value for `%s': %s]], [[foo]], [[3]])
+# b4_warn([[invalid value for '%s': %s]], [[foo]], [[3]])
#
# As a simple test suite, this:
#
m4_define([b4_flag_if],
[m4_case(b4_$1_flag,
[0], [$3],
- [1], [$2],
- [m4_fatal([invalid $1 value: ]$1)])])
+ [1], [$2],
+ [m4_fatal([invalid $1 value: ]$1)])])
# b4_define_flag_if(FLAG)
# b4_FLAG_if(IF-TRUE, IF-FALSE)
# -----------------------------
# Expand IF-TRUE, if FLAG is true, IF-FALSE otherwise.
-b4_define_flag_if([defines]) # Whether headers are requested.
-b4_define_flag_if([glr]) # Whether a GLR parser is requested.
-b4_define_flag_if([nondeterministic]) # Whether conflicts should be handled.
-b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
+b4_define_flag_if([defines]) # Whether headers are requested.
+b4_define_flag_if([glr]) # Whether a GLR parser is requested.
+b4_define_flag_if([nondeterministic]) # Whether conflicts should be handled.
+b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
## --------- ##
b4_dollar_dollar([b4_symbol([$1], [number])],
[b4_symbol([$1], [tag])],
[b4_symbol([$1], [type])]);
- break;
+ break;
])])
m4_pushdef([b4_end], m4_shift(m4_shift(b4_occurrence)))dnl
m4_ifndef($3[(]m4_quote(b4_user_name)[)],
[b4_complain_at([b4_start], [b4_end],
- [[%s `%s' is not used]],
+ [[%s '%s' is not used]],
[$1], [b4_user_name])])[]dnl
m4_popdef([b4_occurrence])dnl
m4_popdef([b4_user_name])dnl
[m4_pushdef([b4_loc], m4_indir([b4_percent_define_loc(]$1[)]))dnl
b4_loc[]dnl
m4_popdef([b4_loc])],
- [b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_get_loc]], [$1])])])
+ [b4_fatal([[b4_percent_define_get_loc: undefined %%define variable '%s']], [$1])])])
# b4_percent_define_get_syncline(VARIABLE)
# ----------------------------------------
m4_define([b4_percent_define_get_syncline],
[m4_ifdef([b4_percent_define_syncline(]$1[)],
[m4_indir([b4_percent_define_syncline(]$1[)])],
- [b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_get_syncline]], [$1])])])
+ [b4_fatal([[b4_percent_define_get_syncline: undefined %%define variable '%s']], [$1])])])
# b4_percent_define_ifdef(VARIABLE, IF-TRUE, [IF-FALSE])
# ------------------------------------------------------
# b4_percent_define_ifdef([[foo]], [[it's defined]], [[it's undefined]])
m4_define([b4_percent_define_ifdef],
[m4_ifdef([b4_percent_define(]$1[)],
- [b4_percent_define_use([$1])$2],
- [$3])])
+ [b4_percent_define_use([$1])$2],
+ [$3])])
## --------- ##
[m4_case(b4_percent_define_get([$1]),
[], [$2], [true], [$2], [false], [$3],
[m4_expand_once([b4_complain_at(b4_percent_define_get_loc([$1]),
- [[invalid value for %%define Boolean variable `%s']],
+ [[invalid value for %%define Boolean variable '%s']],
[$1])],
[[b4_percent_define_flag_if($1)]])])],
- [b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_flag_if]], [$1])])])
+ [b4_fatal([[b4_percent_define_flag_if: undefined %%define variable '%s']], [$1])])])
# b4_percent_define_default(VARIABLE, DEFAULT)
[m4_define([b4_good_value], [1])])])])dnl
m4_if(b4_good_value, [0],
[b4_complain_at(b4_percent_define_get_loc([$1]),
- [[invalid value for %%define variable `%s': `%s']],
+ [[invalid value for %%define variable '%s': '%s']],
[$1],
m4_dquote(m4_indir([b4_percent_define(]$1[)])))
m4_foreach([b4_value], m4_dquote(m4_shift($@)),
[b4_complain_at(b4_percent_define_get_loc([$1]),
- [[accepted value: `%s']],
+ [[accepted value: '%s']],
m4_dquote(b4_value))])])dnl
m4_popdef([b4_good_value])],
- [b4_fatal([[undefined %%define variable `%s' passed to b4_percent_define_check_values]], [$1])])])
+ [b4_fatal([[b4_percent_define_check_values: undefined %%define variable '%s']], [$1])])])
# b4_percent_code_get([QUALIFIER])
# --------------------------------
m4_define([b4_percent_code_ifdef],
[m4_ifdef([b4_percent_code(]$1[)],
[m4_ifval([$1], [m4_define([b4_percent_code_bison_qualifiers(]$1[)])])$2],
- [$3])])
+ [$3])])
## ------------------ ##