mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-09 18:45:51 +00:00
more work
This commit is contained in:
parent
fe004fff34
commit
df0aeb5005
26
lib/tput.js
26
lib/tput.js
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user