aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-11-08 22:47:23 +0000
committerMike Buland <eichlan@xagasoft.com>2012-11-08 22:47:23 +0000
commit795d0737fed40d88a7801b451b7750ba90802345 (patch)
treeb561a10468955d1a893a828446dbeebd225a28f6
parent8891504ae11f7ae5ed5e9eb05ec3686564617373 (diff)
downloadbuild-795d0737fed40d88a7801b451b7750ba90802345.tar.gz
build-795d0737fed40d88a7801b451b7750ba90802345.tar.bz2
build-795d0737fed40d88a7801b451b7750ba90802345.tar.xz
build-795d0737fed40d88a7801b451b7750ba90802345.zip
Fixed a few condition issues, and the install script is a little better, I think.
-rw-r--r--default.bld5
-rw-r--r--src/buildparser.cpp19
-rw-r--r--src/buildparser.h1
-rw-r--r--support/vim/syntax/build.vim4
4 files changed, 19 insertions, 10 deletions
diff --git a/default.bld b/default.bld
index cfe448e..4c71725 100644
--- a/default.bld
+++ b/default.bld
@@ -126,9 +126,12 @@ target PREFIX + "/bin/build"
126{ 126{
127 display "install"; 127 display "install";
128 tag "install"; 128 tag "install";
129 requires "build";
130 profile "build" 129 profile "build"
131 { 130 {
131 if !exists("build") then
132 {
133 build: "build";
134 }
132 execute("install -T -s build ${OUTPUT}"); 135 execute("install -T -s build ${OUTPUT}");
133 } 136 }
134} 137}
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"
6using Bu::sio; 7using 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
14BuildParser::~BuildParser() 18BuildParser::~BuildParser()
@@ -54,13 +58,14 @@ bool BuildParser::isKeyword( const Bu::String &sStr )
54 58
55bool BuildParser::isCond( const Bu::String &sStr ) 59bool 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
66void BuildParser::include( const Bu::String &sStr, void *scanner, YYLTYPE *loc ) 71void 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
36typedef void * yyscan_t; 37typedef void * yyscan_t;
diff --git a/support/vim/syntax/build.vim b/support/vim/syntax/build.vim
index 04d1f90..631db10 100644
--- a/support/vim/syntax/build.vim
+++ b/support/vim/syntax/build.vim
@@ -14,11 +14,11 @@ endif
14" Keywords 14" Keywords
15syn keyword Conditional if then else 15syn keyword Conditional if then else
16syn keyword Loop for do in 16syn keyword Loop for do in
17syn keyword Logic not and or 17syn keyword Logic and or
18syn keyword Statement include set unset function target input condition requires rule profile auto config display type default cache global value return output allow action warning error notice local continue break all export tag range open close read write 18syn keyword Statement include set unset function target input condition requires rule profile auto config display type default cache global value return output allow action warning error notice local continue break all export tag range open close read write
19syn keyword Todo TODO FIXME XXX 19syn keyword Todo TODO FIXME XXX
20syn keyword Type int string bool float version 20syn keyword Type int string bool float version
21syn keyword Constant null true false file never always important normal hidden autogenerated filetime 21syn keyword Constant null true false file never always important normal hidden autogenerated fileTime fileExists
22syn keyword Builtins files dirs matches replace regex execute unlink exists getMakeDeps toString targets fileName dirName unique 22syn keyword Builtins files dirs matches replace regex execute unlink exists getMakeDeps toString targets fileName dirName unique
23 23
24syn match TargetProcess /[a-zA-Z_][a-zA-Z0-9_]*:/he=e-1 24syn match TargetProcess /[a-zA-Z_][a-zA-Z0-9_]*:/he=e-1