Skip to content

Commit 42f253a

Browse files
committed
Allow char literals in the preprocessor expressions
1 parent 5adee36 commit 42f253a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/parser/cxx/preprocessor.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,6 +2691,8 @@ auto Preprocessor::Private::primaryExpression(TokList *&ts) -> long {
26912691

26922692
if (match(ts, TokenKind::T_INTEGER_LITERAL)) {
26932693
return IntegerLiteral::Components::from(tk->text).value;
2694+
} else if (match(ts, TokenKind::T_CHARACTER_LITERAL)) {
2695+
return CharLiteral::Components::from(tk->text).value;
26942696
} else if (match(ts, TokenKind::T_LPAREN)) {
26952697
auto result = conditionalExpression(ts);
26962698
expect(ts, TokenKind::T_RPAREN);

0 commit comments

Comments
 (0)