poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] pkl: move typification of `format' to typify pass


From: Mohammad-Reza Nabipoor
Subject: [PATCH 1/2] pkl: move typification of `format' to typify pass
Date: Fri, 21 Apr 2023 03:34:02 +0200

2023-04-21  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>

        * libpoke/pkl-tab.y (primary): Remove typification of `format'.
        Remove unnecessary `PKL_AST_LOC' invocations.
        * libpoke/pkl-typify.c (pkl_typify1_ps_format): Typify the `format'.
---
 ChangeLog            | 6 ++++++
 libpoke/pkl-tab.y    | 6 +-----
 libpoke/pkl-typify.c | 2 ++
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1f790dc8..e0ceefba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-04-21  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>
+
+       * libpoke/pkl-tab.y (primary): Remove typification of `format'.
+       Remove unnecessary `PKL_AST_LOC' invocations.
+       * libpoke/pkl-typify.c (pkl_typify1_ps_format): Typify the `format'.
+
 2023-04-17  Jose E. Marchesi  <jemarch@gnu.org>
 
        * NEWS: Add entries for 3.1.
diff --git a/libpoke/pkl-tab.y b/libpoke/pkl-tab.y
index 173038c5..82d3168d 100644
--- a/libpoke/pkl-tab.y
+++ b/libpoke/pkl-tab.y
@@ -1218,13 +1218,9 @@ primary:
                 {
                   $$ = pkl_ast_make_format (pkl_parser->ast, $3, $4,
                                             0 /* printf_p */);
-                  PKL_AST_TYPE ($$)
-                      = ASTREF (pkl_ast_make_string_type (pkl_parser->ast));
                   PKL_AST_LOC ($3) = @3;
-                  if (PKL_AST_TYPE ($3))
-                    PKL_AST_LOC (PKL_AST_TYPE ($3)) = @3;
                   PKL_AST_LOC ($$) = @$;
-                  PKL_AST_LOC (PKL_AST_TYPE ($$)) = @$;
+
                 }
         | expression INC
                 {
diff --git a/libpoke/pkl-typify.c b/libpoke/pkl-typify.c
index aa46a9a3..98342992 100644
--- a/libpoke/pkl-typify.c
+++ b/libpoke/pkl-typify.c
@@ -2380,6 +2380,8 @@ PKL_PHASE_BEGIN_HANDLER (pkl_typify1_ps_format)
 
   assert (format_fmt);
 
+  PKL_AST_TYPE (format) = ASTREF (pkl_ast_make_string_type (PKL_PASS_AST));
+
   /* Make sure the type of the ARGS match the types in TYPES.  */
 
   for (arg = format_args, type = format_types;
-- 
2.40.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]