aboutsummaryrefslogtreecommitdiff
path: root/build/parser
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-03 11:04:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-03 11:08:08 +0200
commit772b1e013bb0068d7347d0bbe2ff73c67358ee1b (patch)
tree8d7bdd8999ed62db77015e60d6115eb6ff235912 /build/parser
parentbecea217436a79b7ef37a023da6cb4c560225a71 (diff)
Implement if-else conditions
if if! elif elif! else The expression should evaluate to true of false. The if! and elif! versions are provided as shortcuts to writing if (!...). See tests/if-else for examples.
Diffstat (limited to 'build/parser')
-rw-r--r--build/parser13
1 files changed, 13 insertions, 0 deletions
diff --git a/build/parser b/build/parser
index 4390c67..ca27890 100644
--- a/build/parser
+++ b/build/parser
@@ -75,6 +75,9 @@ namespace build
define (token&, token_type&);
void
+ if_else (token&, token_type&);
+
+ void
variable (token&, token_type&, std::string name, token_type kind);
std::string
@@ -115,6 +118,16 @@ namespace build
const dir_path* dir,
const std::string* type);
+ // Skip until newline or eos.
+ //
+ void
+ skip_line (token&, token_type&);
+
+ // Skip until block-closing } or eos, taking into account nested blocks.
+ //
+ void
+ skip_block (token&, token_type&);
+
// Buildspec.
//
buildspec