From 772b1e013bb0068d7347d0bbe2ff73c67358ee1b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 3 Dec 2015 11:04:48 +0200 Subject: 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. --- build/parser | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'build/parser') 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 -- cgit v1.1