From 36db78a733e62897a6a91b7c9efc2245027712f3 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 9 Aug 2008 14:59:34 +0200 Subject: [PATCH] Update the variant example. * examples/variant.yy: Formatting changes. One stage build. --- ChangeLog | 6 ++++++ examples/variant.yy | 9 ++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index cba6f7c1..a1403add 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-10 Akim Demaille + + Update the variant example. + * examples/variant.yy: Formatting changes. + One stage build. + 2008-11-10 Akim Demaille Support constructor with an argument. diff --git a/examples/variant.yy b/examples/variant.yy index d560e7dd..74fb1092 100644 --- a/examples/variant.yy +++ b/examples/variant.yy @@ -90,18 +90,17 @@ yylex (yy::parser::semantic_type* yylval) switch (stage) { case 0: - yylval->build () = - std::string ("I have three numbers for you."); + yylval->build (std::string ("I have three numbers for you.")); result = yy::parser::token::TEXT; break; case 1: case 2: case 3: - yylval->build () = stage; + yylval->build (stage); result = yy::parser::token::NUMBER; break; case 4: - yylval->build () = std::string ("And that's all!"); + yylval->build (std::string ("And that's all!")); result = yy::parser::token::TEXT; break; default: @@ -126,7 +125,7 @@ main (int argc, char *argv[]) { yy::parser p; p.set_debug_level (!!getenv ("YYDEBUG")); - p.parse (); + return p.parse(); } // Local Variables: -- 2.47.2