Commit Graph

5 Commits

Author SHA1 Message Date
Glen Whitney a56efa0c91 Prepare for parsing expressions into parse trees
Prior to this change, every evaluation re-parses the expression. The
  intermediate form as a parse tree is never stored anywhere. This change
  adds a new token type, FUNCALL, which acts as a node in a parse tree, and
  adds an (untested) evaluation method which returns the unevaluated parse tree
  as opposed to evaluating as it goes.

  This is preparation for a following step in which rather than storing a token
  sequence for each variety of content, teapot will store a single token
  representing the parse tree, allowing for quicker evaluation when the time
  comes; no actual parsing will have to occur on evaluation.
2019-08-05 16:45:04 -04:00
Glen Whitney 26ea0e05b3 Extend sum() to cover the case of just adding up all of its arguments.
Also a small amount of preparation of storing parse trees instead of
  linear sequences of tokens got mixed in here, namely a new type of
  token called a "FUNCALL".
2019-08-03 16:29:00 -04:00
Glen Whitney 341b12ba04 Implement a relative reference robust to source and reference moving
The new function is X(SRC,REF), which briefly for a cell in the neighborhood
   of REF returns the corresponding cell in the neighborhood in SRC. For
   further details, see the updated documention.

   In developing and documenting this function, I refined some of the
   existing error messages (e.g. showing the coordinates when there is an
   attempt to obtain a cell with a negative coordinate) and improved the
   error propagation to increase the chance that the innermost error will
   percolate to the top level.
2019-07-30 15:07:54 -04:00
Glen Whitney ab1a2fbb5a Fix relative addressing 2019-07-29 14:33:47 -04:00
Glen Whitney ea230efc23 Move source code into subdirectory
Also removed a stray copy of the automatically generated config.h which
  had somehow gotten into the distribution. Closes #36.
2019-07-27 01:35:44 -04:00