[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 7/9] pkl: add location info to synthesized assignment stmts
From: |
Mohammad-Reza Nabipoor |
Subject: |
[PATCH 7/9] pkl: add location info to synthesized assignment stmts |
Date: |
Thu, 28 Dec 2023 02:19:32 +0100 |
2023-12-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.c (pkl_ast_handle_bconc_ass_stmt_1):
Add location info to ass-stmt.
* libpoke/pkl-trans.c (pkl_trans1_ps_asm_stmt): Likewise.
(pkl_trans2_ps_incrdecr): Likewise.
---
ChangeLog | 7 +++++++
libpoke/pkl-ast.c | 1 +
libpoke/pkl-trans.c | 2 ++
3 files changed, 10 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index a0647a5b..68b944c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-12-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
+
+ * libpoke/pkl-ast.c (pkl_ast_handle_bconc_ass_stmt_1):
+ Add location info to ass-stmt.
+ * libpoke/pkl-trans.c (pkl_trans1_ps_asm_stmt): Likewise.
+ (pkl_trans2_ps_incrdecr): Likewise.
+
2023-12-28 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-ast.h (pkl_ast_format_loc): Change first input
diff --git a/libpoke/pkl-ast.c b/libpoke/pkl-ast.c
index 694538b3..d9d520a7 100644
--- a/libpoke/pkl-ast.c
+++ b/libpoke/pkl-ast.c
@@ -3115,6 +3115,7 @@ pkl_ast_handle_bconc_ass_stmt_1 (pkl_ast ast,
}
ass_stmt = pkl_ast_make_ass_stmt (ast, operand, rvalue);
+ PKL_AST_LOC (ass_stmt) = PKL_AST_LOC (bconc_exp);
PKL_AST_COMP_STMT_STMTS (comp_stmt)
= pkl_ast_chainon (PKL_AST_COMP_STMT_STMTS (comp_stmt),
diff --git a/libpoke/pkl-trans.c b/libpoke/pkl-trans.c
index fe483695..eab5c59e 100644
--- a/libpoke/pkl-trans.c
+++ b/libpoke/pkl-trans.c
@@ -1530,6 +1530,7 @@ PKL_PHASE_BEGIN_HANDLER (pkl_trans1_ps_asm_stmt)
ass_stmt = pkl_ast_make_ass_stmt (PKL_PASS_AST,
output,
NULL /* exp */);
+ PKL_AST_LOC (ass_stmt) = PKL_AST_LOC (asm_stmt);
/* Note the reverse order. */
assignments = pkl_ast_chainon (ass_stmt, assignments);
}
@@ -1799,6 +1800,7 @@ PKL_PHASE_BEGIN_HANDLER (pkl_trans2_ps_incrdecr)
PKL_AST_TYPE (exp_plus_one) = ASTREF (incrdecr_exp_type);
ass_stmt = pkl_ast_make_ass_stmt (PKL_PASS_AST,
incrdecr_exp, exp_plus_one);
+ PKL_AST_LOC (ass_stmt) = PKL_AST_LOC (incrdecr);
PKL_AST_INCRDECR_ASS_STMT (incrdecr) = ASTREF (ass_stmt);
PKL_PASS_RESTART = 1;
--
2.42.1
[PATCH 6/9] pkl: change `pkl_ast_format_loc' function, Mohammad-Reza Nabipoor, 2023/12/27
[PATCH 5/9] pkl: keep track of current filename in codgen, Mohammad-Reza Nabipoor, 2023/12/27
[PATCH 8/9] pkl: report evaluation location in E_constraint exception, Mohammad-Reza Nabipoor, 2023/12/27