in progress commit

- added vars to lib
- fixed adders and getters to both vtable and ftable
- made function operations a dual type (enum)
- prototyped calling of stored external ASTs with
arguments (additional operation type
- stub for eval
- added index function to Cell
This commit is contained in:
Aidan 2021-02-14 16:33:17 -08:00
parent 61e3985592
commit d2f60314f9
No known key found for this signature in database
GPG key ID: 327711E983899316
6 changed files with 162 additions and 54 deletions

View file

@ -23,10 +23,6 @@ const UNMATCHED_LIST_DELIM: &str = "Unmatched list delimiter in input";
/* takes a line of user input
* returns an unsimplified tree of tokens.
*
* WARNING: lex and process ONLY SUPPORT ASCII CHARACTERS.
* Unicode and other technology where one rune can take multiple indexes
* can cause havoc if part of a rune matches a whitespace or other operator
*/
pub fn lex(document: String) -> Result<Box<Cell>, String> {
if !document.is_ascii() {
@ -46,8 +42,6 @@ pub fn lex(document: String) -> Result<Box<Cell>, String> {
/* The logic used in lex
* Returns Ok(Box<Cell>) if lexing passes
* Returns Err(String) if an error occurs
*
* WARNING: read docs for lex
*/
fn process(document: String) -> Result<Box<Cell>, String> {
let doc_len = document.len();