From 09781487632e9ab48c7b3006cb1c9c51980f6d52 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 22 Dec 2018 18:24:01 +0100 Subject: [PATCH] c++: style: rename a few macros for clarity * data/c++.m4, data/lalr1.cc, data/variant.hh: s/b4_symbol_constructor/b4_token_constructor/g, as this is really what is being defined. --- data/c++.m4 | 16 ++++++++-------- data/lalr1.cc | 2 +- data/variant.hh | 28 ++++++++++++++-------------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/data/c++.m4 b/data/c++.m4 index eb5c47f0..6a0604c0 100644 --- a/data/c++.m4 +++ b/data/c++.m4 @@ -341,8 +341,8 @@ m4_define([b4_symbol_type_declare], symbol_type () {}; /// Constructor for valueless symbols, and symbols from each type. -]b4_type_foreach([_b4_symbol_constructor_declare])[ - ]])[}; +]b4_type_foreach([_b4_token_constructor_declare])dnl + ])[}; ]]) @@ -488,16 +488,16 @@ m4_define([b4_public_types_define], } ]])[]dnl -b4_symbol_constructor_define]) +b4_token_constructor_define]) -# b4_symbol_constructor_declare -# b4_symbol_constructor_define -# ----------------------------- +# b4_token_constructor_declare +# b4_tolen_constructor_define +# ---------------------------- # Declare/define symbol constructors for all the value types. # Use at class-level. Redefined in variant.hh. -m4_define([b4_symbol_constructor_declare], []) -m4_define([b4_symbol_constructor_define], []) +m4_define([b4_token_constructor_declare], []) +m4_define([b4_token_constructor_define], []) # b4_yytranslate_define(cc|hh) diff --git a/data/lalr1.cc b/data/lalr1.cc index 26d9e286..21ec144f 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -216,7 +216,7 @@ m4_define([b4_shared_declarations], /// Report a syntax error. void error (const syntax_error& err); -]b4_symbol_constructor_declare[ +]b4_token_constructor_declare[ private: /// This class is not copyable. diff --git a/data/variant.hh b/data/variant.hh index 4e036d1e..545060e3 100644 --- a/data/variant.hh +++ b/data/variant.hh @@ -368,11 +368,11 @@ m4_define([_b4_token_maker_declare], ])]) -# _b4_symbol_constructor_declare(SYMBOL-NUM...) -# --------------------------------------------- +# _b4_token_constructor_declare(SYMBOL-NUM...) +# -------------------------------------------- # Declare a unique make_symbol for all the SYMBOL-NUM (they # have the same type). Use at class-level. -m4_define([_b4_symbol_constructor_declare], +m4_define([_b4_token_constructor_declare], [m4_ifval(_b4_includes_tokens($@), [#if 201103L <= YY_CPLUSPLUS symbol_type (b4_join( @@ -390,10 +390,10 @@ m4_define([_b4_symbol_constructor_declare], ])]) -# b4_symbol_constructor_declare -# ----------------------------- -# Declare symbol constructors. Use at class-level. -m4_define([b4_symbol_constructor_declare], +# b4_token_constructor_declare +# ---------------------------- +# Declare token constructors. Use at class-level. +m4_define([b4_token_constructor_declare], [ // Symbol constructors declarations. b4_symbol_foreach([_b4_token_maker_declare])]) @@ -432,8 +432,8 @@ m4_define([_b4_token_maker_define], ])]) -# _b4_symbol_constructor_define(SYMBOL-NUM...) -# -------------------------------------------- +# _b4_token_constructor_define(SYMBOL-NUM...) +# ------------------------------------------- # Declare a unique make_symbol for all the SYMBOL-NUM (they # have the same type). Use at class-level. m4_define([_b4_type_clause], @@ -442,7 +442,7 @@ m4_define([_b4_type_clause], [tok == token::b4_symbol([$1], [id])], [tok == b4_symbol([$1], [user_number])])])]) -m4_define([_b4_symbol_constructor_define], +m4_define([_b4_token_constructor_define], [m4_ifval(_b4_includes_tokens($@), [[#if 201103L <= YY_CPLUSPLUS inline @@ -520,10 +520,10 @@ m4_define([b4_basic_symbol_constructor_define], ]]) -# b4_symbol_constructor_define -# ---------------------------- +# b4_token_constructor_define +# --------------------------- # Define the overloaded versions of make_symbol for all the value types. -m4_define([b4_symbol_constructor_define], +m4_define([b4_token_constructor_define], [ // Implementation of make_symbol for each symbol type. -b4_type_foreach([_b4_symbol_constructor_define]) +b4_type_foreach([_b4_token_constructor_define]) b4_symbol_foreach([_b4_token_maker_define])])