Enable parsing of the G poly source with extra parameters (e.g. m=2)

by just cutting them off.
FIXME: to be added later, probaly in the code model.
This commit is contained in:
Holger Vogt 2025-05-10 23:07:38 +02:00
parent cd22bf9b27
commit d165329dca
1 changed files with 15 additions and 0 deletions

View File

@ -298,6 +298,7 @@ static char *two2three_translate(
char **out_conn;
char **in_conn;
char **coef;
char* multibeg, *multiend, *val;
char *card;
@ -310,6 +311,20 @@ static char *two2three_translate(
/* Put the first character into local storage for checking type */
type = *orig_card;
/* There may be a multiplier m=val
Remove it here, add it later */
multibeg = strstr(orig_card, " m=");
if (multibeg) {
*multibeg = '\0';
/*
multiend = multibeg + 3;
while (*multiend == ' ')
multiend++;
while (*multiend && *multiend != ' ')
multiend++;
*/
}
/* Count the number of tokens for use in parsing */
num_tokens = count_tokens(orig_card);