Free Hero Mesh

Check-in [563de83a02]
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.
Overview
Comment:Fix {edit <number>} so that it replaces the entire argument if it begins with an opening delimiter ("{" or "(").
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 563de83a02e715ca9805bd673b7ce51652025eca
User & Date: user on 2023-03-31 17:21:01
Other Links: manifest | tags
Context
2023-04-28
18:02
Begin to implement multibyte character codes (it is not enough to be used, so far) check-in: 9087ab7896 user: user tags: trunk
2023-03-31
17:21
Fix {edit <number>} so that it replaces the entire argument if it begins with an opening delimiter ("{" or "("). check-in: 563de83a02 user: user tags: trunk
2023-03-29
23:50
Implement CONFIG_OMIT_INCLUDE check-in: c3370d4109 user: user tags: trunk
Changes

Modified class.c from [32f95c9ffe] to [0574e75b7a].

1054
1055
1056
1057
1058
1059
1060
1061






1062
1063
1064
1065
1066
1067
1068
1054
1055
1056
1057
1058
1059
1060

1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073







-
+
+
+
+
+
+







          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);
            if(macstack->args[n]->t&(TF_MACRO|TF_EOF)) ParseError("Invalid edit token\n");
            if(macstack->args[n]->t&TF_OPEN) {
              free_macro(macstack->args[n]->next);
              macstack->args[n]->next=0;
            } else if(macstack->args[n]->t&TF_EOF) {
              ParseError("Invalid edit token\n");
            }
            free(macstack->args[n]->str);
            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");

Modified class.doc from [33a36637f2] to [ec268e12e1].

183
184
185
186
187
188
189
190
191



192
193
194
195
196
197
198
183
184
185
186
187
188
189


190
191
192
193
194
195
196
197
198
199







-
-
+
+
+







  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
  (which must not be another macro) to the specified token. The token is
  expanded, and must be a single token once it is expanded; that is what it
  will be replaced with. There is a variant with a number in place of a
  string; this will replace the argument of the macro which is currently
  being expanded.
  string; this will replace the first token of the argument of the macro
  which is currently being expanded (or the entire token if it starts with
  an opening delimiter).

{include <string>}
  Include text from another file into this one. You cannot use {include}
  inside of another macro or in a macro argument. The file must be in the
  current directory, and its name must contain only letters, digits, dot,
  underscore, and minus signs, and must start with a letter or digit. If
  it is a composite puzzle set, then the name must end with ".include",