From ea9d28c0e5fe16d5a0ade210f40cb98ea191d318 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 20 Oct 2016 15:33:39 +0200 Subject: Use special mode for attribute lexing --- build2/parser.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'build2/parser.cxx') diff --git a/build2/parser.cxx b/build2/parser.cxx index 64907b4..341ba34 100644 --- a/build2/parser.cxx +++ b/build2/parser.cxx @@ -1836,12 +1836,12 @@ namespace build2 // Using '@' for attribute key-value pairs would be just too ugly. Seeing // that we control what goes into keys/values, let's use a much nicer '='. // - mode (lexer_mode::value, '='); + mode (lexer_mode::attribute, '='); next (t, tt); - if (tt != type::rsbrace && tt != type::newline && tt != type::eos) + if (tt != type::rsbrace) { - names ns (parse_names (t, tt, false, "key-value", nullptr)); + names ns (parse_names (t, tt, false, "attribute", nullptr)); if (!pre_parse_) { @@ -1880,12 +1880,6 @@ namespace build2 } } - // Manually expire the value mode if we haven't reached newline/eos (where - // it expires automatically). - // - if (mode () == lexer_mode::value) - expire_mode (); - if (tt != type::rsbrace) fail (t) << "expected ']' instead of " << t; -- cgit v1.1