From 15233a37288b7e40b5004bee04ce665ee9f9b926 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 26 Aug 2018 07:55:45 +0200 Subject: [PATCH] tests: style changes * tests/c++.at (C++ Variant-based Symbols): Rename as... (C++ Variant-based Symbols Unit Tests): this. Comment/style changes. --- tests/c++.at | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/c++.at b/tests/c++.at index 25f489e8..e00c5ceb 100644 --- a/tests/c++.at +++ b/tests/c++.at @@ -88,11 +88,14 @@ AT_BISON_OPTION_POPDEFS 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]) @@ -115,7 +118,7 @@ AT_DATA_GRAMMAR([list.y], } %token INT "int" -%type < std::vector > exp +%type > exp %printer { yyo << $$; } %printer @@ -126,7 +129,7 @@ AT_DATA_GRAMMAR([list.y], yyo << ", "; yyo << *i; } - } < std::vector > + } > %code requires { #include } %code { int yylex (yy::parser::semantic_type* yylval); } @@ -139,17 +142,20 @@ exp: "int" { $$.push_back ($1); } int main() { + // symbol_type: construction, accessor. { yy::parser::symbol_type s = yy::parser::make_INT(12); std::cerr << s.value.as() << '\n'; } + // stack_symbol_type: construction, accessor. { yy::parser::symbol_type s = yy::parser::make_INT(123); yy::parser::stack_symbol_type ss(1, s); std::cerr << ss.value.as() << '\n'; } + // pushing on the stack. { yy::parser::stack_type st; for (int i = 0; i < 100; ++i)