# HG changeset patch # User Jaroslav Hajek # Date 1213952938 -7200 # Node ID 82218ced29ce288a764dc7d4c14def64d5951d0d # Parent 0280a546622c42bf60fb8a2839297691996359dd [mq]: genprops.awk.diff diff --git a/src/genprops.awk b/src/genprops.awk --- a/src/genprops.awk +++ b/src/genprops.awk @@ -465,9 +465,11 @@ { dval = defval[i]; if (type[i] == "radio_property" || type[i] == "color_property") - dval = gensub (/^.*\{(.*)\}.*$/, "\"\\1\"", "g", dval); - if (! dval) - dval = "octave_value ()"; + if (match (dval, /^.*\{(.*)\}.*$/, res)) + dval = "\"" + res[1] + "\""; + else + dval = "octave_value ()"; + printf (" m[\"%s\"] = %s%s;\n", name[i], dval, (type[i] == "handle_property" ? ".as_octave_value ()" : "")) >> filename; } @@ -490,7 +492,8 @@ /BEGIN_PROPERTIES\(.*\)/ { gather = 1; idx = 0; - class_name = gensub (/^.*BEGIN_PROPERTIES\((.*)\)/, "\\1", "g"); + if (match ($0, /^.*BEGIN_PROPERTIES\((.*)\)/, res)) + class_name = res[1]; next; }