From a3335110dc4f1283cf1680e273cc9775b7e8c8ac Mon Sep 17 00:00:00 2001 From: _ov4 Date: Tue, 20 Oct 2026 11:42:45 +0000 Subject: feat(lexer): add C_STRING literal suffix Co-Authored-By: Claude Opus 5.5 --- include/cps/AST.h | 4 +++- include/cps/Lexer.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/cps/AST.h b/include/cps/AST.h index 2b78aaa..bb6d090 100644 --- a/include/cps/AST.h +++ b/include/cps/AST.h @@ -51,9 +51,11 @@ public: class StringExprAST : public ExprAST { std::string Val; + bool CString; public: - StringExprAST(const std::string &Val) : Val(Val) {} + StringExprAST(const std::string &Val, bool CString = false) : Val(Val), CString(CString) {} const std::string &getVal() const { return Val; } + bool isCString() const { return CString; } }; class VariableExprAST : public ExprAST { diff --git a/include/cps/Lexer.h b/include/cps/Lexer.h index 588a5fa..b514904 100644 --- a/include/cps/Lexer.h +++ b/include/cps/Lexer.h @@ -49,6 +49,7 @@ enum Token { tok_string_kw = -30, tok_string_literal = -36, + tok_c_string_literal = -37, tok_char_kw = -38, tok_char_literal = -39, -- cgit v1.3.1-4-g156e