- if (c != '%')
- {
- if (c == '\n')
- ++line;
- obstack_1grow (oout, c);
- c = getc (fskel);
- }
- else if ((c = getc (fskel)) == '%')
- {
- /* Read the muscle. */
- const char *muscle_key = 0;
- const char *muscle_value = 0;
-
- while (isalnum (c = getc (fskel)) || c == '_')
- obstack_1grow (&muscle_obstack, c);
- obstack_1grow (&muscle_obstack, 0);
-
- /* Output the right value, or see if it's something special. */
- muscle_key = obstack_finish (&muscle_obstack);
- muscle_value = muscle_find (muscle_key);
- if (muscle_value)
- obstack_sgrow (oout, muscle_value);
- else if (!strcmp (muscle_key, "line"))
- obstack_fgrow1 (oout, "%d", line + 1);
- else if (!strcmp (muscle_key, "input_line"))
- obstack_fgrow1 (oout, "%d", lineno);
- /* FIXME: Insert the code to recognize %%sub-skeleton for exemple. */
- else
- {
- obstack_sgrow (oout, "%%");
- obstack_sgrow (oout, muscle_key);
- }
- }
- else
- obstack_1grow (oout, '%');