Mercurial > hg > octave-terminal
changeset 122:80f682c2da33
[project @ 1993-09-21 20:38:16 by jwe]
(symbol_record::symbol_record ()): Initialize forced_global.
(symbol_record::clear_visible ()): Reset forced_global to zero.
(symbol_record::clear_all )): Ditto.
(symbol_record::mark_as_forced_global ()): New function.
(symbol_record::is_forced_global ()): New function.
(symbol_record::alias ()): Also copy forced_global attribute.
author | jwe |
---|---|
date | Tue, 21 Sep 1993 20:38:16 +0000 |
parents | 659b6f4996da |
children | 174de3807b61 |
files | src/symtab.cc |
diffstat | 1 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/symtab.cc +++ b/src/symtab.cc @@ -132,6 +132,7 @@ { nm = (char *) NULL; formal_param = 0; + forced_global = 0; var = (symbol_def *) NULL; fcn = (symbol_def *) NULL; sv_fcn = (sv_Function) NULL; @@ -142,6 +143,7 @@ { nm = strsave (n); formal_param = 0; + forced_global = 0; var = (symbol_def *) NULL; fcn = (symbol_def *) NULL; sv_fcn = (sv_Function) NULL; @@ -152,6 +154,7 @@ { nm = strsave (n); formal_param = 0; + forced_global = 0; var = (symbol_def *) NULL; fcn = (symbol_def *) NULL; sv_fcn = (sv_Function) NULL; @@ -430,6 +433,7 @@ if (--var->count <= 0) delete var; var = (symbol_def *) NULL; + forced_global = 0; } else if (fcn != (symbol_def *) NULL && fcn->lifespan != symbol_def::eternal) { @@ -447,6 +451,7 @@ if (--var->count <= 0) delete var; var = (symbol_def *) NULL; + forced_global = 0; } if (fcn != (symbol_def *) NULL && fcn->lifespan != symbol_def::eternal) @@ -488,11 +493,24 @@ } void +symbol_record::mark_as_forced_global (void) +{ + forced_global = 1; +} + +int +symbol_record::is_forced_global (void) +{ + return forced_global; +} + +void symbol_record::alias (symbol_record *s, int force = 0) { sv_fcn = s->sv_fcn; // Maybe this should go in the var symbol_def? formal_param = s->formal_param; // Hmm. + forced_global = s->forced_global; // Hmm. if (force && s->var == (symbol_def *) NULL && s->fcn == (symbol_def *) NULL)