Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64297 - trunk/tools/build/v2/engine/src
From: ghost_at_[hidden]
Date: 2010-07-23 08:20:23


Author: vladimir_prus
Date: 2010-07-23 08:20:22 EDT (Fri, 23 Jul 2010)
New Revision: 64297
URL: http://svn.boost.org/trac/boost/changeset/64297

Log:
Fix calling Python function taking zero parameters.

Text files modified:
   trunk/tools/build/v2/engine/src/compile.c | 11 +++++++++--
   1 files changed, 9 insertions(+), 2 deletions(-)

Modified: trunk/tools/build/v2/engine/src/compile.c
==============================================================================
--- trunk/tools/build/v2/engine/src/compile.c (original)
+++ trunk/tools/build/v2/engine/src/compile.c 2010-07-23 08:20:22 EDT (Fri, 23 Jul 2010)
@@ -534,8 +534,15 @@
     inner->prev_user = frame->module->user_module ? frame : frame->prev_user;
     inner->module = frame->module; /* This gets fixed up in evaluate_rule(), below. */
     inner->procedure = parse;
- for ( p = parse->left; p; p = p->left )
- lol_add( inner->args, parse_evaluate( p->right, frame ) );
+ /* Special-case LOL of length 1 where the first list is totally empty.
+ This is created when calling functions with no parameters, due to
+ the way jam grammar is written. This is OK when one jam function
+ calls another, but really not good when Jam function calls Python. */
+ if ( parse->left->left == NULL && parse->left->right->func == compile_null)
+ ;
+ else
+ for ( p = parse->left; p; p = p->left )
+ lol_add( inner->args, parse_evaluate( p->right, frame ) );
 
     /* And invoke the rule. */
     result = evaluate_rule( parse->string, inner );


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk