clean up compiler

This commit is contained in:
Christopher Jeffrey 2013-02-24 07:44:48 -06:00
parent 4000eb0412
commit 587443f9e3
1 changed files with 9 additions and 4 deletions

View File

@ -342,6 +342,10 @@ Tput.prototype._compile = function(val) {
, i
, v
var then
, els
, end;
function clear() {
if (buff) {
echo(JSON.stringify(buff).replace(/\\u001b/g, '\\x1b'));
@ -654,10 +658,11 @@ Tput.prototype._compile = function(val) {
}
if (read(/^%e/)) {
var end = val.indexOf('%;');
var els = val.indexOf('%e');
var then = val.indexOf('%t');
// does else if's like this: %?[expr]%t...%e[expr]%t...%;
then = val.indexOf('%t');
els = val.indexOf('%e');
end = val.indexOf('%;');
// Terminfo does elseif's like
// this: %?[expr]%t...%e[expr]%t...%;
if (then < end && then < els) {
stmt('} else if (');
} else {