Skip to content
Permalink
Browse files

Handle boolean types.

  • Loading branch information...
Shinmera committed Nov 23, 2017
1 parent ce3fd3b commit ef5dec126203efde5422b14c900504cd4a7c9001
Showing with 22 additions and 10 deletions.
  1. +4 −0 cl.js
  2. +11 −5 lichat.js
  3. +6 −5 printer.js
  4. +1 −0 ui.js
4 cl.js
@@ -109,6 +109,10 @@ var CL = function(){
if(instance === null){
return true;
}
}else if(type === "Boolean"){
if(instance === true || instance === false){
return true;
}
}else if(instance instanceof StandardObject){
if(instance.type === type
|| instance.isInstanceOf(type)){
@@ -109,6 +109,10 @@ var CL = function(){
if(instance === null){
return true;
}
}else if(type === "Boolean"){
if(instance === true || instance === false){
return true;
}
}else if(instance instanceof StandardObject){
if(instance.type === type
|| instance.isInstanceOf(type)){
@@ -720,11 +724,12 @@ var LichatPrinter = function(){

self.printSexpr = (sexpr, stream)=>{
cl.typecase(sexpr,
null, ()=> self.printSexprToken("NIL", stream),
"String", ()=> self.printSexprString(sexpr, stream),
"Array", ()=> self.printSexprList(sexpr, stream),
"Number", ()=> self.printSexprNumber(sexpr, stream),
"Symbol", ()=> self.printSexprSymbol(sexpr, stream),
null, ()=> self.printSexprToken("NIL", stream),
"String", ()=> self.printSexprString(sexpr, stream),
"Array", ()=> self.printSexprList(sexpr, stream),
"Number", ()=> self.printSexprNumber(sexpr, stream),
"Symbol", ()=> self.printSexprSymbol(sexpr, stream),
"Boolean", ()=> self.printSexprToken((sexpr)?"T":"NIL", stream),
true, ()=> cl.error("UNPRINTABLE-OBJECT",{object: sexpr}));
};

@@ -1264,6 +1269,7 @@ var LichatUI = function(chat,client){
self.processCommand(text, chan) ||
self.sendMessage(text, chan);
}catch(e){
console.log(e);
self.showError(e);
}
};
@@ -76,11 +76,12 @@ var LichatPrinter = function(){

self.printSexpr = (sexpr, stream)=>{
cl.typecase(sexpr,
null, ()=> self.printSexprToken("NIL", stream),
"String", ()=> self.printSexprString(sexpr, stream),
"Array", ()=> self.printSexprList(sexpr, stream),
"Number", ()=> self.printSexprNumber(sexpr, stream),
"Symbol", ()=> self.printSexprSymbol(sexpr, stream),
null, ()=> self.printSexprToken("NIL", stream),
"String", ()=> self.printSexprString(sexpr, stream),
"Array", ()=> self.printSexprList(sexpr, stream),
"Number", ()=> self.printSexprNumber(sexpr, stream),
"Symbol", ()=> self.printSexprSymbol(sexpr, stream),
"Boolean", ()=> self.printSexprToken((sexpr)?"T":"NIL", stream),
true, ()=> cl.error("UNPRINTABLE-OBJECT",{object: sexpr}));
};

1 ui.js
@@ -87,6 +87,7 @@ var LichatUI = function(chat,client){
self.processCommand(text, chan) ||
self.sendMessage(text, chan);
}catch(e){
console.log(e);
self.showError(e);
}
};

0 comments on commit ef5dec1

Please sign in to comment.
You can’t perform that action at this time.