"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "codegen.c" between
calc-2.12.7.2.tar.bz2 and calc-2.12.7.6.tar.bz2

About: Calc is a C-style arbitrary precision calculator.

codegen.c  (calc-2.12.7.2.tar.bz2):codegen.c  (calc-2.12.7.6.tar.bz2)
skipping to change at line 1015 skipping to change at line 1015
if (gettoken() == T_RIGHTBRACE) { if (gettoken() == T_RIGHTBRACE) {
rescantoken(); rescantoken();
return; return;
} }
rescantoken(); rescantoken();
getstatement(contlabel, breaklabel, getstatement(contlabel, breaklabel,
NULL_LABEL, NULL_LABEL); NULL_LABEL, NULL_LABEL);
return; return;
} }
reread(); reread();
/* fall into default case */ /*FALLTHRU*/
default: default:
rescantoken(); rescantoken();
type = getexprlist(); type = getexprlist();
if (contlabel || breaklabel || (curfunc->f_name[0] != '*')) { if (contlabel || breaklabel || (curfunc->f_name[0] != '*')) {
addop(OP_POP); addop(OP_POP);
break; break;
} }
addop(OP_SAVE); addop(OP_SAVE);
if (isassign(type) || (curfunc->f_name[1] != '\0')) { if (isassign(type) || (curfunc->f_name[1] != '\0')) {
skipping to change at line 1373 skipping to change at line 1373
rescantoken(); rescantoken();
if (++dim > MAXDIM) { if (++dim > MAXDIM) {
scanerror(T_SEMICOLON, scanerror(T_SEMICOLON,
"Only %d dimensions allowed", MAXDIM); "Only %d dimensions allowed", MAXDIM);
return; return;
} }
(void) getopassignment(); (void) getopassignment();
switch (gettoken()) { switch (gettoken()) {
case T_RIGHTBRACKET: case T_RIGHTBRACKET:
rescantoken(); rescantoken();
/*FALLTHRU*/
case T_COMMA: case T_COMMA:
addop(OP_ONE); addop(OP_ONE);
addop(OP_SUB); addop(OP_SUB);
addop(OP_ZERO); addop(OP_ZERO);
break; break;
case T_COLON: case T_COLON:
(void) getopassignment(); (void) getopassignment();
switch(gettoken()) { switch(gettoken()) {
case T_RIGHTBRACKET: case T_RIGHTBRACKET:
rescantoken(); rescantoken();
/*FALLTHRU*/
case T_COMMA: case T_COMMA:
continue; continue;
} }
/*FALLTHRU*/ /*FALLTHRU*/
default: default:
rescantoken(); rescantoken();
scanerror(T_SEMICOLON, scanerror(T_SEMICOLON,
"Illegal matrix definition"); "Illegal matrix definition");
return; return;
} }
skipping to change at line 2183 skipping to change at line 2185
type = 0; type = 0;
break; break;
case T_PERIOD: case T_PERIOD:
getelement(); getelement();
type = 0; type = 0;
break; break;
case T_LEFTPAREN: case T_LEFTPAREN:
scanerror(T_NULL, scanerror(T_NULL,
"Function calls not allowed " "Function calls not allowed "
"as expressions"); "as expressions");
/*FALLTHRU*/
default: default:
rescantoken(); rescantoken();
return type; return type;
} }
} }
} }
return type; return type;
} }
/* /*
skipping to change at line 2219 skipping to change at line 2222
case T_LEFTPAREN: case T_LEFTPAREN:
oldmode = tokenmode(TM_DEFAULT); oldmode = tokenmode(TM_DEFAULT);
getcallargs(name); getcallargs(name);
(void) tokenmode(oldmode); (void) tokenmode(oldmode);
type = 0; type = 0;
break; break;
case T_ASSIGN: case T_ASSIGN:
if (autodef != T_GLOBAL && autodef != T_LOCAL && if (autodef != T_GLOBAL && autodef != T_LOCAL &&
autodef != T_STATIC) autodef != T_STATIC)
autodef = 1; autodef = 1;
/* fall into default case */ /*FALLTHRU*/
default: default:
rescantoken(); rescantoken();
usesymbol(name, autodef); usesymbol(name, autodef);
} }
/* /*
* Now collect as many element references and matrix index operations * Now collect as many element references and matrix index operations
* as there are following the id. * as there are following the id.
*/ */
for (;;) { for (;;) {
switch (gettoken()) { switch (gettoken()) {
skipping to change at line 2248 skipping to change at line 2251
addop(OP_DEREF); addop(OP_DEREF);
/*FALLTHRU*/ /*FALLTHRU*/
case T_PERIOD: case T_PERIOD:
getelement(); getelement();
type = 0; type = 0;
break; break;
case T_LEFTPAREN: case T_LEFTPAREN:
scanerror(T_NULL, scanerror(T_NULL,
"Function calls not allowed " "Function calls not allowed "
"as expressions"); "as expressions");
/*FALLTHRU*/
default: default:
rescantoken(); rescantoken();
return type; return type;
} }
} }
} }
/* /*
* getsymvalue - return the VALUE of a symbol * getsymvalue - return the VALUE of a symbol
* *
 End of changes. 6 change blocks. 
2 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)