src/visit.c
double visit_variable(ast_t* node) {

    msg(2, "Visit %s AST node", NT_TOSTR(node->type));
    if(node != NULL) {
        double val;
        const char* name = node->value.var->name;
        if(SYM_NO_ERROR == find_symbol(name, &val))
            return val;
        else {
            error("symbol \"%s\" is not defined", name);
            return NAN; // not a number
        }
    }
    else {
        error("invalid symbol node");
        return NAN; // not a number
    }

    return NAN; // unreachable
}
/*
 * Visit node with a variable from the symbol table.
 */
Visit node with a variable from the symbol table.
Visit node with a variable from the symbol table .
double visit_variable(ast_t* node) {
    msg(2, "Visit %s AST node", NT_TOSTR(node->type));
    if(node != NULL) {
        double val;
        const char* name = node->value.var->name;
        if(SYM_NO_ERROR == find_symbol(name, &val))
            return val;
        else {
            error("symbol \"%s\" is not defined", name);
            return NAN; 
        }
    }
    else {
        error("invalid symbol node");
        return NAN; 
    }
    return NAN; 
}
double visit_variable ( ast_t * node ) { msg ( 2 , " " , NT_TOSTR ( node -> type ) ) ; if ( node != NULL ) { double val ; const char * name = node -> value . var -> name ; if ( SYM_NO_ERROR == find_symbol ( name , & val ) ) return val ; else { error ( " \" \" " , name ) ; return NAN ; } } else { error ( " " ) ; return NAN ; } return NAN ; }
Visit node with a variable from the symbol table.
Visit node with a variable from the symbol table .
// not a number // not a number // unreachable