bison-patches
[Top][All Lists]
Advanced

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

tests: c++: style changes


From: Akim Demaille
Subject: tests: c++: style changes
Date: Tue, 4 Sep 2018 13:47:27 +0200

Pushed in master.

commit d023679818c60a7c1b62600a68b5529b9d173695
Author: Akim Demaille <address@hidden>
Date:   Mon Sep 3 19:10:17 2018 +0200

    tests: style changes
    
    * tests/c++.at: Formatting changes.
    Use 'using' to shorten the code.

diff --git a/tests/c++.at b/tests/c++.at
index e00c5ceb..5941c0ed 100644
--- a/tests/c++.at
+++ b/tests/c++.at
@@ -142,26 +142,27 @@ exp: "int" { $$.push_back ($1); }
 
 int main()
 {
+  using yy::parser;
   // symbol_type: construction, accessor.
   {
-    yy::parser::symbol_type s = yy::parser::make_INT(12);
+    parser::symbol_type s = parser::make_INT(12);
     std::cerr << s.value.as<int>() << '\n';
   }
 
   // stack_symbol_type: construction, accessor.
   {
-    yy::parser::symbol_type s = yy::parser::make_INT(123);
-    yy::parser::stack_symbol_type ss(1, s);
+    parser::symbol_type s = parser::make_INT(123);
+    parser::stack_symbol_type ss(1, s);
     std::cerr << ss.value.as<int>() << '\n';
   }
 
   // pushing on the stack.
   {
-    yy::parser::stack_type st;
+    parser::stack_type st;
     for (int i = 0; i < 100; ++i)
       {
-        yy::parser::symbol_type s(yy::parser::make_INT(i));
-        yy::parser::stack_symbol_type ss(1, s);
+        parser::symbol_type s = parser::make_INT(123);
+        parser::stack_symbol_type ss(1, s);
         st.push(ss);
       }
   }
@@ -319,10 +320,9 @@ namespace yy
         *yylloc = location ();])[
         return parser::token::END_OF_FILE;]])[
 
-      case ',':
-        ]AT_TOKEN_CTOR_IF([[
-        return parser::make_COMMA (]AT_LOCATION_IF([location ()])[);]], [[
-]AT_LOCATION_IF([
+      case ',':]AT_TOKEN_CTOR_IF([[
+        return parser::make_COMMA (]AT_LOCATION_IF([location ()])[);]],
+[AT_LOCATION_IF([
         *yylloc = location ();])[
         return parser::token::COMMA;]])[
 




reply via email to

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