aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-20 11:42:45 +0000
committer_ov4 <ov4@ov4.org>2026-10-20 11:42:45 +0000
commita3335110dc4f1283cf1680e273cc9775b7e8c8ac (patch)
tree15866ec0503d1edac9a1d9e11c04f7cdc7473d8d /include
parent52e0674c54d4b53b2132e750106cc9acb266ed39 (diff)
feat(lexer): add C_STRING literal suffix
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'include')
-rw-r--r--include/cps/AST.h4
-rw-r--r--include/cps/Lexer.h1
2 files changed, 4 insertions, 1 deletions
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,