diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-16 13:21:05 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-16 13:21:05 +0000 |
| commit | e44bdc6a2a0cf624b08046ecc7e5c5d5d9d2d66c (patch) | |
| tree | f5276cc0dd2f34e4d30a58f80223912265a1c5a0 /include/cps/FileAST.h | |
| parent | e1e789ac0249149a4aa1671f5f9260d488cb617a (diff) | |
fix(compiler): correct CIE semantics and diagnostic locations
Use standard WHILE headers and default-public class fields, resolve
pseudocode identifiers without case sensitivity, and check signed i64
literal boundaries before conversion. Preserve source locations across
recursive emission and function diagnostics.
Add 22 regression cases and update compiler examples and documentation.
Validated all 69 CTest entries with the original Linux Actions seed and
verified the release package's embedded, native and IR output paths.
Diffstat (limited to 'include/cps/FileAST.h')
| -rw-r--r-- | include/cps/FileAST.h | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/include/cps/FileAST.h b/include/cps/FileAST.h index 04bd06a..a151597 100644 --- a/include/cps/FileAST.h +++ b/include/cps/FileAST.h @@ -9,55 +9,47 @@ namespace cps { class OpenFileStmtAST : public StmtAST { std::unique_ptr<ExprAST> FileName; FileMode Mode; - int Line; public: OpenFileStmtAST(std::unique_ptr<ExprAST> FileName, FileMode Mode, int Line) - : FileName(std::move(FileName)), Mode(Mode), Line(Line) {} + : StmtAST(Line), FileName(std::move(FileName)), Mode(Mode) {} ExprAST *getFileName() const { return FileName.get(); } FileMode getMode() const { return Mode; } - int getLine() const { return Line; } }; class ReadFileStmtAST : public StmtAST { std::unique_ptr<ExprAST> FileName; std::string VarName; - int Line; public: ReadFileStmtAST(std::unique_ptr<ExprAST> FileName, const std::string &VarName, int Line) - : FileName(std::move(FileName)), VarName(VarName), Line(Line) {} + : StmtAST(Line), FileName(std::move(FileName)), VarName(VarName) {} ExprAST *getFileName() const { return FileName.get(); } const std::string &getVarName() const { return VarName; } - int getLine() const { return Line; } }; class WriteFileStmtAST : public StmtAST { std::unique_ptr<ExprAST> FileName; std::unique_ptr<ExprAST> Data; - int Line; public: WriteFileStmtAST(std::unique_ptr<ExprAST> FileName, std::unique_ptr<ExprAST> Data, int Line) - : FileName(std::move(FileName)), Data(std::move(Data)), Line(Line) {} + : StmtAST(Line), FileName(std::move(FileName)), Data(std::move(Data)) {} ExprAST *getFileName() const { return FileName.get(); } ExprAST *getData() const { return Data.get(); } - int getLine() const { return Line; } }; class CloseFileStmtAST : public StmtAST { std::unique_ptr<ExprAST> FileName; - int Line; public: CloseFileStmtAST(std::unique_ptr<ExprAST> FileName, int Line) - : FileName(std::move(FileName)), Line(Line) {} + : StmtAST(Line), FileName(std::move(FileName)) {} ExprAST *getFileName() const { return FileName.get(); } - int getLine() const { return Line; } }; } // namespace cps |
