[PATCH 10/10] Go programming language

Doug Evans dje@google.com
Wed Jun 13 17:02:00 GMT 2012


On Tue, Jun 12, 2012 at 9:57 PM, Sergio Durigan Junior
<sergiodj@redhat.com> wrote:
> On Saturday, June 02 2012, I wrote:
>
>> Patch for the Go programming language.  Similar to the C language one.
>
> Ping.
>
> Doug, since you have put this code in, would you like to take a look
> just to be safe?

Righto.
There's some indentation issues with parameters.
If it's because they would otherwise exceed 80 cols, I'm not sure what
the convention is.

@@ -317,9 +322,10 @@ exp        :       exp '('
                          being accumulated by an outer function call.  */
                       { start_arglist (); }
               arglist ')'     %prec LEFT_ARROW
-                       { write_exp_elt_opcode (OP_FUNCALL);
-                         write_exp_elt_longcst ((LONGEST) end_arglist ());
-                         write_exp_elt_opcode (OP_FUNCALL); }
+                       { write_exp_elt_opcode (pstate, OP_FUNCALL);
+                         write_exp_elt_longcst (pstate,
+                                                (LONGEST) end_arglist ());
+                         write_exp_elt_opcode (pstate, OP_FUNCALL); }
       ;

 lcurly :       '{'

There's also the thought of making sure pstate is reset to NULL.

@@ -1587,14 +1603,20 @@ yylex (void)

  popping = 1;
  yylval = current.value;
-  return classify_name (expression_context_block);
+  return classify_name (pstate, expression_context_block);
 }

 int
-go_parse (void)
+go_parse (struct parser_state *par_state)
 {
  int result;
-  struct cleanup *back_to = make_cleanup (null_cleanup, NULL);
+  struct cleanup *back_to;
+
+  /* Setting up the parser state.  */
+  gdb_assert (par_state != NULL);
+  pstate = par_state;
+
+  back_to = make_cleanup (null_cleanup, NULL);

  make_cleanup_restore_integer (&yydebug);
  yydebug = parser_debug;

Other than that LGTM.



More information about the Gdb-patches mailing list