c++: comment and style changes

* data/c++.m4, data/lalr1.cc: More documentation.
Tidy.
* tests/c++.at (string_cast): Rename as...
(to_string): this C++11 name.
This commit is contained in:
Akim Demaille
2015-01-08 09:15:10 +01:00
parent 7cf84b13a0
commit 8a4ec3595b
3 changed files with 16 additions and 12 deletions

View File

@@ -232,7 +232,7 @@ typedef std::list<std::string> strings_type;
template <typename T>
inline
std::string
string_cast (const T& t)
to_string (const T& t)
{
std::ostringstream o;
o << t;
@@ -266,7 +266,7 @@ list:
item:
TEXT { std::swap ($$,$][1); }
| NUMBER { if ($][1 == 3) YYERROR; else $$ = string_cast ($][1); }
| NUMBER { if ($][1 == 3) YYERROR; else $$ = to_string ($][1); }
;
%%
]AT_TOKEN_CTOR_IF([],
@@ -304,8 +304,8 @@ namespace yy
}
else
{]AT_TOKEN_CTOR_IF([[
return parser::make_TEXT (string_cast (stage)]AT_LOCATION_IF([, location ()])[);]], [[
yylval->BUILD (std::string, string_cast (stage));]AT_LOCATION_IF([
return parser::make_TEXT (to_string (stage)]AT_LOCATION_IF([, location ()])[);]], [[
yylval->BUILD (std::string, to_string (stage));]AT_LOCATION_IF([
*yylloc = location ();])[
return parser::token::TEXT;]])[
}