aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/lexer.cxx6
-rw-r--r--build/parser.cxx7
2 files changed, 6 insertions, 7 deletions
diff --git a/build/lexer.cxx b/build/lexer.cxx
index 0835704..f6e34cb 100644
--- a/build/lexer.cxx
+++ b/build/lexer.cxx
@@ -351,7 +351,8 @@ namespace build
bool lexer::
skip_spaces ()
{
- bool r (false);
+ bool r (sep_);
+ sep_ = false;
xchar c (peek ());
bool start (c.column == 1);
@@ -407,9 +408,6 @@ namespace build
get ();
}
- r = r || sep_;
- sep_ = false;
-
return r;
}
diff --git a/build/parser.cxx b/build/parser.cxx
index 1c8f4f6..e238628 100644
--- a/build/parser.cxx
+++ b/build/parser.cxx
@@ -1041,7 +1041,7 @@ namespace build
{
const string& n (t.value);
- if (!t.quoted && (n == "else" || n == "elif" || n == "elif!"))
+ if (n == "else" || n == "elif" || n == "elif!")
continue;
}
@@ -1806,7 +1806,7 @@ namespace build
// potential keyword if:
//
// - it is not quoted [so a keyword can always be escaped] and
- // - next token is eos or '(' [so if(...) will work] or
+ // - next token is '\n' (or eos) or '(' [so if(...) will work] or
// - next token is separated and is not '=', '=+', or '+=' [which
// means a "directive trailer" can never start with one of them].
//
@@ -1820,7 +1820,8 @@ namespace build
pair<char, bool> p (lexer_->peek_char ());
char c (p.first);
- return c == '\0' || c == '(' || (p.second && c != '=' && c != '+');
+ return c == '\n' || c == '\0' || c == '(' ||
+ (p.second && c != '=' && c != '+');
}
return false;