public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Move "returned_complete" into ada_parse_state Date: Tue, 2 Apr 2024 17:36:18 +0000 (GMT) [thread overview] Message-ID: <20240402173618.F29643858C36@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=33a03c121318b64b89f0e161bef638a7ab190e7a commit 33a03c121318b64b89f0e161bef638a7ab190e7a Author: Tom Tromey <tromey@adacore.com> Date: Thu Mar 14 12:30:28 2024 -0600 Move "returned_complete" into ada_parse_state This moves the "returned_complete" global into ada_parse_state. Diff: --- gdb/ada-exp.y | 7 +++++++ gdb/ada-lex.l | 12 ++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index 21a384bc692..f3cef6d2a37 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -105,6 +105,13 @@ struct ada_parse_state /* Depth of parentheses, used by the lexer. */ int paren_depth = 0; + /* When completing, we'll return a special character at the end of the + input, to signal the completion position to the lexer. This is + done because flex does not have a generally useful way to detect + EOF in a pattern. This variable records whether the special + character has been emitted. */ + bool returned_complete = false; + private: /* We don't have a good way to manage non-POD data in Yacc, so store diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l index 9161c4377c0..11221723eb3 100644 --- a/gdb/ada-lex.l +++ b/gdb/ada-lex.l @@ -78,13 +78,6 @@ static void rewind_to_char (int); Defining YY_NO_INPUT comments it out. */ #define YY_NO_INPUT -/* When completing, we'll return a special character at the end of the - input, to signal the completion position to the lexer. This is - done because flex does not have a generally useful way to detect - EOF in a pattern. This variable records whether the special - character has been emitted. */ -static bool returned_complete = false; - /* The character we use to represent the completion point. */ #define COMPLETE_CHAR '\001' @@ -92,9 +85,9 @@ static bool returned_complete = false; #define YY_INPUT(BUF, RESULT, MAX_SIZE) \ if ( *pstate->lexptr == '\000' ) \ { \ - if (pstate->parse_completion && !returned_complete) \ + if (pstate->parse_completion && !ada_parser->returned_complete) \ { \ - returned_complete = true; \ + ada_parser->returned_complete = true; \ *(BUF) = COMPLETE_CHAR; \ (RESULT) = 1; \ } \ @@ -346,7 +339,6 @@ static void lexer_init (FILE *inp) { BEGIN INITIAL; - returned_complete = false; yyrestart (inp); }
reply other threads:[~2024-04-02 17:36 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20240402173618.F29643858C36@sourceware.org \ --to=tromey@sourceware.org \ --cc=gdb-cvs@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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).