bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C++: style: add missing space before parens


From: Akim Demaille
Subject: C++: style: add missing space before parens
Date: Sun, 14 Oct 2018 12:10:02 +0200

commit e05c8987715741b512f05c4db26d189ab303cacf
Author: Akim Demaille <address@hidden>
Date:   Sun Oct 14 11:30:41 2018 +0200

    C++: style: add missing space before parens
    
    * data/c++.m4, data/lalr1.cc, data/stack.hh, data/variant.hh,
    * examples/variant-11.yy: here.

diff --git a/data/c++.m4 b/data/c++.m4
index 0df0f5a5..38a08328 100644
--- a/data/c++.m4
+++ b/data/c++.m4
@@ -226,7 +226,7 @@ m4_define([b4_symbol_type_declare],
 [[    /// A complete symbol.
     ///
     /// Expects its Base type to provide access to the symbol type
-    /// via type_get().
+    /// via type_get ().
     ///
     /// Provide access to semantic value]b4_locations_if([ and location])[.
     template <typename Base>
diff --git a/data/lalr1.cc b/data/lalr1.cc
index 804efb65..cb8d6069 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -89,7 +89,7 @@ m4_define([_b4_rhs_value],
 
 m4_define([b4_rhs_value],
 [b4_percent_define_ifdef([api.value.automove],
-                         [YY_MOVE(_b4_rhs_value($@))],
+                         [YY_MOVE (_b4_rhs_value($@))],
                          [_b4_rhs_value($@)])])
 
 
@@ -672,7 +672,7 @@ m4_if(b4_prefix, [yy], [],
 #if defined __cplusplus && 201103L <= __cplusplus
     yypush_ (m, stack_symbol_type (s, YY_MOVE (sym)));
 #else
-    stack_symbol_type ss(s, sym);
+    stack_symbol_type ss (s, sym);
     yypush_ (m, ss);
 #endif
   }
diff --git a/data/location.cc b/data/location.cc
index 1b46055c..1ff61b7d 100644
--- a/data/location.cc
+++ b/data/location.cc
@@ -114,10 +114,11 @@ m4_define([b4_location_define],
     unsigned column;
 
   private:
-    /// Compute max(min, lhs+rhs).
+    /// Compute max (min, lhs+rhs).
     static unsigned add_ (unsigned lhs, int rhs, int min)
     {
-      return static_cast<unsigned>(std::max(min, static_cast<int>(lhs) + rhs));
+      return static_cast<unsigned> (std::max (min,
+                                              static_cast<int> (lhs) + rhs));
     }
   };
 
diff --git a/data/stack.hh b/data/stack.hh
index 99ed74f4..efe85c0d 100644
--- a/data/stack.hh
+++ b/data/stack.hh
@@ -73,7 +73,7 @@ m4_define([b4_stack_define],
     void
     push (YY_MOVE_REF (T) t)
     {
-      seq_.push_back (T());
+      seq_.push_back (T ());
       operator[](0).move (t);
     }
 
diff --git a/data/variant.hh b/data/variant.hh
index 308f7320..66848fd2 100644
--- a/data/variant.hh
+++ b/data/variant.hh
@@ -55,15 +55,15 @@ dummy[]_b4_char_sizeof_counter])
 # ---------------------------
 # To be mapped on the list of type names to produce:
 #
-#    char dummy1[sizeof(type_name_1)];
-#    char dummy2[sizeof(type_name_2)];
+#    char dummy1[sizeof (type_name_1)];
+#    char dummy2[sizeof (type_name_2)];
 #
 # for defined type names.
 m4_define([b4_char_sizeof],
 [b4_symbol_if([$1], [has_type],
 [
 m4_map([      b4_symbol_tag_comment], address@hidden)dnl
-      char address@hidden(b4_symbol([$1], [type]))@};
+      char address@hidden (b4_symbol([$1], [type]))@};
 ])])
 
 
@@ -222,7 +222,7 @@ m4_define([b4_variant_define],
 
   private:
     /// Prohibit blind copies.
-    self_type& operator=(const self_type&);
+    self_type& operator= (const self_type&);
     variant (const self_type&);
 
     /// Accessor to raw memory as \a T.
@@ -271,7 +271,7 @@ m4_define([b4_value_type_declare],
     {]b4_type_foreach([b4_char_sizeof])[};
 
     /// Symbol semantic values.
-    typedef variant<sizeof(union_type)> semantic_type;][]dnl
+    typedef variant<sizeof (union_type)> semantic_type;][]dnl
 ])
 
 
diff --git a/examples/variant-11.yy b/examples/variant-11.yy
index a9454a1e..d378f300 100644
--- a/examples/variant-11.yy
+++ b/examples/variant-11.yy
@@ -66,7 +66,7 @@
   make_string_uptr (Args&&... args)
   {
     // std::make_unique is C++14.
-    return std::unique_ptr<std::string>(new 
std::string{std::forward<Args>(args)...});
+    return string_uptr (new std::string{std::forward<Args> (args)...});
   }
 
   // Convert to string.
diff --git a/examples/variant.yy b/examples/variant.yy
index 8c7c8edd..e18929e6 100644
--- a/examples/variant.yy
+++ b/examples/variant.yy
@@ -48,7 +48,7 @@ typedef std::vector<std::string> strings_type;
     {
       o << '{';
       const char *sep = "";
-      for (strings_type::const_iterator i = ss.begin(), end = ss.end();
+      for (strings_type::const_iterator i = ss.begin (), end = ss.end ();
            i != end; ++i)
         {
           o << sep << *i;
@@ -110,7 +110,7 @@ namespace yy
   {
     static int stage = -1;
     ++stage;
-    parser::location_type loc(YY_NULLPTR, stage + 1, stage + 1);
+    parser::location_type loc (YY_NULLPTR, stage + 1, stage + 1);
     switch (stage)
       {
       case 0:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]