shithub: femtolisp

ref: f23a3721b226eac723dc3ac4a1d45571bb878c39
dir: /read.h/

View raw version
#ifndef READ_H
#define READ_H

value_t fl_read_sexpr(value_t f);
int isnumtok_base(char *tok, value_t *pval, int base);
int isnumtok(char *tok, value_t *pval);

// defines which characters are ordinary symbol characters.
// exceptions are '.', which is an ordinary symbol character
// unless it's the only character in the symbol, and '#', which is
// an ordinary symbol character unless it's the first character.
inline int
symchar(char c)
{
        //static char *special = "()[]'\";`,\\| \a\b\f\n\r\t\v";
        char *special = "()[]'\";`,\\| \a\b\f\n\r\t\v";
        return !strchr(special, c);
}

#endif