1 message in com.perforce.jamming[jamming] Another compatibility probl...| From | Sent On | Attachments |
|---|---|---|
| Craig McPheeters | 20 Feb 2002 19:45 |
| Subject: | [jamming] Another compatibility problem in Jam2.4![]() |
|---|---|
| From: | Craig McPheeters (cmcp...@aw.sgi.com) |
| Date: | 02/20/2002 07:45:41 PM |
| List: | com.perforce.jamming |
Hi,
In early Feb, Miklos (bo...@mac.com) reported that the syntax for 'in' changed in the current development version of Jam 2.4. His reported fix is to alter the jamgram.yy file:
< | arg `in` list to
| expr `in` expr
A second problem is with expressions like the following:
list = 1 2 3 4 ; element = 1 ;
if ! $(element) in $(list) { Echo Wrong. ; }
With Jam 2.3 the echo is not reached. With 2.4-dev, the echo is executed. If you add brackets to the example, jam 2.4 will do the right thing. The change breaks a lot of my code.
One solution is to revert that section of jamgram.yy back to an earlier style, with the extensions that 2.4 needs. The new section which is working for me is:
expr : arg { $$.parse = peval( EXPR_EXISTS, $1.parse, pnull() ); } | arg `=` arg { $$.parse = peval( EXPR_EQUALS, $1.parse, $3.parse ); } | arg `!=` arg { $$.parse = peval( EXPR_NOTEQ, $1.parse, $3.parse ); } | arg `<` arg { $$.parse = peval( EXPR_LESS, $1.parse, $3.parse ); } | arg `<=` arg { $$.parse = peval( EXPR_LESSEQ, $1.parse, $3.parse ); } | arg `>` arg { $$.parse = peval( EXPR_MORE, $1.parse, $3.parse ); } | arg `>=` arg { $$.parse = peval( EXPR_MOREEQ, $1.parse, $3.parse ); } | expr `&` expr { $$.parse = peval( EXPR_AND, $1.parse, $3.parse ); } | expr `&&` expr { $$.parse = peval( EXPR_AND, $1.parse, $3.parse ); } | expr `|` expr { $$.parse = peval( EXPR_OR, $1.parse, $3.parse ); } | expr `||` expr { $$.parse = peval( EXPR_OR, $1.parse, $3.parse ); } | arg `in` list { $$.parse = peval( EXPR_IN, $1.parse, $3.parse ); } | `!` expr { $$.parse = peval( EXPR_NOT, $2.parse, pnull() ); } | `(` expr `)` { $$.parse = $2.parse; } ;
Cheers, Craig.




