diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-20 11:42:45 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-20 11:42:45 +0000 |
| commit | a3335110dc4f1283cf1680e273cc9775b7e8c8ac (patch) | |
| tree | 15866ec0503d1edac9a1d9e11c04f7cdc7473d8d /include | |
| parent | 52e0674c54d4b53b2132e750106cc9acb266ed39 (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.h | 4 | ||||
| -rw-r--r-- | include/cps/Lexer.h | 1 |
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, |
