lex->line++;
else if (ch == '?')
return lex_try_trigraph(lex, ch);
- else if (ch == '<' || ch == ':' || ch == '%')
+ else if (!lex->flags.nodigraphs && (ch == '<' || ch == ':' || ch == '%'))
return lex_try_digraph(lex, ch);
return ch;
}
if (ch == '"')
{
+ lex->flags.nodigraphs = true;
lex->tok.ttype = lex_finish_string(lex, '"');
while (lex->tok.ttype == TOKEN_STRINGCONST)
{
lex->tok.ttype = lex_finish_string(lex, '"');
}
+ lex->flags.nodigraphs = false;
if (!lex_endtoken(lex))
return (lex->tok.ttype = TOKEN_FATAL);
return lex->tok.ttype;
void(string, string) print = %:1;
void() main = ??<
- print("??=??'??(??)??!??<??>??-??/??/", "??/n");
- print("#^[]|{}~\\", "\n");
+ print("??=??'??(??)??!??<??>??-??/??/%>", "??/n");
+ print("#^[]|{}~\\%>", "\n");
%>;