Add a "tclesc[ape]" variant of hlistprop / tcl{,list,esc,escape}
And use it in gumxml.tcl
This commit is contained in:
@ -3593,7 +3593,10 @@ static int ListSICSHdbProperty(SConnection * pCon, SicsInterp * pSics,
|
|||||||
SCWrite(pCon, "ERROR: need path as parameter", eError);
|
SCWrite(pCon, "ERROR: need path as parameter", eError);
|
||||||
return 0;
|
return 0;
|
||||||
} else if (argc == 3) {
|
} else if (argc == 3) {
|
||||||
|
if (strncasecmp(argv[2], "tcl", 3) == 0)
|
||||||
genTclList = 1;
|
genTclList = 1;
|
||||||
|
if (strncasecmp(argv[2], "tclesc", 6) == 0)
|
||||||
|
genTclList |= 2;
|
||||||
}
|
}
|
||||||
targetNode = FindHdbNode(NULL, argv[1], pCon);
|
targetNode = FindHdbNode(NULL, argv[1], pCon);
|
||||||
if (targetNode == NULL) {
|
if (targetNode == NULL) {
|
||||||
@ -3613,7 +3616,7 @@ static int ListSICSHdbProperty(SConnection * pCon, SicsInterp * pSics,
|
|||||||
DynStringConcatChar(data, ' ');
|
DynStringConcatChar(data, ' ');
|
||||||
DynStringConcatChar(data, '{');
|
DynStringConcatChar(data, '{');
|
||||||
for (bp = buffer; *bp; ++bp) {
|
for (bp = buffer; *bp; ++bp) {
|
||||||
if (*bp == '{' || *bp == '}')
|
if (genTclList & 2 && (*bp == '{' || *bp == '}'))
|
||||||
DynStringConcatChar(data, '\\');
|
DynStringConcatChar(data, '\\');
|
||||||
DynStringConcatChar(data, *bp);
|
DynStringConcatChar(data, *bp);
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ proc make_nodes {path result indent} {
|
|||||||
set prefix [string repeat " " $indent]
|
set prefix [string repeat " " $indent]
|
||||||
set newIndent [expr $indent + 2]
|
set newIndent [expr $indent + 2]
|
||||||
set control "true"
|
set control "true"
|
||||||
foreach {key rvalue} [string map {= " "} [hlistprop $path tcl]] {
|
foreach {key rvalue} [string map {= " "} [hlistprop $path tclescape]] {
|
||||||
set value [encode $rvalue]
|
set value [encode $rvalue]
|
||||||
if {[string compare -nocase $key "control"] == 0} {
|
if {[string compare -nocase $key "control"] == 0} {
|
||||||
if {[string compare -nocase $value "false"] == 0} {
|
if {[string compare -nocase $value "false"] == 0} {
|
||||||
@ -82,7 +82,7 @@ proc make_nodes {path result indent} {
|
|||||||
|
|
||||||
proc property_elements {path indent} {
|
proc property_elements {path indent} {
|
||||||
set prefix [string repeat " " $indent]
|
set prefix [string repeat " " $indent]
|
||||||
foreach {key rvalue} [string map {= " "} [hlistprop $path tcl]] {
|
foreach {key rvalue} [string map {= " "} [hlistprop $path tclescape]] {
|
||||||
set value [encode $rvalue]
|
set value [encode $rvalue]
|
||||||
if {[string compare -nocase $key "control"] == 0} {continue}
|
if {[string compare -nocase $key "control"] == 0} {continue}
|
||||||
lappend proplist "$prefix<property id=\"$key\">\n"
|
lappend proplist "$prefix<property id=\"$key\">\n"
|
||||||
|
Reference in New Issue
Block a user