more work

This commit is contained in:
Christopher Jeffrey 2013-02-27 17:43:28 -06:00
parent fe004fff34
commit df0aeb5005
1 changed files with 26 additions and 0 deletions

View File

@ -686,6 +686,7 @@ Tput.prototype._compile = function(val) {
} else {
// echo('stack.pop()'); // TODO: check screen terminfo for an example
echo('String.fromCharCode(stack.pop())');
//echo('(v = stack.pop() || "", isFinite(v) ? String.fromCharCode(v) : v[0])');
}
continue;
}
@ -869,6 +870,30 @@ Tput.prototype._compile = function(val) {
// Then the same is done for the second parameter. More complex
// arithmetic is possible using the stack.
// $ man termcap
if (this.options.termcap) {
// %r Single parameter capability
if (read(/^%r/)) {
expr('()');
continue;
}
// %+ Add value of next character to this parameter and do binary output
// if (read(/^%\+/)) {
// echo('stack.pop()');
// continue;
// }
// %2 Do ASCII output of this parameter with a field with of 2
if (read(/^%2/)) {
echo('stack.pop()');
continue;
}
// %d Do ASCII output of this parameter with a field with of 3
// if (read(/^%d/)) {
// echo('stack.pop()');
// continue;
// }
}
buff += val[0];
val = val.substring(1);
}
@ -1179,6 +1204,7 @@ function sprintf(src) {
param = isFinite(param)
? String.fromCharCode(param)
: '';
//: param[0];
break;
}