aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/lexer
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-11-04 08:47:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:26 +0200
commit3eb0cd7fe3c1dec0bb3b7e1d225107e55ca4b435 (patch)
treef7c06695b1c8974ab0b4777b416db7343f5ebbae /build2/test/script/lexer
parent1270101f4267ecd187bb604190d004daaae341b7 (diff)
Various testscript lexer/parser fixes (testscript)
Diffstat (limited to 'build2/test/script/lexer')
-rw-r--r--build2/test/script/lexer13
1 files changed, 6 insertions, 7 deletions
diff --git a/build2/test/script/lexer b/build2/test/script/lexer
index 5d77ab9..d79ef78 100644
--- a/build2/test/script/lexer
+++ b/build2/test/script/lexer
@@ -25,8 +25,8 @@ namespace build2
enum
{
script_line = base_type::value_next,
+ assign_line, // Auto-expires at the end of the token.
variable_line, // Auto-expires at the end of the line.
- test_line,
command_line,
here_line
};
@@ -46,14 +46,13 @@ namespace build2
virtual void
mode (base_mode, char = '\0') override;
- // Return true if we entered the quoted (double or single) mode since
- // last reset.
+ // Number of quoted (double or single) tokens since last reset.
//
- bool
+ size_t
quoted () const {return quoted_;}
void
- reset_quoted (bool q) {quoted_ = q;}
+ reset_quoted (size_t q) {quoted_ = q;}
protected:
virtual token
@@ -63,10 +62,10 @@ namespace build2
next_line ();
virtual token
- word (bool) override;
+ word (state, bool) override;
protected:
- bool quoted_ = false;
+ size_t quoted_;
};
}
}