mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-24 03:33:03 +00:00
tests: style changes
* tests/c++.at (C++ Variant-based Symbols): Rename as... (C++ Variant-based Symbols Unit Tests): this. Comment/style changes.
This commit is contained in:
14
tests/c++.at
14
tests/c++.at
@@ -88,11 +88,14 @@ AT_BISON_OPTION_POPDEFS
|
|||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
## --------------------------- ##
|
## -------------------------------------- ##
|
||||||
## C++ Variant-based Symbols. ##
|
## C++ Variant-based Symbols Unit Tests. ##
|
||||||
## --------------------------- ##
|
## -------------------------------------- ##
|
||||||
|
|
||||||
AT_SETUP([C++ Variant-based Symbols])
|
# Not checking the grammar, only the variants and variant based
|
||||||
|
# symbols.
|
||||||
|
|
||||||
|
AT_SETUP([C++ Variant-based Symbols Unit Tests])
|
||||||
|
|
||||||
AT_KEYWORDS([variant])
|
AT_KEYWORDS([variant])
|
||||||
|
|
||||||
@@ -139,17 +142,20 @@ exp: "int" { $$.push_back ($1); }
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
// symbol_type: construction, accessor.
|
||||||
{
|
{
|
||||||
yy::parser::symbol_type s = yy::parser::make_INT(12);
|
yy::parser::symbol_type s = yy::parser::make_INT(12);
|
||||||
std::cerr << s.value.as<int>() << '\n';
|
std::cerr << s.value.as<int>() << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// stack_symbol_type: construction, accessor.
|
||||||
{
|
{
|
||||||
yy::parser::symbol_type s = yy::parser::make_INT(123);
|
yy::parser::symbol_type s = yy::parser::make_INT(123);
|
||||||
yy::parser::stack_symbol_type ss(1, s);
|
yy::parser::stack_symbol_type ss(1, s);
|
||||||
std::cerr << ss.value.as<int>() << '\n';
|
std::cerr << ss.value.as<int>() << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pushing on the stack.
|
||||||
{
|
{
|
||||||
yy::parser::stack_type st;
|
yy::parser::stack_type st;
|
||||||
for (int i = 0; i < 100; ++i)
|
for (int i = 0; i < 100; ++i)
|
||||||
|
|||||||
Reference in New Issue
Block a user