teapot-spreadsheet/eval.h
Glen Whitney 08b42bf424 Prevent phantom values when clocking, resetting, and clocking again
In the end it turned out that the cause of the phantom values was
  short-cutting in getvalue() when the contents of a cell were empty,
  preventing the update of the internal cache of the value of the cell.

  However, tracking this down (and getting the associated memory management
  correct) necessitated implementing a debugging mode in which I could
  dump the internal states of cells and print various other stuff to standard
  output. It also involved understanding the meaning of various pointers in
  the code, in the process of which I renamed some commonly used macros,
  particularly the former SHEET(s,x,y,z) which was not returning a Sheet at
  all but rather a pointer to a Cell. So this macro is now called CELL_AT. I
  also replaced several very repeatedly used patterns of checking the validity
  of locations and pointers with macros, now defined in sheet.h.

  Therefore, unfortunately the (relatively small in the end) bugfix for this
  major issue is entangled with numerous textual changes to the code made
  in tracking it down.
  Fixes #18.
  Closes #19.
2019-07-24 10:47:39 -07:00

28 lines
668 B
C

#ifndef THE_EVAL_H
#define THE_EVAL_H
#include "scanner.h"
Token tcopy(Token n);
void tfree(Token *n);
void tvecfreetoks(Token **tvec);
void tvecfree(Token **tvec);
size_t tveclen(Token **tvec);
Token tpow(Token l, Token r);
Token tdiv(Token l, Token r);
Token tmod(Token l, Token r);
Token tmul(Token l, Token r);
Token tadd(Token l, Token r);
Token tsub(Token l, Token r);
Token tneg(Token x);
Token tfuncall(Token *ident, int argc, Token argv[]);
Token tlt(Token l, Token r);
Token tle(Token l, Token r);
Token tge(Token l, Token r);
Token tgt(Token l, Token r);
Token teq(Token l, Token r);
Token tabouteq(Token l, Token r);
Token tne(Token l, Token r);
#endif