From 8748b41fa506288f72d17d37192fd4eeb599bf89 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 30 Oct 2006 03:34:41 +0000 Subject: [PATCH] *** empty log message *** --- ase/lsp/err.c | 3 +-- ase/lsp/eval.c | 20 ++++++++++---------- ase/lsp/lsp.c | 8 +++++--- ase/lsp/lsp.h | 9 ++++----- ase/lsp/prim.c | 24 ++++++++++++------------ ase/lsp/prim_let.c | 13 +++++++------ 6 files changed, 39 insertions(+), 38 deletions(-) diff --git a/ase/lsp/err.c b/ase/lsp/err.c index 132d715e..90d9270b 100644 --- a/ase/lsp/err.c +++ b/ase/lsp/err.c @@ -1,5 +1,5 @@ /* - * $Id: err.c,v 1.6 2006-10-29 13:40:30 bacon Exp $ + * $Id: err.c,v 1.7 2006-10-30 03:34:40 bacon Exp $ */ #include @@ -23,7 +23,6 @@ const ase_char_t* ase_lsp_geterrstr (int errnum) ASE_T("output"), ASE_T("syntax"), ASE_T("bad arguments"), - ASE_T("wrong arguments"), ASE_T("too few arguments"), ASE_T("too many arguments"), ASE_T("undefined function"), diff --git a/ase/lsp/eval.c b/ase/lsp/eval.c index 51c97b6b..fff8931e 100644 --- a/ase/lsp/eval.c +++ b/ase/lsp/eval.c @@ -1,5 +1,5 @@ /* - * $Id: eval.c,v 1.20 2006-10-29 13:40:30 bacon Exp $ + * $Id: eval.c,v 1.21 2006-10-30 03:34:40 bacon Exp $ */ #include @@ -56,13 +56,13 @@ static ase_lsp_obj_t* make_func (ase_lsp_t* lsp, ase_lsp_obj_t* cdr, int is_macr if (cdr == lsp->mem->nil) { - lsp->errnum = ASE_LSP_ERR_TOO_FEW_ARGS; + lsp->errnum = ASE_LSP_EARGFEW; return ASE_NULL; } if (ASE_LSP_TYPE(cdr) != ASE_LSP_OBJ_CONS) { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + lsp->errnum = ASE_LSP_EARGBAD; return ASE_NULL; } @@ -83,7 +83,7 @@ static ase_lsp_obj_t* make_func (ase_lsp_t* lsp, ase_lsp_obj_t* cdr, int is_macr if (p != lsp->mem->nil) { /* like in (lambda (x) (+ x 10) . 4) */ - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + lsp->errnum = ASE_LSP_EARGBAD; return ASE_NULL; } @@ -232,7 +232,7 @@ static ase_lsp_obj_t* apply ( { if (actual == mem->nil) { - lsp->errnum = ASE_LSP_ERR_TOO_FEW_ARGS; + lsp->errnum = ASE_LSP_EARGFEW; mem->brooding_frame = frame->link; ase_lsp_freeframe (lsp, frame); return ASE_NULL; @@ -275,14 +275,14 @@ static ase_lsp_obj_t* apply ( if (ASE_LSP_TYPE(actual) == ASE_LSP_OBJ_CONS) { - lsp->errnum = ASE_LSP_ERR_TOO_MANY_ARGS; + lsp->errnum = ASE_LSP_EARGMANY; mem->brooding_frame = frame->link; ase_lsp_freeframe (lsp, frame); return ASE_NULL; } else if (actual != mem->nil) { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + lsp->errnum = ASE_LSP_EARGBAD; mem->brooding_frame = frame->link; ase_lsp_freeframe (lsp, frame); return ASE_NULL; @@ -339,19 +339,19 @@ static ase_lsp_obj_t* apply_to_prim ( } if (obj != lsp->mem->nil) { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + lsp->errnum = ASE_LSP_EARGBAD; return ASE_NULL; } if (count < ASE_LSP_PMINARGS(func)) { - lsp->errnum = ASE_LSP_ERR_TOO_FEW_ARGS; + lsp->errnum = ASE_LSP_EARGFEW; return ASE_NULL; } if (count > ASE_LSP_PMAXARGS(func)) { - lsp->errnum = ASE_LSP_ERR_TOO_MANY_ARGS; + lsp->errnum = ASE_LSP_EARGMANY; return ASE_NULL; } diff --git a/ase/lsp/lsp.c b/ase/lsp/lsp.c index bc33e02b..461604ac 100644 --- a/ase/lsp/lsp.c +++ b/ase/lsp/lsp.c @@ -1,5 +1,5 @@ /* - * $Id: lsp.c,v 1.14 2006-10-29 13:40:31 bacon Exp $ + * $Id: lsp.c,v 1.15 2006-10-30 03:34:41 bacon Exp $ */ #if defined(__BORLANDC__) @@ -156,8 +156,10 @@ int ase_lsp_attach_output (ase_lsp_t* lsp, ase_lsp_io_t output, void* arg) int ase_lsp_detach_output (ase_lsp_t* lsp) { - if (lsp->output_func != ASE_NULL) { - if (lsp->output_func(ASE_LSP_IO_CLOSE, lsp->output_arg, ASE_NULL, 0) == -1) { + if (lsp->output_func != ASE_NULL) + { + if (lsp->output_func(ASE_LSP_IO_CLOSE, lsp->output_arg, ASE_NULL, 0) == -1) + { /* TODO: set error number */ return -1; } diff --git a/ase/lsp/lsp.h b/ase/lsp/lsp.h index e5461e2b..908c8e99 100644 --- a/ase/lsp/lsp.h +++ b/ase/lsp/lsp.h @@ -1,5 +1,5 @@ /* - * $Id: lsp.h,v 1.30 2006-10-29 13:40:32 bacon Exp $ + * $Id: lsp.h,v 1.31 2006-10-30 03:34:41 bacon Exp $ */ #ifndef _ASE_LSP_LSP_H_ @@ -77,10 +77,9 @@ enum ASE_LSP_ERR_OUTPUT_NOT_ATTACHED, ASE_LSP_ERR_OUTPUT, ASE_LSP_ERR_SYNTAX, - ASE_LSP_ERR_BAD_ARG, - ASE_LSP_ERR_WRONG_ARG, - ASE_LSP_ERR_TOO_FEW_ARGS, - ASE_LSP_ERR_TOO_MANY_ARGS, + ASE_LSP_EARGBAD, + ASE_LSP_EARGFEW, + ASE_LSP_EARGMANY, ASE_LSP_ERR_UNDEF_FUNC, ASE_LSP_ERR_BAD_FUNC, ASE_LSP_ERR_DUP_FORMAL, diff --git a/ase/lsp/prim.c b/ase/lsp/prim.c index 82d50ba0..ab1df668 100644 --- a/ase/lsp/prim.c +++ b/ase/lsp/prim.c @@ -1,5 +1,5 @@ /* - * $Id: prim.c,v 1.15 2006-10-29 13:40:33 bacon Exp $ + * $Id: prim.c,v 1.16 2006-10-30 03:34:41 bacon Exp $ */ #include @@ -85,7 +85,7 @@ ase_lsp_obj_t* ase_lsp_prim_cond (ase_lsp_t* lsp, ase_lsp_obj_t* args) { if (ASE_LSP_TYPE(ASE_LSP_CAR(args)) != ASE_LSP_OBJ_CONS) { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + lsp->errnum = ASE_LSP_EARGBAD; return ASE_NULL; } @@ -104,7 +104,7 @@ ase_lsp_obj_t* ase_lsp_prim_cond (ase_lsp_t* lsp, ase_lsp_obj_t* args) } if (tmp != lsp->mem->nil) { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + lsp->errnum = ASE_LSP_EARGBAD; return ASE_NULL; } return ret; @@ -145,7 +145,7 @@ ase_lsp_obj_t* ase_lsp_prim_if (ase_lsp_t* lsp, ase_lsp_obj_t* args) } if (tmp != lsp->mem->nil) { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + lsp->errnum = ASE_LSP_EARGBAD; return ASE_NULL; } @@ -180,7 +180,7 @@ ase_lsp_obj_t* ase_lsp_prim_while (ase_lsp_t* lsp, ase_lsp_obj_t* args) if (tmp != lsp->mem->nil) { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + lsp->errnum = ASE_LSP_EARGBAD; return ASE_NULL; } } @@ -204,7 +204,7 @@ ase_lsp_obj_t* ase_lsp_prim_car (ase_lsp_t* lsp, ase_lsp_obj_t* args) if (ASE_LSP_TYPE(tmp) != ASE_LSP_OBJ_CONS) { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + lsp->errnum = ASE_LSP_EARGBAD; return ASE_NULL; } @@ -227,7 +227,7 @@ ase_lsp_obj_t* ase_lsp_prim_cdr (ase_lsp_t* lsp, ase_lsp_obj_t* args) if (ASE_LSP_TYPE(tmp) != ASE_LSP_OBJ_CONS) { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + lsp->errnum = ASE_LSP_EARGBAD; return ASE_NULL; } @@ -278,7 +278,7 @@ ase_lsp_obj_t* ase_lsp_prim_set (ase_lsp_t* lsp, ase_lsp_obj_t* args) if (ASE_LSP_TYPE(p1) != ASE_LSP_OBJ_SYM) { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + lsp->errnum = ASE_LSP_EARGBAD; return ASE_NULL; } @@ -310,13 +310,13 @@ ase_lsp_obj_t* ase_lsp_prim_setq (ase_lsp_t* lsp, ase_lsp_obj_t* args) p1 = ASE_LSP_CAR(p); if (ASE_LSP_TYPE(p1) != ASE_LSP_OBJ_SYM) { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + lsp->errnum = ASE_LSP_EARGBAD; return ASE_NULL; } if (ASE_LSP_TYPE(ASE_LSP_CDR(p)) != ASE_LSP_OBJ_CONS) { - lsp->errnum = ASE_LSP_ERR_TOO_FEW_ARGS; + lsp->errnum = ASE_LSP_EARGFEW; return ASE_NULL; } @@ -361,7 +361,7 @@ ase_lsp_obj_t* ase_lsp_prim_defun (ase_lsp_t* lsp, ase_lsp_obj_t* args) name = ASE_LSP_CAR(args); if (ASE_LSP_TYPE(name) != ASE_LSP_OBJ_SYM) { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + lsp->errnum = ASE_LSP_EARGBAD; return ASE_NULL; } @@ -389,7 +389,7 @@ ase_lsp_obj_t* ase_lsp_prim_demac (ase_lsp_t* lsp, ase_lsp_obj_t* args) name = ASE_LSP_CAR(args); if (ASE_LSP_TYPE(name) != ASE_LSP_OBJ_SYM) { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + lsp->errnum = ASE_LSP_EARGBAD; return ASE_NULL; } diff --git a/ase/lsp/prim_let.c b/ase/lsp/prim_let.c index b95b591a..2e611059 100644 --- a/ase/lsp/prim_let.c +++ b/ase/lsp/prim_let.c @@ -1,5 +1,5 @@ /* - * $Id: prim_let.c,v 1.8 2006-10-29 13:40:33 bacon Exp $ + * $Id: prim_let.c,v 1.9 2006-10-30 03:34:41 bacon Exp $ */ #include @@ -45,7 +45,7 @@ static ase_lsp_obj_t* __prim_let ( if (ASE_LSP_TYPE(n) != ASE_LSP_OBJ_SYM) { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; // must be a symbol + lsp->errnum = ASE_LSP_EARGBAD; // must be a symbol if (sequential) lsp->mem->frame = frame->link; else lsp->mem->brooding_frame = frame->link; ase_lsp_freeframe (lsp, frame); @@ -56,7 +56,7 @@ static ase_lsp_obj_t* __prim_let ( { if (ASE_LSP_CDR(v) != lsp->mem->nil) { - lsp->errnum = ASE_LSP_ERR_TOO_MANY_ARGS; // must be a symbol + lsp->errnum = ASE_LSP_EARGMANY; if (sequential) lsp->mem->frame = frame->link; else lsp->mem->brooding_frame = frame->link; ase_lsp_freeframe (lsp, frame); @@ -109,7 +109,7 @@ static ase_lsp_obj_t* __prim_let ( } else { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + lsp->errnum = ASE_LSP_EARGBAD; if (sequential) lsp->mem->frame = frame->link; else lsp->mem->brooding_frame = frame->link; ase_lsp_freeframe (lsp, frame); @@ -119,8 +119,9 @@ static ase_lsp_obj_t* __prim_let ( assoc = ASE_LSP_CDR(assoc); } - if (assoc != lsp->mem->nil) { - lsp->errnum = ASE_LSP_ERR_BAD_ARG; + if (assoc != lsp->mem->nil) + { + lsp->errnum = ASE_LSP_EARGBAD; if (sequential) lsp->mem->frame = frame->link; else lsp->mem->brooding_frame = frame->link; ase_lsp_freeframe (lsp, frame);