*** empty log message ***

This commit is contained in:
hyung-hwan 2006-10-30 03:34:41 +00:00
parent 1fa5fd52ba
commit 8748b41fa5
6 changed files with 39 additions and 38 deletions

View File

@ -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 <ase/lsp/lsp_i.h> #include <ase/lsp/lsp_i.h>
@ -23,7 +23,6 @@ const ase_char_t* ase_lsp_geterrstr (int errnum)
ASE_T("output"), ASE_T("output"),
ASE_T("syntax"), ASE_T("syntax"),
ASE_T("bad arguments"), ASE_T("bad arguments"),
ASE_T("wrong arguments"),
ASE_T("too few arguments"), ASE_T("too few arguments"),
ASE_T("too many arguments"), ASE_T("too many arguments"),
ASE_T("undefined function"), ASE_T("undefined function"),

View File

@ -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 <ase/lsp/lsp_i.h> #include <ase/lsp/lsp_i.h>
@ -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) if (cdr == lsp->mem->nil)
{ {
lsp->errnum = ASE_LSP_ERR_TOO_FEW_ARGS; lsp->errnum = ASE_LSP_EARGFEW;
return ASE_NULL; return ASE_NULL;
} }
if (ASE_LSP_TYPE(cdr) != ASE_LSP_OBJ_CONS) if (ASE_LSP_TYPE(cdr) != ASE_LSP_OBJ_CONS)
{ {
lsp->errnum = ASE_LSP_ERR_BAD_ARG; lsp->errnum = ASE_LSP_EARGBAD;
return ASE_NULL; 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) if (p != lsp->mem->nil)
{ {
/* like in (lambda (x) (+ x 10) . 4) */ /* like in (lambda (x) (+ x 10) . 4) */
lsp->errnum = ASE_LSP_ERR_BAD_ARG; lsp->errnum = ASE_LSP_EARGBAD;
return ASE_NULL; return ASE_NULL;
} }
@ -232,7 +232,7 @@ static ase_lsp_obj_t* apply (
{ {
if (actual == mem->nil) if (actual == mem->nil)
{ {
lsp->errnum = ASE_LSP_ERR_TOO_FEW_ARGS; lsp->errnum = ASE_LSP_EARGFEW;
mem->brooding_frame = frame->link; mem->brooding_frame = frame->link;
ase_lsp_freeframe (lsp, frame); ase_lsp_freeframe (lsp, frame);
return ASE_NULL; return ASE_NULL;
@ -275,14 +275,14 @@ static ase_lsp_obj_t* apply (
if (ASE_LSP_TYPE(actual) == ASE_LSP_OBJ_CONS) 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; mem->brooding_frame = frame->link;
ase_lsp_freeframe (lsp, frame); ase_lsp_freeframe (lsp, frame);
return ASE_NULL; return ASE_NULL;
} }
else if (actual != mem->nil) else if (actual != mem->nil)
{ {
lsp->errnum = ASE_LSP_ERR_BAD_ARG; lsp->errnum = ASE_LSP_EARGBAD;
mem->brooding_frame = frame->link; mem->brooding_frame = frame->link;
ase_lsp_freeframe (lsp, frame); ase_lsp_freeframe (lsp, frame);
return ASE_NULL; return ASE_NULL;
@ -339,19 +339,19 @@ static ase_lsp_obj_t* apply_to_prim (
} }
if (obj != lsp->mem->nil) if (obj != lsp->mem->nil)
{ {
lsp->errnum = ASE_LSP_ERR_BAD_ARG; lsp->errnum = ASE_LSP_EARGBAD;
return ASE_NULL; return ASE_NULL;
} }
if (count < ASE_LSP_PMINARGS(func)) if (count < ASE_LSP_PMINARGS(func))
{ {
lsp->errnum = ASE_LSP_ERR_TOO_FEW_ARGS; lsp->errnum = ASE_LSP_EARGFEW;
return ASE_NULL; return ASE_NULL;
} }
if (count > ASE_LSP_PMAXARGS(func)) if (count > ASE_LSP_PMAXARGS(func))
{ {
lsp->errnum = ASE_LSP_ERR_TOO_MANY_ARGS; lsp->errnum = ASE_LSP_EARGMANY;
return ASE_NULL; return ASE_NULL;
} }

View File

@ -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__) #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) int ase_lsp_detach_output (ase_lsp_t* lsp)
{ {
if (lsp->output_func != ASE_NULL) { 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_LSP_IO_CLOSE, lsp->output_arg, ASE_NULL, 0) == -1)
{
/* TODO: set error number */ /* TODO: set error number */
return -1; return -1;
} }

View File

@ -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_ #ifndef _ASE_LSP_LSP_H_
@ -77,10 +77,9 @@ enum
ASE_LSP_ERR_OUTPUT_NOT_ATTACHED, ASE_LSP_ERR_OUTPUT_NOT_ATTACHED,
ASE_LSP_ERR_OUTPUT, ASE_LSP_ERR_OUTPUT,
ASE_LSP_ERR_SYNTAX, ASE_LSP_ERR_SYNTAX,
ASE_LSP_ERR_BAD_ARG, ASE_LSP_EARGBAD,
ASE_LSP_ERR_WRONG_ARG, ASE_LSP_EARGFEW,
ASE_LSP_ERR_TOO_FEW_ARGS, ASE_LSP_EARGMANY,
ASE_LSP_ERR_TOO_MANY_ARGS,
ASE_LSP_ERR_UNDEF_FUNC, ASE_LSP_ERR_UNDEF_FUNC,
ASE_LSP_ERR_BAD_FUNC, ASE_LSP_ERR_BAD_FUNC,
ASE_LSP_ERR_DUP_FORMAL, ASE_LSP_ERR_DUP_FORMAL,

View File

@ -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 <ase/lsp/lsp_i.h> #include <ase/lsp/lsp_i.h>
@ -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) 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; 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) if (tmp != lsp->mem->nil)
{ {
lsp->errnum = ASE_LSP_ERR_BAD_ARG; lsp->errnum = ASE_LSP_EARGBAD;
return ASE_NULL; return ASE_NULL;
} }
return ret; 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) if (tmp != lsp->mem->nil)
{ {
lsp->errnum = ASE_LSP_ERR_BAD_ARG; lsp->errnum = ASE_LSP_EARGBAD;
return ASE_NULL; 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) if (tmp != lsp->mem->nil)
{ {
lsp->errnum = ASE_LSP_ERR_BAD_ARG; lsp->errnum = ASE_LSP_EARGBAD;
return ASE_NULL; 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) if (ASE_LSP_TYPE(tmp) != ASE_LSP_OBJ_CONS)
{ {
lsp->errnum = ASE_LSP_ERR_BAD_ARG; lsp->errnum = ASE_LSP_EARGBAD;
return ASE_NULL; 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) if (ASE_LSP_TYPE(tmp) != ASE_LSP_OBJ_CONS)
{ {
lsp->errnum = ASE_LSP_ERR_BAD_ARG; lsp->errnum = ASE_LSP_EARGBAD;
return ASE_NULL; 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) if (ASE_LSP_TYPE(p1) != ASE_LSP_OBJ_SYM)
{ {
lsp->errnum = ASE_LSP_ERR_BAD_ARG; lsp->errnum = ASE_LSP_EARGBAD;
return ASE_NULL; 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); p1 = ASE_LSP_CAR(p);
if (ASE_LSP_TYPE(p1) != ASE_LSP_OBJ_SYM) if (ASE_LSP_TYPE(p1) != ASE_LSP_OBJ_SYM)
{ {
lsp->errnum = ASE_LSP_ERR_BAD_ARG; lsp->errnum = ASE_LSP_EARGBAD;
return ASE_NULL; return ASE_NULL;
} }
if (ASE_LSP_TYPE(ASE_LSP_CDR(p)) != ASE_LSP_OBJ_CONS) 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; 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); name = ASE_LSP_CAR(args);
if (ASE_LSP_TYPE(name) != ASE_LSP_OBJ_SYM) if (ASE_LSP_TYPE(name) != ASE_LSP_OBJ_SYM)
{ {
lsp->errnum = ASE_LSP_ERR_BAD_ARG; lsp->errnum = ASE_LSP_EARGBAD;
return ASE_NULL; 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); name = ASE_LSP_CAR(args);
if (ASE_LSP_TYPE(name) != ASE_LSP_OBJ_SYM) if (ASE_LSP_TYPE(name) != ASE_LSP_OBJ_SYM)
{ {
lsp->errnum = ASE_LSP_ERR_BAD_ARG; lsp->errnum = ASE_LSP_EARGBAD;
return ASE_NULL; return ASE_NULL;
} }

View File

@ -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 <ase/lsp/lsp_i.h> #include <ase/lsp/lsp_i.h>
@ -45,7 +45,7 @@ static ase_lsp_obj_t* __prim_let (
if (ASE_LSP_TYPE(n) != ASE_LSP_OBJ_SYM) 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; if (sequential) lsp->mem->frame = frame->link;
else lsp->mem->brooding_frame = frame->link; else lsp->mem->brooding_frame = frame->link;
ase_lsp_freeframe (lsp, frame); ase_lsp_freeframe (lsp, frame);
@ -56,7 +56,7 @@ static ase_lsp_obj_t* __prim_let (
{ {
if (ASE_LSP_CDR(v) != lsp->mem->nil) 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; if (sequential) lsp->mem->frame = frame->link;
else lsp->mem->brooding_frame = frame->link; else lsp->mem->brooding_frame = frame->link;
ase_lsp_freeframe (lsp, frame); ase_lsp_freeframe (lsp, frame);
@ -109,7 +109,7 @@ static ase_lsp_obj_t* __prim_let (
} }
else else
{ {
lsp->errnum = ASE_LSP_ERR_BAD_ARG; lsp->errnum = ASE_LSP_EARGBAD;
if (sequential) lsp->mem->frame = frame->link; if (sequential) lsp->mem->frame = frame->link;
else lsp->mem->brooding_frame = frame->link; else lsp->mem->brooding_frame = frame->link;
ase_lsp_freeframe (lsp, frame); ase_lsp_freeframe (lsp, frame);
@ -119,8 +119,9 @@ static ase_lsp_obj_t* __prim_let (
assoc = ASE_LSP_CDR(assoc); assoc = ASE_LSP_CDR(assoc);
} }
if (assoc != lsp->mem->nil) { if (assoc != lsp->mem->nil)
lsp->errnum = ASE_LSP_ERR_BAD_ARG; {
lsp->errnum = ASE_LSP_EARGBAD;
if (sequential) lsp->mem->frame = frame->link; if (sequential) lsp->mem->frame = frame->link;
else lsp->mem->brooding_frame = frame->link; else lsp->mem->brooding_frame = frame->link;
ase_lsp_freeframe (lsp, frame); ase_lsp_freeframe (lsp, frame);