Overview
Comment: | Add the variant of the {edit} macro to edit an argument of a macro which is currently being expanded. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
0548d34afe1a2755f9bb0aa0213f6c5f |
User & Date: | user on 2023-03-29 03:22:33 |
Other Links: | manifest | tags |
Context
2023-03-29
| ||
19:48 | Allow arguments to numeric arithmetic/bitwise macros to be directions and keys as well as numbers. check-in: ee285414da user: user tags: trunk | |
03:22 | Add the variant of the {edit} macro to edit an argument of a macro which is currently being expanded. check-in: 0548d34afe user: user tags: trunk | |
2023-03-14
| ||
20:53 | Optimize message blocks that begin with a goto instruction to a label that comes before it. check-in: 7cde381dd5 user: user tags: trunk | |
Changes
Modified class.c from [f3693b1dc0] to [16b649f4e6].
︙ | |||
1043 1044 1045 1046 1047 1048 1049 | 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 | + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + | nxttok(); if(!(tokent&TF_NAME) || tokenv!=OP_STRING) ParseError("String literal expected\n"); define_macro(look_hash_mac(),0); goto again; case MAC_EDIT: if(!macros) ParseError("Cannot edit nonexistent macro\n"); nxttok(); if(tokent==TF_INT) { if(!macstack) ParseError("Empty macro stack\n"); n=tokenv-1; nxttok(); if(n<0 || macstack->n<=n || !macstack->args[n]) ParseError("Cannot edit nonexistent argument %u\n",n+1); macstack->args[n]->t=tokent; macstack->args[n]->v=tokenv; macstack->args[n]->str=0; if(*tokenstr) { macstack->args[n]->str=strdup(tokenstr); if(!macstack->args[n]->str) fatal("Allocation failed\n"); } } else { |
︙ |
Modified class.doc from [c34c71c5cb] to [f144cf4bb5].
︙ | |||
180 181 182 183 184 185 186 | 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | - - - + + + + + | expanded during each use. A macro argument token with a single backslash expands to the argument in that position, while a macro argument tokens with multiple tokens becomes the token with one less backslash. It is permitted to redefine existing macros as well as new ones. {edit <string> <token>} Edit a macro. This changes the first token of the definition of the macro |
︙ |