jinni.c
/**
 * Parse input until it finds a whitespace (not in a string),
 * a newline char or end of input.
 */
Parse input until it finds a whitespace (not in a string),
a newline char or end of input.
Parse input until it finds a whitespace ( not in a string ) a newline char or end of input .
S_Expr *parse_input(char *input_str, int *consumed)
{
  if (*input_str == '\0')
    return NULL;
  char *p = input_str;
  if ((*p == 'T' || *p == 'F') &&
        ((*(p + 1) == '\0' || *(p + 1) == '\n') || *(p + 1) == ' ')) {
    return parse_bool_atom(p, consumed);
  } else if (*p == '(') {
    return parse_list(p, consumed);
  } else if (*p == '"') {
    return parse_string(p, consumed);
  } else if (*p >= '0' && *p <= '9') {
    return parse_number(p, consumed);
  } else {
    return parse_symbol(p, consumed);
  }
  return NULL;
}
S_Expr * parse_input ( char * input_str , int * consumed ) { if ( * input_str == ' \0 ' ) return NULL ; char * p = input_str ; if ( ( * p == ' ' || * p == ' ' ) && ( ( * ( p + 1 ) == ' \0 ' || * ( p + 1 ) == ' \n ' ) || * ( p + 1 ) == ' ' ) ) { return parse_bool_atom ( p , consumed ) ; } else if ( * p == ' ' ) { return parse_list ( p , consumed ) ; } else if ( * p == ' ' ) { return parse_string ( p , consumed ) ; } else if ( * p >= ' ' && * p <= ' ' ) { return parse_number ( p , consumed ) ; } else { return parse_symbol ( p , consumed ) ; } return NULL ; }
Parse input until it finds a whitespace (not in a string),
 a newline char or end of input.
Parse input until it finds a whitespace ( not in a string ) a newline char or end of input .
// catch-all for symbols