-| "%code" braceless { prologue_augment ($2, @2, true); }
-| "%code-top" braceless { prologue_augment ($2, @2, false); }
-| "%provides" braceless { muscle_code_grow ("provides", $2, @2); }
-| "%requires" braceless { muscle_code_grow ("requires", $2, @2); }
+| "%code" braceless
+ {
+ muscle_code_grow ("percent_code", $2, @2);
+ code_scanner_last_string_free ();
+ }
+| "%code" STRING braceless
+ {
+ /* FIXME: Special characters in $2 may break %code.
+ For example: `['. */
+ char const name_prefix[] = "percent_code_";
+ char *name = xmalloc (sizeof name_prefix + strlen ($2));
+ strcpy (name, name_prefix);
+ strcpy (name + sizeof name_prefix - 1, $2);
+ muscle_code_grow (uniqstr_new (name), $3, @3);
+ free (name);
+ code_scanner_last_string_free ();
+ muscle_grow_user_name_list ("user_percent_code_qualifiers", $2, @2);
+ }