Ticket #2552: bjam-param.patch

File bjam-param.patch, 1.6 KB (added by Jonathan Biggar <jon@…>, 14 years ago)

Patch to add support for rule parameters 10-19

Line 
1==== tools/jam/src/expand.c#1 (text) - tools/jam/src/expand.c#3 (text) ==== content
2@@ -113,6 +113,24 @@
3 return list_copy( l, lol_get( lol, in[2]-'1' ) );
4 }
5 }
6+ else if ( in[0] == '$' && in[1] == '(' && in[2] == '1' && in[4] == ')' &&
7+ in[5] == '\0') {
8+
9+ switch( in[3] )
10+ {
11+ case '0':
12+ case '1':
13+ case '2':
14+ case '3':
15+ case '4':
16+ case '5':
17+ case '6':
18+ case '7':
19+ case '8':
20+ case '9':
21+ return list_copy( l, lol_get( lol, in[3]-'0'+10-1 ) );
22+ }
23+ }
24
25 /* Expand @() files, to single item plus accompanying file. */
26
27@@ -368,6 +386,9 @@
28 value = lol_get( lol, 1 );
29 else if( varname[0] >= '1' && varname[0] <= '9' && !varname[1] )
30 value = lol_get( lol, varname[0] - '1' );
31+ else if( varname[0] == '1' && varname[1] >= '0' &&
32+ varname[1] <= '9' && !varname[2] )
33+ value = lol_get( lol, varname[1] - '0' + 10 - 1 );
34 else
35 value = var_get( varname );
36
37==== tools/jam/src/lists.h#1 (text) - tools/jam/src/lists.h#2 (text) ==== content
38@@ -63,7 +63,7 @@
39
40 typedef struct _lol LOL;
41
42-# define LOL_MAX 9
43+# define LOL_MAX 19
44
45 struct _lol {
46 int count;
47
48==== tools/jam/test/test.jam#1 (text) - tools/jam/test/test.jam#2 (text) ==== content
49@@ -50,6 +50,7 @@
50 include option_n.jam ;
51 include parallel_actions.jam ;
52 include parallel_multifile_actions.jam ;
53+include rule_param.jam ;
54 include stress_var_expand.jam ;
55 include target_var.jam ;
56 include var_expand.jam ;