diff options
| author | Paul Buetow <paul@buetow.org> | 2008-11-04 23:43:30 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-11-04 23:43:30 +0000 |
| commit | 7575536c805e379b009630947e72f636c006751f (patch) | |
| tree | f8183dac7c3a088a5e6ac1054f226b8510337114 | |
| parent | d2713783c48ca9fbdd6f4ea3aab03fe856fdd52a (diff) | |
fixed bugs which happened.
| -rw-r--r-- | docs/help.txt | 2 | ||||
| -rw-r--r-- | docs/stats.txt | 2 | ||||
| -rw-r--r-- | docs/version.txt | 2 | ||||
| -rwxr-xr-x | fype | bin | 449989 -> 455007 bytes | |||
| -rw-r--r-- | src/build.h | 2 | ||||
| -rw-r--r-- | src/core/function.c | 28 | ||||
| -rw-r--r-- | src/core/token.c | 2 |
7 files changed, 33 insertions, 5 deletions
diff --git a/docs/help.txt b/docs/help.txt index 1327bde..d7a5530 100644 --- a/docs/help.txt +++ b/docs/help.txt @@ -1,4 +1,4 @@ -Fype v0.1-devel Build 9347 +Fype v0.1-devel Build 9348 (c) Paul C. Buetow (2005 - 2008) <fype@dev.buetow.org> -e Executes given code string (see synopses) -h Prints this help diff --git a/docs/stats.txt b/docs/stats.txt index 2a52d18..5172f37 100644 --- a/docs/stats.txt +++ b/docs/stats.txt @@ -1,4 +1,4 @@ ===> Num of C source files : 44 -===> Num of C source lines : 7965 +===> Num of C source lines : 7995 ===> Num of Fype source examples : 14 ===> Num of Fype source lines : 362 diff --git a/docs/version.txt b/docs/version.txt index e3059ba..180a0b9 100644 --- a/docs/version.txt +++ b/docs/version.txt @@ -1 +1 @@ -Fype v0.1-devel Build 9347 +Fype v0.1-devel Build 9348 Binary files differdiff --git a/src/build.h b/src/build.h index 8b24407..a313b8c 100644 --- a/src/build.h +++ b/src/build.h @@ -35,7 +35,7 @@ #ifndef BUILD_H #define BUILD_H -#define BUILDNR 9347 +#define BUILDNR 9362 #define OS_FREEBSD #endif diff --git a/src/core/function.c b/src/core/function.c index 8d5dbf6..a102d7b 100644 --- a/src/core/function.c +++ b/src/core/function.c @@ -283,6 +283,7 @@ _process(Interpret *p_interpret, Token *p_token_store, Token *p_token_op, strcmp(token_get_val(p_token_next), token_get_val(p_token_store)) == 0); token_set_tt(p_token_store, TT_INTEGER); + break; case TT_ARRAY: ERROR("TT_ARRAY eq TT_ARRAY not yet implemented"); break; @@ -414,6 +415,31 @@ _process(Interpret *p_interpret, Token *p_token_store, Token *p_token_op, NO_DEFAULT; } break; + case TT_AND: + switch (tt_highest) { + case TT_INTEGER: + token_set_ival(p_token_store, + (int) token_get_ival(p_token_next) & + token_get_ival(p_token_store)); + break; + case TT_DOUBLE: + token_set_ival(p_token_store, + (int) token_get_dval(p_token_next) & + (int) token_get_dval(p_token_store)); + token_set_tt(p_token_store, TT_INTEGER); + break; + case TT_STRING: + token_set_ival(p_token_store, + atoi(token_get_val(p_token_next)) & + atoi(token_get_val(p_token_store))); + token_set_tt(p_token_store, TT_INTEGER); + break; + case TT_ARRAY: + ERROR("ARRAY bla yet implemented"); + break; + NO_DEFAULT; + } + break; case TT_OR: switch (tt_highest) { case TT_INTEGER: @@ -810,10 +836,10 @@ function_process_buildin(Interpret *p_interpret, Token *p_token_ident, break; case TT_STRING: printf("%s", token_get_val(p_token)); + break; case TT_ARRAY: ERROR("ARRAY bla yet implemented"); break; - break; } } stackiterator_delete(p_iter); diff --git a/src/core/token.c b/src/core/token.c index 3a2e413..a60a790 100644 --- a/src/core/token.c +++ b/src/core/token.c @@ -275,6 +275,7 @@ token_new_dummy() { p_token->c_filename = NULL; p_token->u_token_id = TOKEN_ID_COUNTER++; p_token->i_ref_count = 0; + p_token->p_array = NULL; /* Register the token in the garbage collector */ garbage_add_token(p_token); @@ -290,6 +291,7 @@ token_new_copy(Token *p_token) { if (p_token_copy == NULL) ERROR("Memory alloc error"); + p_token->p_array = NULL; token_copy_vals(p_token_copy, p_token); p_token_copy->i_ref_count = 0; |
