X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fidentifier.h;h=b7affdb192823f094994c6c662ffa0a3e992b2df;hb=794fc7f31c6748f0f19db7d9b5e8345f00db86c3;hp=bf20f9cc912dad0c8405b6a6bbd77a7e6b8bb520;hpb=1b3322acf30d531cefe3cdbf7287ec8cde601bcd;p=pspp diff --git a/src/data/identifier.h b/src/data/identifier.h index bf20f9cc91..b7affdb192 100644 --- a/src/data/identifier.h +++ b/src/data/identifier.h @@ -35,8 +35,8 @@ TOKEN_TYPE(ASTERISK) /* * */ \ TOKEN_TYPE(SLASH) /* / */ \ TOKEN_TYPE(EQUALS) /* = */ \ - TOKEN_TYPE(LPAREN) /* ( */ \ - TOKEN_TYPE(RPAREN) /* ) */ \ + TOKEN_TYPE(LPAREN) /* (*/ \ + TOKEN_TYPE(RPAREN) /*) */ \ TOKEN_TYPE(LBRACK) /* [ */ \ TOKEN_TYPE(RBRACK) /* ] */ \ TOKEN_TYPE(COMMA) /* , */ \ @@ -74,6 +74,12 @@ const char *token_type_to_string (enum token_type); /* Tokens. */ bool lex_is_keyword (enum token_type); +/* 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); + /* Recognizing identifiers. */ bool lex_is_id1 (char); bool lex_is_idn (char); @@ -88,7 +94,4 @@ bool lex_id_match_n (struct substring keyword, struct substring token, size_t n); int lex_id_to_token (struct substring); -/* Identifier names. */ -const char *lex_id_name (enum token_type); - #endif /* !data/identifier.h */