This commit is contained in:
Christopher Jeffrey 2013-02-22 15:54:10 -06:00
parent c477f71dd2
commit 6dad574249
1 changed files with 0 additions and 48 deletions

View File

@ -837,54 +837,6 @@ Tput.prototype.parseTermCap = function(data) {
return terms;
};
Tput.prototype.parseTermCap_ = function(data) {
var terms = {}
, term;
// remove escaped newlines
data = data.replace(/\\\n\s*/g, '');
// remove comments
data = data.replace(/^#[^\n]+/gm, '');
// could split by line instead
data = data.replace(/\s+/g, '');
var fields = data.split(/:+/)
, l = fields.length
, i = 0
, field
, names;
for (; i < l; i++) {
field = fields[i].trim();
if (!field) continue;
names = field.split('|');
if (names.length > 1) {
term = terms[names[0]] = {};
term.header = {
desc: names.pop(),
names: names
};
term.bools = {};
term.numbers = {};
term.strings = {};
continue;
}
if (~field.indexOf('=')) {
parts = field.split('=');
term.strings[parts[0]] = parts.slice(1).join('=');
} else if (~field.indexOf('#')) {
parts = field.split('#');
term.numbers[parts[0]] = +parts.slice(1).join('#');
} else {
term.bools[field] = true;
}
}
};
/**
* Termcap Compiler
* man termcap