X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=lexer.c;h=f345e47be5b8dfc7589a84abe03e38ef967a91ce;hp=abb3e33ef27f054eb40cfe3ad1ddcba5ca50a7fc;hb=36c5722273f1ea87603621c6ee20b7178a7a641b;hpb=e149551744569b16237b7220970ec2a8d40f9935 diff --git a/lexer.c b/lexer.c index abb3e33..f345e47 100644 --- a/lexer.c +++ b/lexer.c @@ -291,12 +291,16 @@ static int lex_try_trigraph(lex_file *lex, int old) { int c2, c3; c2 = lex_fgetc(lex); + if (!lex->push_line && c2 == '\n') + lex->line++; if (c2 != '?') { lex_ungetch(lex, c2); return old; } c3 = lex_fgetc(lex); + if (!lex->push_line && c3 == '\n') + lex->line++; switch (c3) { case '=': return '#'; case '/': return '\\'; @@ -1383,7 +1387,7 @@ int lex_do(lex_file *lex) if (!strcmp(v, keywords_qc[kw])) return (lex->tok.ttype = TOKEN_KEYWORD); } - if (opts.standard != COMPILER_QCC) { + if (OPTS_OPTION_U32(OPTION_STANDARD) != COMPILER_QCC) { for (kw = 0; kw < num_keywords_fg; ++kw) { if (!strcmp(v, keywords_fg[kw])) return (lex->tok.ttype = TOKEN_KEYWORD);