{
lex->tok.ttype = TOKEN_VECTORCONST;
}
+ else
+ {
+ if (!lex->flags.preprocessing && strlen(lex->tok.value) > 1) {
+ if (lexwarn(lex, WARN_MULTIBYTE_CHARACTER, "multibyte character: `%s`", lex->tok.value))
+ return (lex->tok.ttype = TOKEN_ERROR);
+ }
+ lex->tok.constval.i = lex->tok.value[0];
+ }
return lex->tok.ttype;
}
options_set(opts_warn, WARN_PREPROCESSOR, true);
options_set(opts_warn, WARN_MULTIFILE_IF, true);
options_set(opts_warn, WARN_DOUBLE_DECLARATION, true);
+ options_set(opts_warn, WARN_CONST_VAR, true);
+ options_set(opts_warn, WARN_MULTIBYTE_CHARACTER, true);
options_set(opts_flags, ADJUST_VECTOR_FIELDS, true);
options_set(opts_flags, FTEPP, false);
GMQCC_DEFINE_FLAG(MULTIFILE_IF)
GMQCC_DEFINE_FLAG(DOUBLE_DECLARATION)
GMQCC_DEFINE_FLAG(CONST_VAR)
+ GMQCC_DEFINE_FLAG(MULTIBYTE_CHARACTER)
#endif
/* some cleanup so we don't have to */
vec_push(sy.out, syexp(parser_ctx(parser), (ast_expression*)val));
DEBUGSHUNTDO(con_out("push %g\n", parser_token(parser)->constval.f));
}
- else if (parser->tok == TOKEN_INTCONST) {
+ else if (parser->tok == TOKEN_INTCONST || parser->tok == TOKEN_CHARCONST) {
ast_value *val;
if (wantop) {
parseerror(parser, "expected operator or end of statement, got constant");