mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
style: don't use std::endl
* data/lalr1.cc, doc/bison.texi, etc/bench.pl.in, examples/variant.yy, * tests/actions.at, tests/atlocal.in, tests/c++.at, tests/headers.at, * tests/local.at, tests/types.at: Don't use std::endl, it flushes uselessly, and is considered bad style.
This commit is contained in:
26
tests/c++.at
26
tests/c++.at
@@ -49,7 +49,7 @@ check (const T& in, const std::string& s)
|
||||
os << in;
|
||||
if (os.str () != s)
|
||||
{
|
||||
std::cerr << "fail: " << os.str () << ", expected: " << s << std::endl;
|
||||
std::cerr << "fail: " << os.str () << ", expected: " << s << '\n';
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -140,13 +140,13 @@ int main()
|
||||
{
|
||||
{
|
||||
yy::parser::symbol_type s = yy::parser::make_INT(12);
|
||||
std::cerr << s.value.as<int>() << std::endl;
|
||||
std::cerr << s.value.as<int>() << '\n';
|
||||
}
|
||||
|
||||
{
|
||||
yy::parser::symbol_type s = yy::parser::make_INT(123);
|
||||
yy::parser::stack_symbol_type ss(1, s);
|
||||
std::cerr << ss.value.as<int>() << std::endl;
|
||||
std::cerr << ss.value.as<int>() << '\n';
|
||||
}
|
||||
|
||||
{
|
||||
@@ -268,7 +268,7 @@ typedef std::vector<std::string> strings_type;
|
||||
%%
|
||||
|
||||
result:
|
||||
list { std::cout << $][1 << std::endl; }
|
||||
list { std::cout << $][1 << '\n'; }
|
||||
;
|
||||
|
||||
list:
|
||||
@@ -504,7 +504,7 @@ void
|
||||
]$1[::parser::error (const ]$1[::parser::location_type &loc,
|
||||
const std::string &msg)
|
||||
{
|
||||
std::cerr << "At " << loc << ": " << msg << std::endl;
|
||||
std::cerr << "At " << loc << ": " << msg << '\n';
|
||||
}
|
||||
|
||||
]AT_MAIN_DEFINE[
|
||||
@@ -572,7 +572,7 @@ AT_DATA_GRAMMAR([[input.y]],
|
||||
%nonassoc 'a' ;
|
||||
|
||||
%destructor {
|
||||
std::cerr << "Discarding 'a'." << std::endl;
|
||||
std::cerr << "Discarding 'a'.\n";
|
||||
} 'a'
|
||||
|
||||
%%
|
||||
@@ -581,7 +581,7 @@ start: error-reduce consistent-error 'a' { USE ($3); };
|
||||
|
||||
error-reduce:
|
||||
'a' 'a' consistent-error 'a' { USE (($1, $2, $4)); }
|
||||
| 'a' error { std::cerr << "Reducing 'a'." << std::endl; USE ($1); }
|
||||
| 'a' error { std::cerr << "Reducing 'a'.\n"; USE ($1); }
|
||||
;
|
||||
|
||||
consistent-error:
|
||||
@@ -605,7 +605,7 @@ yylex (yy::parser::semantic_type *)
|
||||
void
|
||||
yy::parser::error (const std::string &m)
|
||||
{
|
||||
std::cerr << m << std::endl;
|
||||
std::cerr << m << '\n';
|
||||
}
|
||||
|
||||
]AT_MAIN_DEFINE[
|
||||
@@ -651,7 +651,7 @@ start:
|
||||
;
|
||||
|
||||
thing:
|
||||
error { std::cerr << "caught error" << std::endl; }
|
||||
error { std::cerr << "caught error\n"; }
|
||||
| item
|
||||
;
|
||||
|
||||
@@ -681,7 +681,7 @@ yylex (yy::parser::semantic_type *)
|
||||
void
|
||||
yy::parser::error (const std::string &m)
|
||||
{
|
||||
std::cerr << "error: " << m << std::endl;
|
||||
std::cerr << "error: " << m << '\n';
|
||||
}
|
||||
]AT_MAIN_DEFINE[
|
||||
]])
|
||||
@@ -797,7 +797,7 @@ $1
|
||||
std::cerr << sep << *i;
|
||||
sep = ", ";
|
||||
}
|
||||
std::cerr << " }" << std::endl;
|
||||
std::cerr << " }\n";
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -929,11 +929,11 @@ main (int argc, const char *argv[])
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "exception caught: " << e.what () << std::endl;
|
||||
std::cerr << "exception caught: " << e.what () << '\n';
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cerr << "unknown exception caught" << std::endl;
|
||||
std::cerr << "unknown exception caught\n";
|
||||
}
|
||||
Object::log (YY_NULLPTR, "end");
|
||||
assert (Object::empty());
|
||||
|
||||
Reference in New Issue
Block a user