this.node = node;
this.doubleStringProps = doubleStringProps;
this.pad = pad;
+ this.node.node_pad = pad;
//this.els = new Gee.ArrayList<string>();
//this.ar_props = new Gee.HashMap<string,string>();
public string munge ( )
{
//return this.mungeToString(this.node);
-
+ if (this.node.as_source_version > 0 &&
+ this.node.as_source_version == this.node.updated_count
+ && this.node.as_source != ""
+ ) {
+ return this.node.as_source;
+ }
this.checkChildren();
this.readProps();
//}
this.mungeOut();
+
+ this.node.as_source_version = this.node.updated_count;
+ this.node.as_source == this.ret;
return this.ret;
+
}
/**
var spad = this.pad.substring(0, this.pad.length-indent);
if (this.node.props.has_key("* xinclude")) {
- this.addLine("Roo.apply(" + this.node.props.get("* xinclude") + "._tree(), {",0 );
+ this.addLine("Roo.apply(" + this.node.props.get("* xinclude").val + "._tree(), {",0 );
} else {
this.addLine("{", 0);
// output xns / xtype first..
if (this.out_props.has_key("xtype")) {
var v = this.out_props.get("xtype");
+
this.node.setLine(this.cur_line, "p","xtype");
this.addLine(this.pad + "xtype" + " : " + v + suffix, ',');
}
var v = this.out_props.get(k);
this.node.setLine(this.cur_line, "p",k);
+
this.addLine(this.pad + k + " : " + v + suffix, ',');
-
- this.node.setLine(this.cur_line, "e", "");
+
+ this.node.setLine(this.cur_line, "e", k);
}
var k = iter.get();
var v = this.out_listeners.get(k);
+
this.node.setLine(this.cur_line, "l",k); //listener
this.addLine(this.pad + indent_str + k + " : " + v , ',');
- this.node.setLine(this.cur_line, "e", "");
+
+ this.node.setLine(this.cur_line, "x", k);
}
this.closeLine();
if (this.out_props.has_key("xns")) {
var v = this.out_props.get("xns");
+
this.node.setLine(this.cur_line, "p","xns");
this.addLine(this.pad + "xns" + " : " + v + suffix, ',');
this.node.setLine(this.cur_line, "p","| xns");
this.addLine(this.pad + "'|xns' : '" + v + "'", ',');
- this.node.setLine(this.cur_line, "e", "");
+ this.node.setLine(this.cur_line, "e", "xns");
+
}
this.node.line_end = this.cur_line;
var niter = this.out_nodeprops.map_iterator();
while(niter.next()) {
- var addstr = this.mungeChildNew(this.pad + indent_str, niter.get_value());
+
//print("add str: %s\n", addstr);
this.node.setLine(this.cur_line, "p",niter.get_key());
+
+ var addstr = this.mungeChildNew(this.pad + indent_str, niter.get_value());
this.addLine(this.pad + niter.get_key() + " : " + addstr, ',');
-
+
this.node.setLine(this.cur_line, "e", "");
}
// prop arrays...
var piter = this.out_props_array.map_iterator();
while(piter.next()) {
+
this.node.setLine(this.cur_line, "p",piter.get_key());
this.addLine(this.pad + piter.get_key() + " : [", 0);
this.node.setLine(this.cur_line, "e", "");
}
this.closeLine();
+
this.addLine(this.pad + "]" , ',');
+
}
// children..
return;
}
// look for '*props'
-
- for (var ii =0; ii< this.node.items.size; ii++) {
- var pl = this.node.items.get(ii);
+ var items = this.node.readItems();
+ for (var ii =0; ii< items.size; ii++) {
+ var pl = items.get(ii);
if (!pl.props.has_key("* prop")) {
//newitems.add(pl);
continue;
var keys = new Gee.ArrayList<string>();
var piter = this.node.props.map_iterator();
while (piter.next() ) {
- string k;
- string ktype;
- string kflag;
- this.node.normalize_key(piter.get_key(), out k, out kflag, out ktype);
-
- keys.add(k);
+
+
+ keys.add( piter.get_key()); // since are keys are nice and clean now..
}
keys.sort(( a, b) => {
var has_cms = this.node.has("cms-id");
for (var i = 0; i< keys.size; i++) {
- var key = this.node.get_key(keys.get(i));
+ var prop = this.node.get_prop(keys.get(i));
//("ADD KEY %s\n", key);
- string k;
- string ktype;
- string kflag;
-
- this.node.normalize_key(key, out k, out kflag, out ktype);
-
-
- var v = this.node.get(key);
+ var k = prop.name;
+ var ktype = prop.rtype;
+ var kflag = prop.ptype;
+ var v = prop.val;
//if (this.skip.contains(k) ) {
//}
if ( Regex.match_simple("\\[\\]$", k)) {
// array .. not supported... here?
-
-
+
}
string leftv = k;
// skip builder stuff. prefixed with '.' .. just like unix fs..
- if (kflag == ".") { // |. or . -- do not output..
- continue;
- }
- if (kflag == "*") {
+ //if (kflag == ".") { // |. or . -- do not output..
+ // continue;
+ //}
+ if (kflag == NodePropType.SPECIAL) {
// ignore '* prop'; ???
continue;
}
}
// html must not be a dynamic property...
// note - we do not translate this either...
- if (has_cms && k == "html" && kflag != "$") {
+ if (has_cms && k == "html" && kflag != NodePropType.RAW) {
this.out_props.set("html", "Pman.Cms.content(" +
// next.. is it a function.. or a raw string..
if (
- kflag == "|"
+ kflag == NodePropType.METHOD
||
- kflag == "$"
+ kflag == NodePropType.RAW
||
- ktype == "function"
+ ktype == "function" // ??? why woudl return type be function? << messed up..
// ??? any others that are raw output..
) {
// doubleStringProps is a list of keys like 'name' 'title' etc.. that we know can be translated..
if ((this.doubleStringProps.index_of(k) > -1) ||
- (ktype.down() == "string" && k[0] == '_')
+ (ktype.down() == "string" && k[0] == '_') // strings starting with '_'
) {
// then use the translated version...
for (var i = 0; i< keys.size; i++) {
var key = keys.get(i);
- var val = this.node.listeners.get(key);
+ var val = this.node.listeners.get(key).val;
//
public void iterChildren()
{
-
+ var items = this.node.readItems();
// finally munge the children...
- if (this.node.items.size < 1) {
+ if (items.size < 1) {
return;
}
var itms = "items : [\n";
//var n = 0;
- for(var i = 0; i < this.node.items.size;i++) {
- var ele = this.node.items.get(i);
+ for(var i = 0; i < items.size;i++) {
+ var ele = items.get(i);
if (ele.props.has_key("* prop")) {
continue;
}