BAS: More name compatibility changes
This commit is contained in:
parent
6e013e76fc
commit
799de0c6b5
@ -140,7 +140,7 @@ static enum
|
||||
} g_pass;
|
||||
|
||||
static int g_stopped;
|
||||
static int optionbase;
|
||||
static int g_optionbase;
|
||||
static struct Pc g_pc;
|
||||
static struct Auto g_stack;
|
||||
static struct Program g_program;
|
||||
@ -1539,7 +1539,7 @@ static void new(void)
|
||||
Program_destroy(&g_program);
|
||||
Program_new(&g_program);
|
||||
FS_closefiles();
|
||||
optionbase = 0;
|
||||
g_optionbase = 0;
|
||||
}
|
||||
|
||||
static void pushLabel(enum labeltype_e type, struct Pc *patch)
|
||||
@ -1917,7 +1917,7 @@ static struct Value *compileProgram(struct Value *v, int clearGlobals)
|
||||
g_lastdata = &g_stack.begindata;
|
||||
}
|
||||
|
||||
optionbase = 0;
|
||||
g_optionbase = 0;
|
||||
g_stopped = 0;
|
||||
g_program.runnable = 1;
|
||||
g_pc = begin;
|
||||
@ -1989,7 +1989,7 @@ static void runline(struct Token *line)
|
||||
g_curdata.line = -1;
|
||||
g_pc.line = -1;
|
||||
g_pc.token = line;
|
||||
optionbase = 0;
|
||||
g_optionbase = 0;
|
||||
g_stopped = 0;
|
||||
statements(&value);
|
||||
if (value.type != V_ERROR && g_pc.token->type != T_EOL)
|
||||
@ -2029,7 +2029,7 @@ static void runline(struct Token *line)
|
||||
|
||||
g_pc.line = -1;
|
||||
g_pc.token = line;
|
||||
optionbase = 0;
|
||||
g_optionbase = 0;
|
||||
g_curdata = g_stack.begindata;
|
||||
g_nextdata.line = -1;
|
||||
Value_destroy(&value);
|
||||
@ -2092,14 +2092,14 @@ static struct Value *evalGeometry(struct Value *value, unsigned int *dim,
|
||||
return value;
|
||||
}
|
||||
|
||||
if (g_pass == INTERPRET && value->u.integer < optionbase)
|
||||
if (g_pass == INTERPRET && value->u.integer < g_optionbase)
|
||||
{
|
||||
Value_destroy(value);
|
||||
g_pc = exprpc;
|
||||
return Value_new_ERROR(value, OUTOFRANGE, _("dimension"));
|
||||
}
|
||||
|
||||
geometry[0] = value->u.integer - optionbase + 1;
|
||||
geometry[0] = value->u.integer - g_optionbase + 1;
|
||||
Value_destroy(value);
|
||||
if (g_pc.token->type == T_COMMA)
|
||||
{
|
||||
@ -2111,14 +2111,14 @@ static struct Value *evalGeometry(struct Value *value, unsigned int *dim,
|
||||
return value;
|
||||
}
|
||||
|
||||
if (g_pass == INTERPRET && value->u.integer < optionbase)
|
||||
if (g_pass == INTERPRET && value->u.integer < g_optionbase)
|
||||
{
|
||||
Value_destroy(value);
|
||||
g_pc = exprpc;
|
||||
return Value_new_ERROR(value, OUTOFRANGE, _("dimension"));
|
||||
}
|
||||
|
||||
geometry[1] = value->u.integer - optionbase + 1;
|
||||
geometry[1] = value->u.integer - g_optionbase + 1;
|
||||
Value_destroy(value);
|
||||
*dim = 2;
|
||||
}
|
||||
|
@ -907,7 +907,7 @@ struct Value *stmt_DIM(struct Value *value)
|
||||
return value;
|
||||
}
|
||||
|
||||
if (g_pass == INTERPRET && value->u.integer < optionbase) /* error */
|
||||
if (g_pass == INTERPRET && value->u.integer < g_optionbase) /* error */
|
||||
{
|
||||
Value_destroy(value);
|
||||
Value_new_ERROR(value, OUTOFRANGE, _("dimension"));
|
||||
@ -937,7 +937,7 @@ struct Value *stmt_DIM(struct Value *value)
|
||||
geometry = more;
|
||||
}
|
||||
|
||||
geometry[dim] = value->u.integer - optionbase + 1;
|
||||
geometry[dim] = value->u.integer - g_optionbase + 1;
|
||||
++dim;
|
||||
}
|
||||
|
||||
@ -968,7 +968,7 @@ struct Value *stmt_DIM(struct Value *value)
|
||||
struct Var newarray;
|
||||
|
||||
assert(capacity);
|
||||
if (Var_new(&newarray, vartype, dim, geometry, optionbase) ==
|
||||
if (Var_new(&newarray, vartype, dim, geometry, g_optionbase) ==
|
||||
(struct Var *)0)
|
||||
{
|
||||
free(geometry);
|
||||
@ -3296,7 +3296,7 @@ struct Value *stmt_MAT(struct Value *value)
|
||||
if (g_pass == INTERPRET)
|
||||
{
|
||||
Var_destroy(var1);
|
||||
Var_new(var1, vartype, dim, geometry, optionbase);
|
||||
Var_new(var1, vartype, dim, geometry, g_optionbase);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3529,7 +3529,7 @@ struct Value *stmt_MATINPUT(struct Value *value)
|
||||
if (g_pass == INTERPRET)
|
||||
{
|
||||
Var_destroy(var);
|
||||
Var_new(var, vartype, dim, geometry, optionbase);
|
||||
Var_new(var, vartype, dim, geometry, g_optionbase);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3859,7 +3859,7 @@ struct Value *stmt_MATREAD(struct Value *value)
|
||||
if (g_pass == INTERPRET)
|
||||
{
|
||||
Var_destroy(var);
|
||||
Var_new(var, vartype, dim, geometry, optionbase);
|
||||
Var_new(var, vartype, dim, geometry, g_optionbase);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4796,7 +4796,7 @@ struct Value *stmt_OPTIONBASE(struct Value *value)
|
||||
|
||||
if (g_pass == INTERPRET)
|
||||
{
|
||||
optionbase = value->u.integer;
|
||||
g_optionbase = value->u.integer;
|
||||
}
|
||||
|
||||
Value_destroy(value);
|
||||
|
@ -1403,11 +1403,11 @@ char *yytext;
|
||||
#include "token.h"
|
||||
#include "statement.h"
|
||||
|
||||
static int matchdata;
|
||||
static int backslash_colon;
|
||||
static int uppercase;
|
||||
int yylex(void);
|
||||
static int g_matchdata;
|
||||
static int g_backslash_colon;
|
||||
static int g_uppercase;
|
||||
static struct Token *cur;
|
||||
int yylex(void);
|
||||
|
||||
static void string(const char *text) /*{{{*/
|
||||
{
|
||||
@ -1673,7 +1673,7 @@ YY_DECL
|
||||
#line 102 "token.l"
|
||||
|
||||
/* flex rules */ /*{{{*/
|
||||
if (matchdata) BEGIN(DATAINPUT);
|
||||
if (g_matchdata) BEGIN(DATAINPUT);
|
||||
|
||||
#line 1683 "<stdout>"
|
||||
|
||||
@ -1872,7 +1872,7 @@ case 15:
|
||||
YY_RULE_SETUP
|
||||
#line 180 "token.l"
|
||||
{
|
||||
if (backslash_colon)
|
||||
if (g_backslash_colon)
|
||||
{
|
||||
if (cur) cur->statement=stmt_COLON_EOL;
|
||||
return T_COLON;
|
||||
@ -4674,7 +4674,7 @@ void yyfree (void * ptr )
|
||||
|
||||
|
||||
|
||||
int Token_property[T_LASTTOKEN];
|
||||
int g_token_property[T_LASTTOKEN];
|
||||
|
||||
struct Token *Token_newCode(const char *ln) /*{{{*/
|
||||
{
|
||||
@ -4685,7 +4685,7 @@ struct Token *Token_newCode(const char *ln) /*{{{*/
|
||||
cur=(struct Token*)0;
|
||||
buf=yy_scan_string(ln);
|
||||
/* determine number of tokens */ /*{{{*/
|
||||
matchdata=sawif=0;
|
||||
g_matchdata=sawif=0;
|
||||
for (lasttok=T_EOL,l=1; (thistok=yylex()); ++l)
|
||||
{
|
||||
if (l==1 && thistok!=T_INTEGER) { addNumber=1; ++l; }
|
||||
@ -4706,7 +4706,7 @@ struct Token *Token_newCode(const char *ln) /*{{{*/
|
||||
}
|
||||
buf=yy_scan_string(ln);
|
||||
lasttok=T_EOL;
|
||||
matchdata=sawif=0;
|
||||
g_matchdata=sawif=0;
|
||||
while (cur->statement=NULL,(cur->type=yylex()))
|
||||
{
|
||||
if (cur->type==T_IF) sawif=1;
|
||||
@ -4747,12 +4747,12 @@ struct Token *Token_newData(const char *ln) /*{{{*/
|
||||
|
||||
cur=(struct Token*)0;
|
||||
buf=yy_scan_string(ln);
|
||||
matchdata=1;
|
||||
g_matchdata=1;
|
||||
for (l=1; yylex(); ++l);
|
||||
yy_delete_buffer(buf);
|
||||
cur=result=malloc(sizeof(struct Token)*l);
|
||||
buf=yy_scan_string(ln);
|
||||
matchdata=1;
|
||||
g_matchdata=1;
|
||||
while (cur->statement=NULL,(cur->type=yylex())) ++cur;
|
||||
cur->type=T_EOL;
|
||||
cur->statement=stmt_COLON_EOL;
|
||||
@ -5317,7 +5317,7 @@ struct String *Token_toString(struct Token *token, struct Token *spaceto, struct
|
||||
if ((token->u.real<((double)LONG_MIN)) || (token->u.real>((double)LONG_MAX))) String_appendChar(s,'!');
|
||||
break;
|
||||
}
|
||||
case T_REM: String_appendPrintf(s,"%s%s",uppercase?"REM":"rem",token->u.rem); break;
|
||||
case T_REM: String_appendPrintf(s,"%s%s",g_uppercase?"REM":"rem",token->u.rem); break;
|
||||
case T_QUOTE: String_appendPrintf(s,"'%s",token->u.rem); break;
|
||||
case T_STRING: /*{{{*/
|
||||
{
|
||||
@ -5337,7 +5337,7 @@ struct String *Token_toString(struct Token *token, struct Token *spaceto, struct
|
||||
/*}}}*/
|
||||
default:
|
||||
{
|
||||
if (uppercase)
|
||||
if (g_uppercase)
|
||||
{
|
||||
struct String u;
|
||||
|
||||
@ -5360,10 +5360,10 @@ struct String *Token_toString(struct Token *token, struct Token *spaceto, struct
|
||||
void Token_init(int b_c, int uc) /*{{{*/
|
||||
{
|
||||
#define PROPERTY(t,assoc,unary_priority,binary_priority,is_unary,is_binary) \
|
||||
Token_property[t]=(assoc<<8)|(unary_priority<<5)|(binary_priority<<2)|(is_unary<<1)|is_binary
|
||||
g_token_property[t]=(assoc<<8)|(unary_priority<<5)|(binary_priority<<2)|(is_unary<<1)|is_binary
|
||||
|
||||
backslash_colon=b_c;
|
||||
uppercase=uc;
|
||||
g_backslash_colon=b_c;
|
||||
g_uppercase=uc;
|
||||
PROPERTY(T_POW, 1,0,7,0,1);
|
||||
PROPERTY(T_MULT, 0,0,5,0,1);
|
||||
PROPERTY(T_DIV, 0,0,5,0,1);
|
||||
|
@ -71,11 +71,11 @@
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define TOKEN_ISBINARYOPERATOR(t) (Token_property[t]&1)
|
||||
#define TOKEN_ISUNARYOPERATOR(t) (Token_property[t]&(1<<1))
|
||||
#define TOKEN_BINARYPRIORITY(t) ((Token_property[t]>>2)&7)
|
||||
#define TOKEN_UNARYPRIORITY(t) ((Token_property[t]>>5)&7)
|
||||
#define TOKEN_ISRIGHTASSOCIATIVE(t) (Token_property[t]&(1<<8))
|
||||
#define TOKEN_ISBINARYOPERATOR(t) (g_token_property[t]&1)
|
||||
#define TOKEN_ISUNARYOPERATOR(t) (g_token_property[t]&(1<<1))
|
||||
#define TOKEN_BINARYPRIORITY(t) ((g_token_property[t]>>2)&7)
|
||||
#define TOKEN_UNARYPRIORITY(t) ((g_token_property[t]>>5)&7)
|
||||
#define TOKEN_ISRIGHTASSOCIATIVE(t) (g_token_property[t]&(1<<8))
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
@ -530,7 +530,7 @@ struct Token
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
extern int Token_property[];
|
||||
extern int g_token_property[];
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user