summaryrefslogtreecommitdiff
path: root/js/lex.js
diff options
context:
space:
mode:
authorJulie Lala <jules@okfoc.us>2014-11-29 19:02:35 -0500
committerJulie Lala <jules@okfoc.us>2014-11-29 19:02:35 -0500
commit698f2aa71ffc1b9e56193c13e6366765134152c9 (patch)
tree072b8e049870877f189135e3a2398387ae6f96fa /js/lex.js
parent05d359b6cdabc42025881e0a39c00995d8a29394 (diff)
formalizing import/export stuff
Diffstat (limited to 'js/lex.js')
-rw-r--r--js/lex.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/js/lex.js b/js/lex.js
index cf7c655..29f452b 100644
--- a/js/lex.js
+++ b/js/lex.js
@@ -25,16 +25,23 @@ Lex.prototype.read = function(){
this.char = this.span.innerHTML
return this.char
}
+Lex.prototype.ascii = function(){
+ return this.char || " "
+}
Lex.prototype.sanitize = function(){
return this.char == "%" ? '%%' : this.char || " "
}
-Lex.prototype.irc = function(){
- var char = this.sanitize()
+var fgOnly = false
+Lex.prototype.mirc = function(){
+ var char = this.char || " "
+ if (fgOnly) {
+ return "\x03" + (this.fg&15) + char
+ }
if (this.bg == 1 && this.fg == 0) {
return char
}
else {
- return "\\x03" + (this.fg&15) + "," + (this.bg&15) + char
+ return "\x03" + (this.fg&15) + "," + (this.bg&15) + char
}
}
Lex.prototype.clone = function (lex){