step: savepoint while adding more functions.
This commit is contained in:
		
							parent
							
								
									49fdc0d69e
								
							
						
					
					
						commit
						d1420805d7
					
				| 
						 | 
				
			
			@ -459,7 +459,7 @@ lispval* evaluate_lispval(lispval* l)
 | 
			
		|||
    // Check if the first element is an operation.
 | 
			
		||||
    if (l->count >= 2 && ((l->cell[0])->type == LISPVAL_SYM)) {
 | 
			
		||||
        lispval* op = pop_lispval(l, 0);
 | 
			
		||||
        lispval* result = builtin_functions(op->sym, l);
 | 
			
		||||
        lispval* result = builtin_simple_math_ops(op->sym, l);
 | 
			
		||||
        delete_lispval(op);
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -483,7 +483,7 @@ int main(int argc, char** argv)
 | 
			
		|||
    /* Define them with the following Language */
 | 
			
		||||
    mpca_lang(MPCA_LANG_DEFAULT, "                           \
 | 
			
		||||
    number   : /-?[0-9]+\\.?([0-9]+)?/ ;                     \
 | 
			
		||||
    symbol : \"list\" \"head\" \"tail\" \"eval\"             \
 | 
			
		||||
    symbol : \"list\" | \"head\" | \"tail\" | \"eval\"       \
 | 
			
		||||
		       | '+' | '-' | '*' | '/' ;                         \
 | 
			
		||||
		sexpr : '(' <expr>* ')' ;                                \
 | 
			
		||||
		qexpr : '{' <expr>* '}' ;                                \
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user