diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-10-20 15:33:39 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 09:26:33 +0200 |
commit | ea9d28c0e5fe16d5a0ade210f40cb98ea191d318 (patch) | |
tree | a7a3bc27a258d476d28220bcf0e6b7932f42d622 /build2/parser.cxx | |
parent | cf4af1e966c5f005d5cb4b4080a9e11c106982bd (diff) |
Use special mode for attribute lexing
Diffstat (limited to 'build2/parser.cxx')
-rw-r--r-- | build2/parser.cxx | 12 |
1 files changed, 3 insertions, 9 deletions
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; |