diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-22 03:55:22 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-22 04:05:50 +0000 |
| commit | 56e97d0ddd3fff2bee160bae04e8f659671f398d (patch) | |
| tree | c12bee619f88d8be306117913a4e8e349c2d7797 /include | |
| parent | cad64c865ae517a1d2925544e5f99ec3c414690b (diff) | |
refactor(parser): share the designator degrade rule for INPUT and expressions
INPUT targets and identifier expressions now build their legacy
VariableExprAST/ArrayAccessExprAST/DesignatorExprAST node through
makeDesignator(). INPUT still sets the target line explicitly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/cps/Parser.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/cps/Parser.h b/include/cps/Parser.h index cf27234..c9fe186 100644 --- a/include/cps/Parser.h +++ b/include/cps/Parser.h @@ -78,6 +78,8 @@ class Parser { std::unique_ptr<StmtAST> ParseConstant(); std::unique_ptr<StmtAST> ParseAssignStmt(); bool ParseDesignatorSuffix(std::vector<DesignatorAccess> &Out); + static std::unique_ptr<ExprAST> makeDesignator( + const std::string &Name, std::vector<DesignatorAccess> Accesses, int Line); std::unique_ptr<StmtAST> ParseTypeDecl(); std::unique_ptr<StmtAST> ParseTemplateDecl(); |
