From 63fe26fa228fab1286f8632efe5e93ce6960bfcb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Nov 2016 08:44:03 +0200 Subject: Add variable lookup hook to parser --- build2/parser | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'build2/parser') diff --git a/build2/parser b/build2/parser index bb6bc17..a5d39d3 100644 --- a/build2/parser +++ b/build2/parser @@ -91,12 +91,13 @@ namespace build2 if_else (token&, token_type&); void - variable (token&, token_type&, const variable_type&, token_type kind); + parse_variable (token&, token_type&, const variable_type&, token_type); string variable_name (names_type&&, const location&); - // Note: calls attributes_push() that the caller must pop. + // Note: calls attributes_push() that the caller must pop. Also expects + // the mode to auto-expire. // value variable_value (token&, token_type&, lexer_mode = lexer_mode::value); @@ -233,6 +234,12 @@ namespace build2 buildspec buildspec_clause (token&, token_type&, token_type end); + // Customization hooks. + // + protected: + virtual lookup + lookup_variable (name&& qual, string&& name, const location&); + // Utilities. // protected: -- cgit v1.1