mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-06-15 07:15:09 +02:00
Clean formatting and remove unneeded comments
This commit is contained in:
parent
0e01716827
commit
a843591136
1 changed files with 27 additions and 33 deletions
|
@ -500,22 +500,16 @@ sexp unparse_json (sexp ctx, sexp self, sexp obj){
|
||||||
res = SEXP_NULL;
|
res = SEXP_NULL;
|
||||||
|
|
||||||
if( sexp_symbolp(obj) ) {
|
if( sexp_symbolp(obj) ) {
|
||||||
// SYMBOL
|
|
||||||
obj = sexp_symbol_to_string(ctx, obj);
|
obj = sexp_symbol_to_string(ctx, obj);
|
||||||
res = unparse_json_string(ctx, self, obj);
|
res = unparse_json_string(ctx, self, obj);
|
||||||
} else if (sexp_stringp(obj)) {
|
} else if (sexp_stringp(obj)) {
|
||||||
// STRING
|
|
||||||
res = unparse_json_string(ctx, self, obj);
|
res = unparse_json_string(ctx, self, obj);
|
||||||
} else if (sexp_listp(ctx, obj) == SEXP_TRUE) {
|
} else if (sexp_listp(ctx, obj) == SEXP_TRUE) {
|
||||||
// OBJECT
|
|
||||||
res = unparse_json_object(ctx, self, obj);
|
res = unparse_json_object(ctx, self, obj);
|
||||||
} else if (sexp_vectorp(obj)) {
|
} else if (sexp_vectorp(obj)) {
|
||||||
// ARRAY
|
|
||||||
res = unparse_json_array(ctx, self, obj);
|
res = unparse_json_array(ctx, self, obj);
|
||||||
} else if(sexp_fixnump(obj)) {
|
} else if(sexp_fixnump(obj)) {
|
||||||
res = unparse_json_fixnum(ctx, self, obj);
|
res = unparse_json_fixnum(ctx, self, obj);
|
||||||
} else if (sexp_numberp(obj)){
|
|
||||||
// FLONUM or RATIONAL
|
|
||||||
} else if (obj == SEXP_FALSE) {
|
} else if (obj == SEXP_FALSE) {
|
||||||
res = sexp_c_string(ctx, "false", -1);
|
res = sexp_c_string(ctx, "false", -1);
|
||||||
} else if (obj == SEXP_TRUE) {
|
} else if (obj == SEXP_TRUE) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue