Mercurial > hg > octave-terminal
changeset 200:2e4d2596f2c3
[project @ 1993-11-08 20:22:15 by jwe]
author | jwe |
---|---|
date | Mon, 08 Nov 1993 20:22:15 +0000 |
parents | 5b978bb1bae6 |
children | a5d54ad5cf9a |
files | src/pt-base.h src/symtab.cc src/symtab.h src/tree.h.old |
diffstat | 4 files changed, 22 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/src/pt-base.h +++ b/src/pt-base.h @@ -114,7 +114,7 @@ virtual int is_prefix_expression (void) const { return 0; } - virtual char *name (void) + virtual char *name (void) const { assert (0); return (char *) NULL; } virtual int max_expected_args (void)
--- a/src/symtab.cc +++ b/src/symtab.cc @@ -946,15 +946,17 @@ int status = 0; int count; char **names = list (count, 1, symbol_def::USER_VARIABLE); - if (names != (char **) NULL) + char **ptr = names; + if (ptr != (char **) NULL) { - while (*names != (char *) NULL) + while (*ptr != (char *) NULL) { - if (save (os, *names, mark_as_global)) + if (save (os, *ptr, mark_as_global)) status++; - names++; + ptr++; } + delete [] names; } return status; }
--- a/src/symtab.h +++ b/src/symtab.h @@ -268,6 +268,17 @@ /* * A symbol table. */ + +#define SYMTAB_LOCAL_SCOPE 1 +#define SYMTAB_GLOBAL_SCOPE 2 + +#define SYMTAB_ALL_SCOPES (SYMTAB_LOCAL_SCOPE | SYMTAB_GLOBAL_SCOPE) + +#define SYMTAB_ALL_TYPES (symbol_def::USER_FUNCTION \ + | symbol_def::USER_VARIABLE \ + | symbol_def::BUILTIN_FUNCTION \ + | symbol_def::BUILTIN_VARIABLE) + class symbol_table { @@ -285,16 +296,6 @@ int size (void) const; -#define SYMTAB_LOCAL_SCOPE 1 -#define SYMTAB_GLOBAL_SCOPE 2 - -#define SYMTAB_ALL_SCOPES (SYMTAB_LOCAL_SCOPE | SYMTAB_GLOBAL_SCOPE) - -#define SYMTAB_ALL_TYPES (symbol_def::USER_FUNCTION \ - | symbol_def::USER_VARIABLE \ - | symbol_def::BUILTIN_FUNCTION \ - | symbol_def::BUILTIN_VARIABLE) - symbol_record_info *long_list (int& count, int sort = 0, unsigned type = SYMTAB_ALL_TYPES, unsigned scope = SYMTAB_ALL_SCOPES) const;
--- a/src/tree.h.old +++ b/src/tree.h.old @@ -158,7 +158,7 @@ tree_constant *eval (const tree_constant *args, int n_in, int n_out, int print); - char *name (void); + char *name (void) const; int max_expected_args (void); @@ -187,7 +187,7 @@ int is_identifier (void) const; - char *name (void); + char *name (void) const; void rename (const char *n); tree_identifier *define (tree_constant *t); @@ -552,7 +552,7 @@ tree_parameter_list *reverse (void); int length (void); - char *name (void); + char *name (void) const; void mark_as_formal_parameters (void); @@ -613,7 +613,7 @@ tree_word_list *reverse (void); int length (void); - char *name (void); + char *name (void) const; tree_word_list *next_elem (void);