changeset 33117:068b80d70ff6

rename methods in lexer classes for accessing comment lists * lex.h (base_lexer::comment_buffer::get_comment_list): Rename from get_comment. Change all uses. (base_lexer::get_comment_list): Rename from get_comment. Change all uses.
author John W. Eaton <jwe@octave.org>
date Sat, 02 Mar 2024 11:17:19 -0500
parents 985d25d4eafd
children 8ec8df064d8f
files libinterp/parse-tree/lex.h libinterp/parse-tree/oct-parse.yy
diffstat 2 files changed, 18 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.h	Thu Feb 29 15:32:06 2024 -0500
+++ b/libinterp/parse-tree/lex.h	Sat Mar 02 11:17:19 2024 -0500
@@ -578,7 +578,7 @@
 
     // Caller is expected to delete the returned value.
 
-    comment_list * get_comment ()
+    comment_list * get_comment_list ()
     {
       comment_list *retval = m_comment_list;
 
@@ -658,7 +658,7 @@
 
   void finish_comment (comment_elt::comment_type typ);
 
-  comment_list * get_comment () { return m_comment_buf.get_comment (); }
+  comment_list * get_comment_list () { return m_comment_buf.get_comment_list (); }
 
   int handle_close_bracket (int bracket_type);
 
--- a/libinterp/parse-tree/oct-parse.yy	Thu Feb 29 15:32:06 2024 -0500
+++ b/libinterp/parse-tree/oct-parse.yy	Sat Mar 02 11:17:19 2024 -0500
@@ -1278,7 +1278,7 @@
                     OCTAVE_YYUSE ($3);
 
                     octave::comment_list *lc = $2;
-                    octave::comment_list *tc = lexer.get_comment ();
+                    octave::comment_list *tc = lexer.get_comment_list ();
 
                     if (! ($$ = parser.make_spmd_command ($1, $4, $5, lc, tc)))
                       {
@@ -1710,7 +1710,7 @@
                     OCTAVE_YYUSE ($3, $6);
 
                     octave::comment_list *lc = $2;
-                    octave::comment_list *tc = lexer.get_comment ();
+                    octave::comment_list *tc = lexer.get_comment_list ();
 
                     if (! ($$ = parser.make_arguments_block ($1, $4, $5, $7, lc, tc)))
                       {
@@ -1991,7 +1991,7 @@
                     OCTAVE_YYUSE ($3);
 
                     octave::comment_list *lc = $2;
-                    octave::comment_list *tc = lexer.get_comment ();
+                    octave::comment_list *tc = lexer.get_comment_list ();
 
                     if (! ($$ = parser.make_classdef_properties_block
                            ($1, $4, $5, $6, lc, tc)))
@@ -2067,7 +2067,7 @@
                     OCTAVE_YYUSE ($3);
 
                     octave::comment_list *lc = $2;
-                    octave::comment_list *tc = lexer.get_comment ();
+                    octave::comment_list *tc = lexer.get_comment_list ();
 
                     if (! ($$ = parser.make_classdef_methods_block
                            ($1, $4, $5, $6, lc, tc)))
@@ -2151,7 +2151,7 @@
                     OCTAVE_YYUSE ($3);
 
                     octave::comment_list *lc = $2;
-                    octave::comment_list *tc = lexer.get_comment ();
+                    octave::comment_list *tc = lexer.get_comment_list ();
 
                     if (! ($$ = parser.make_classdef_events_block
                            ($1, $4, $5, $6, lc, tc)))
@@ -2203,7 +2203,7 @@
                     OCTAVE_YYUSE ($3);
 
                     octave::comment_list *lc = $2;
-                    octave::comment_list *tc = lexer.get_comment ();
+                    octave::comment_list *tc = lexer.get_comment_list ();
 
                     if (! ($$ = parser.make_classdef_enum_block
                            ($1, $4, $5, $6, lc, tc)))
@@ -2275,7 +2275,7 @@
 
 stash_comment   : // empty
                   {
-                    $$ = lexer.get_comment ();
+                    $$ = lexer.get_comment_list ();
                   }
                 ;
 
@@ -3299,7 +3299,7 @@
 
     if (end_token_ok (end_tok, token::unwind_protect_end))
       {
-        comment_list *tc = m_lexer.m_comment_buf.get_comment ();
+        comment_list *tc = m_lexer.m_comment_buf.get_comment_list ();
 
         int l = unwind_tok->line ();
         int c = unwind_tok->column ();
@@ -3333,7 +3333,7 @@
 
     if (end_token_ok (end_tok, token::try_catch_end))
       {
-        comment_list *tc = m_lexer.m_comment_buf.get_comment ();
+        comment_list *tc = m_lexer.m_comment_buf.get_comment_list ();
 
         int l = try_tok->line ();
         int c = try_tok->column ();
@@ -3389,7 +3389,7 @@
 
     if (end_token_ok (end_tok, token::while_end))
       {
-        comment_list *tc = m_lexer.m_comment_buf.get_comment ();
+        comment_list *tc = m_lexer.m_comment_buf.get_comment_list ();
 
         m_lexer.m_looping--;
 
@@ -3419,7 +3419,7 @@
   {
     maybe_warn_assign_as_truth_value (expr);
 
-    comment_list *tc = m_lexer.m_comment_buf.get_comment ();
+    comment_list *tc = m_lexer.m_comment_buf.get_comment_list ();
 
     m_lexer.m_looping--;
 
@@ -3448,7 +3448,7 @@
       {
         expr->mark_as_for_cmd_expr ();
 
-        comment_list *tc = m_lexer.m_comment_buf.get_comment ();
+        comment_list *tc = m_lexer.m_comment_buf.get_comment_list ();
 
         m_lexer.m_looping--;
 
@@ -3596,7 +3596,7 @@
 
     if (end_token_ok (end_tok, token::if_end))
       {
-        comment_list *tc = m_lexer.m_comment_buf.get_comment ();
+        comment_list *tc = m_lexer.m_comment_buf.get_comment_list ();
 
         int l = if_tok->line ();
         int c = if_tok->column ();
@@ -3670,7 +3670,7 @@
 
     if (end_token_ok (end_tok, token::switch_end))
       {
-        comment_list *tc = m_lexer.m_comment_buf.get_comment ();
+        comment_list *tc = m_lexer.m_comment_buf.get_comment_list ();
 
         int l = switch_tok->line ();
         int c = switch_tok->column ();
@@ -4044,7 +4044,7 @@
       = new octave_user_function (m_lexer.m_symtab_context.curr_scope (),
                                   param_list, nullptr, body);
 
-    comment_list *tc = m_lexer.m_comment_buf.get_comment ();
+    comment_list *tc = m_lexer.m_comment_buf.get_comment_list ();
 
     fcn->stash_trailing_comment (tc);
     fcn->stash_fcn_end_location (end_fcn_stmt->line (),
@@ -5485,7 +5485,7 @@
   tree_statement *
   base_parser::make_statement (T *arg)
   {
-    comment_list *comment = m_lexer.get_comment ();
+    comment_list *comment = m_lexer.get_comment_list ();
 
     return new tree_statement (arg, comment);
   }