#include <stdbool.h>
#include <unitypes.h>
#include "libpspp/str.h"
+#include "gl/verify.h"
#define TOKEN_TYPES \
+ TOKEN_TYPE(STOP) /* End of input. */ \
+ \
TOKEN_TYPE(ID) /* Identifier. */ \
TOKEN_TYPE(POS_NUM) /* Positive number. */ \
TOKEN_TYPE(NEG_NUM) /* Negative number. */ \
TOKEN_TYPE(STRING) /* Quoted string. */ \
- TOKEN_TYPE(STOP) /* End of input. */ \
\
TOKEN_TYPE(ENDCMD) /* . */ \
TOKEN_TYPE(PLUS) /* + */ \
TOKEN_TYPE(RPAREN) /* ) */ \
TOKEN_TYPE(LBRACK) /* [ */ \
TOKEN_TYPE(RBRACK) /* ] */ \
+ TOKEN_TYPE(LCURLY) /* { */ \
+ TOKEN_TYPE(RCURLY) /* } */ \
TOKEN_TYPE(COMMA) /* , */ \
+ TOKEN_TYPE(SEMICOLON) /* ; */ \
+ TOKEN_TYPE(COLON) /* : */ \
\
TOKEN_TYPE(AND) /* AND */ \
TOKEN_TYPE(OR) /* OR */ \
TOKEN_TYPES
#undef TOKEN_TYPE
};
+verify(T_STOP == 0);
#define TOKEN_TYPE(TYPE) + 1
enum { TOKEN_N_TYPES = TOKEN_TYPES };
/* Validating identifiers. */
#define ID_MAX_LEN 64 /* Maximum length of identifier, in bytes. */
-bool id_is_valid (const char *id, const char *dict_encoding, bool issue_error);
-bool id_is_plausible (const char *id, bool issue_error);
+bool id_is_valid (const char *id, const char *dict_encoding);
+bool id_is_plausible (const char *id);
+char *id_is_valid__ (const char *id, const char *dict_encoding)
+ WARN_UNUSED_RESULT;
+char *id_is_plausible__ (const char *id) WARN_UNUSED_RESULT;
/* Recognizing identifiers. */
bool lex_is_id1 (char);