this.isOptional = false;
this.defaultValue = "";
this.desc = "";
+ this.optvalues = false;
if (typeof src != "undefined") {
this.parse(src);
}
/**
* serialize..
*/
- toObject :function(t)
+ toJSON :function(t)
{
+ var ret = { '*object' : 'DocTag' };
- var ret = { };
for (var i in this) {
- if (Symbol.hide.indexOf(i) > -1) {
+ if (i == 'optvalues') {
+ ret[i] = this.optvalues;
continue;
}
+
switch (typeof(this[i])) {
case 'function':
- continue;
- case 'object':
+ continue;
continue;
case 'string':
case 'number':
+ case 'boolean':
ret[i] = this[i]; continue;
+
+
+
default:
- print("unknown type:" + typeof(this[i]));
+
+ print("unknown type: (" + i + ")" + typeof(this[i]));
+ this.toJSON = null;
+ print(JSON.stringify(this));;
Seed.quit();
}
}
if (Options.LOG) Options.LOG.warn(e);
else throw e;
}
+
+ // if type == @cfg, and matches (|....|...)
+
+ src = src.trim();
+ if (this.title == "cfg" && src.match(/^\([^)]+\)/)) {
+ var m = src.match(/^\(([^)]+)\)/);
+ print(m);
+ if (m[1].match(/\|/)) {
+ var opts = m[1].trim().split(/\s*\|\s*/);
+ this.optvalues = opts;
+ src = src.substring(m[0].length).trim();
+ print(src);
+
+
+ }
+
+
+ }
+
+
this.desc = src; // whatever is left
// example tags need to have whitespace preserved