[ ] - collapse into first element.
* c) items = , seperation within the above..
*
- *
+ * usage: x = new Collapse(token_array)
*
*
*
}
tok.prefix = '';
if (pref.length) {
- Roo.each(pref, function(e) {
+ pref.forEach( function(e) {
if (!e) {
return;
}
// Seed.print(TokenStream.toString(ret));
return ret;
}
- // console.log(tok.data);
+ // console.log(tok.data);
switch(tok.type) {
-
+ case "VOID":
+ return ret; //EOF
+
case "KEYW":
case "TOKN":
var start = st.cursor;
st.next(1);
- var add = st.balance(tok.name);
+ var add = st.balance(tok.data);
if (!add) {
console.dump(tok);
console.dump(start + '...' + st.cursor);
if (add) {
add.shift();
}
- //Seed.print(TokenStream.toString(aa));
+ //Seed.print("ADD");
+ //Seed.print(JSON.stringify(add, null,4));
+
var toks = add ? this.collapse(add) : [];
tok.items = false;
tok.props = false;
+
+
if (tok.data != '{') {
// paramters or array elements..
tok.items = this.toItems(toks, [',']);
Seed.print("OOPS");
continue;
default :
- Seed.print("OOPS");
+ Seed.print("OOPS" + tok.type);
continue;
}
}