diff options
Diffstat (limited to '')
-rw-r--r-- | src/buildparser.cpp | 19 | ||||
-rw-r--r-- | src/buildparser.h | 1 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/buildparser.cpp b/src/buildparser.cpp index f5c3132..cf98090 100644 --- a/src/buildparser.cpp +++ b/src/buildparser.cpp | |||
@@ -1,6 +1,7 @@ | |||
1 | #include "buildparser.h" | 1 | #include "buildparser.h" |
2 | #include "ast.h" | 2 | #include "ast.h" |
3 | #include "build.yy.h" | 3 | #include "build.yy.h" |
4 | #include "conditionplugger.h" | ||
4 | 5 | ||
5 | #include "bu/sio.h" | 6 | #include "bu/sio.h" |
6 | using Bu::sio; | 7 | using Bu::sio; |
@@ -9,6 +10,9 @@ BuildParser::BuildParser( Ast &rAst ) : | |||
9 | xAst( rAst ) | 10 | xAst( rAst ) |
10 | { | 11 | { |
11 | lIncludePaths.append("./"); | 12 | lIncludePaths.append("./"); |
13 | StrList lConds = ConditionPlugger::getInstance().getPluginList(); | ||
14 | for( StrList::iterator i = lConds.begin(); i; i++ ) | ||
15 | hConds.insert( *i, true ); | ||
12 | } | 16 | } |
13 | 17 | ||
14 | BuildParser::~BuildParser() | 18 | BuildParser::~BuildParser() |
@@ -54,13 +58,14 @@ bool BuildParser::isKeyword( const Bu::String &sStr ) | |||
54 | 58 | ||
55 | bool BuildParser::isCond( const Bu::String &sStr ) | 59 | bool BuildParser::isCond( const Bu::String &sStr ) |
56 | { | 60 | { |
57 | if( sStr == "filetime" ) | 61 | try |
58 | return true; | 62 | { |
59 | if( sStr == "always" ) | 63 | return hConds.get( sStr ); |
60 | return true; | 64 | } |
61 | if( sStr == "never" ) | 65 | catch(...) |
62 | return true; | 66 | { |
63 | return false; | 67 | return false; |
68 | } | ||
64 | } | 69 | } |
65 | 70 | ||
66 | void BuildParser::include( const Bu::String &sStr, void *scanner, YYLTYPE *loc ) | 71 | void BuildParser::include( const Bu::String &sStr, void *scanner, YYLTYPE *loc ) |
diff --git a/src/buildparser.h b/src/buildparser.h index 7e6e348..53e2a50 100644 --- a/src/buildparser.h +++ b/src/buildparser.h | |||
@@ -31,6 +31,7 @@ private: | |||
31 | Bu::Stack<Bu::String> sFilename; | 31 | Bu::Stack<Bu::String> sFilename; |
32 | Bu::Stack<YYLTYPE> sLocation; | 32 | Bu::Stack<YYLTYPE> sLocation; |
33 | StrList lIncludePaths; | 33 | StrList lIncludePaths; |
34 | Bu::Hash<Bu::String, bool> hConds; | ||
34 | }; | 35 | }; |
35 | 36 | ||
36 | typedef void * yyscan_t; | 37 | typedef void * yyscan_t; |