]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Move "returned_complete" into ada_parse_state
authorTom Tromey <tromey@adacore.com>
Thu, 14 Mar 2024 18:30:28 +0000 (12:30 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 2 Apr 2024 17:24:27 +0000 (11:24 -0600)
This moves the "returned_complete" global into ada_parse_state.

gdb/ada-exp.y
gdb/ada-lex.l

index 21a384bc6927948a8e2e2500e566f5f756c83df7..f3cef6d2a3722cb8a346edee60b37736589729a8 100644 (file)
@@ -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
index 9161c4377c0dae94865c25c6557a2c487e2ea0b4..11221723eb3c66ef5f58ef8178a0bc70c483e036 100644 (file)
@@ -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);
 }