Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH 7/7] gdb: make COMPLETE_CHAR a constexpr
Date: Thu,  1 Oct 2026 16:30:05 -0400	[thread overview]
Message-ID: <20261001203105.1379971-8-simon.marchi@efficios.com> (raw)
In-Reply-To: <20261001203105.1379971-1-simon.marchi@efficios.com>

In ada-exp-parser.h, make COMPLETE_CHAR a constexpr rather than a
macro.

While at it, fix the comment in ada-lex.l that refers to it.  It used
the wrong name (COMPLETION_CHAR), and the constant is no longer
"below", it is now in ada-exp-parser.h.  The explanation it points to
is now the comment on ada_parse_state::returned_complete.

Change-Id: I4ecfec782add66ab658bcb1494b1f78cdd432218
---
 gdb/ada-exp-parser.h | 2 +-
 gdb/ada-lex.l        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/ada-exp-parser.h b/gdb/ada-exp-parser.h
index 0f438647437e..09a716e6636c 100644
--- a/gdb/ada-exp-parser.h
+++ b/gdb/ada-exp-parser.h
@@ -24,7 +24,7 @@
 #include "parser-defs.h"
 
 /* The character we use to represent the completion point.  */
-#define COMPLETE_CHAR '\001'
+constexpr char COMPLETE_CHAR = '\001';
 
 namespace ada_exp_parser
 {
diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l
index 62edcd251966..857176c4d83d 100644
--- a/gdb/ada-lex.l
+++ b/gdb/ada-lex.l
@@ -39,8 +39,8 @@ OPER    ([-+*/=<>&]|"<="|">="|"**"|"/="|"and"|"or"|"xor"|"not"|"mod"|"rem"|"abs"
 EXP	(e[+-]{NUM10})
 POSEXP  (e"+"?{NUM10})
 
-/* This must agree with COMPLETION_CHAR below.  See the comment there
-   for the explanation.  */
+/* This must agree with COMPLETE_CHAR in ada-exp-parser.h.  See the
+   comment on ada_parse_state::returned_complete for the explanation.  */
 COMPLETE "\001"
 NOT_COMPLETE [^\001]
 
-- 
2.55.0


  parent reply	other threads:[~2026-10-01 20:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 20:29 [PATCH 0/7] Leftovers from parsers cleanup Simon Marchi
2026-10-01 20:29 ` [PATCH 1/7] gdb: convert QUAL_* macros into an enum_flags Simon Marchi
2026-10-01 20:30 ` [PATCH 2/7] gdb: convert INT_* " Simon Marchi
2026-10-01 20:30 ` [PATCH 3/7] gdb: convert d_left and d_right macros into functions Simon Marchi
2026-10-01 20:30 ` [PATCH 4/7] gdb: replace cp-name-parser.c macros with lambdas Simon Marchi
2026-10-01 20:30 ` [PATCH 5/7] gdb: use std::string for f-exp-parser.c's tempbuf Simon Marchi
2026-10-01 20:30 ` [PATCH 6/7] gdb: remove qsort kludge from ada-exp-parser.y Simon Marchi
2026-10-01 20:30 ` Simon Marchi [this message]
2026-10-14 12:54 ` [PATCH 0/7] Leftovers from parsers cleanup Tom Tromey
2026-10-14 13:13   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261001203105.1379971-8-simon.marchi@efficios.com \
    --to=simon.marchi@efficios.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox