aboutsummaryrefslogtreecommitdiff
path: root/lib/Parser
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Parser')
-rw-r--r--lib/Parser/ParserControlFlow.cc2
-rw-r--r--lib/Parser/ParserExpression.cc4
-rw-r--r--lib/Parser/ParserType.cc2
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/Parser/ParserControlFlow.cc b/lib/Parser/ParserControlFlow.cc
index 10dd512..8ca024d 100644
--- a/lib/Parser/ParserControlFlow.cc
+++ b/lib/Parser/ParserControlFlow.cc
@@ -157,7 +157,7 @@ bool Parser::isCaseLabel() {
case '(': case '[': ++Depth; break;
case ')': case ']': if (--Depth < 0) return false; break;
case tok_identifier: case tok_number_int: case tok_number_real:
- case tok_string_literal: case tok_char_literal: case tok_true: case tok_false:
+ case tok_string_literal: case tok_c_string_literal: case tok_char_literal: case tok_true: case tok_false:
case tok_integer_kw: case tok_real_kw: case tok_boolean_kw:
case tok_string_kw: case tok_char_kw: case tok_c_int: case tok_c_char:
case tok_c_string: case tok_c_double:
diff --git a/lib/Parser/ParserExpression.cc b/lib/Parser/ParserExpression.cc
index 7558c86..be22b4e 100644
--- a/lib/Parser/ParserExpression.cc
+++ b/lib/Parser/ParserExpression.cc
@@ -216,8 +216,8 @@ std::unique_ptr<ExprAST> Parser::ParsePrimaryImpl() {
case tok_identifier: case tok_operator: return ParseIdentifierExpr();
case tok_number_int: return ParseNumberExpr();
case tok_number_real: return ParseNumberExpr();
- case tok_string_literal: {
- auto Res = std::make_unique<StringExprAST>(Lex.StringVal);
+ case tok_string_literal: case tok_c_string_literal: {
+ auto Res = std::make_unique<StringExprAST>(Lex.StringVal, CurTok == tok_c_string_literal);
getNextToken();
return Res;
}
diff --git a/lib/Parser/ParserType.cc b/lib/Parser/ParserType.cc
index d281293..e3adc5b 100644
--- a/lib/Parser/ParserType.cc
+++ b/lib/Parser/ParserType.cc
@@ -346,7 +346,7 @@ std::unique_ptr<StmtAST> Parser::ParseConstant() {
if (Negative) getNextToken();
bool Numeric = CurTok == tok_number_int || CurTok == tok_number_real;
bool Literal = Numeric || CurTok == tok_true || CurTok == tok_false ||
- CurTok == tok_string_literal || CurTok == tok_char_literal;
+ CurTok == tok_string_literal || CurTok == tok_c_string_literal || CurTok == tok_char_literal;
if (!Literal || (Negative && !Numeric)) {
cps::sourceDiagnostic(Lex.getLine(), "error: CONSTANT initializer must be a literal at line %d\n", Line);
return nullptr;