Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add "# throws ..." to generated methods that throw exceptions

  • Loading branch information...
commit 90eb63174b0a9262f4961cacbb67f70549c0d69e 1 parent 0651e7d
Tim Bunce authored July 18, 2010
2  TODO
@@ -22,8 +22,6 @@ type mappings etc. and document the issues/tradeoffs.
22 22
 handle enums like "public final class java.sql.RowIdLifetime extends java.lang.Enum{"
23 23
 by generating perl6 enums
24 24
 
25  
-Add thrown exceptions as comments.
26  
-
27 25
 Determine class hierarchy of exceptions and replicate in perl6.
28 26
 
29 27
 * General polishing:
1  lib/Java/Javap/Generator/Perl6.pm
@@ -325,6 +325,7 @@ method [% elem.name -%]
325 325
 [% INCLUDE method_all_args elem = elem %]
326 326
 [% INCLUDE method_returns ret = elem.type %]
327 327
     ) { ... }
  328
+[%- IF elem.throws.size %] # throws [% elem.throws.join(", ") %][% END +%]
328 329
 
329 330
 [% END %]
330 331
 [% BLOCK constant_whole %]
232  lib/Java/Javap/Grammar.pm
@@ -2589,16 +2589,14 @@ sub Parse::RecDescent::Java::Javap::Grammar::method
2589 2589
 
2590 2590
         $_tok = ($_noactions) ? 0 : do {
2591 2591
              $methods{ $item[4] }++;
2592  
-             my $args = $item{ 'arg_list(?)' }[0];
2593  
-             $args    = [] unless defined $args;
2594 2592
              {
2595 2593
                  body_element => 'method',
2596 2594
                  access       => $item[1],
2597 2595
                  attrs        => $item[2],
2598 2596
                  type         => $item[3][0],
2599 2597
                  name         => $item[4],
2600  
-                 args         => $args,
2601  
-                 throws       => $item{ 'throws_clause(?)' },
  2598
+                 args         => $item{ 'arg_list(?)' }[0] || [],
  2599
+                 throws       => $item{ 'throws_clause(?)' }[0] || [],
2602 2600
              }
2603 2601
          };
2604 2602
         unless (defined $_tok)
@@ -2876,15 +2874,13 @@ sub Parse::RecDescent::Java::Javap::Grammar::method
2876 2874
         $_tok = ($_noactions) ? 0 : do {
2877 2875
              $constructors++;
2878 2876
              $methods{ 'new' }++;
2879  
-             my $args = $item{ 'arg_list(?)' }[0];
2880  
-             $args    = [] unless defined $args;
2881 2877
              {
2882 2878
                  body_element => 'constructor',
2883 2879
                  access       => $item[1],
2884 2880
                  native       => ( $item[2] eq 'native' ) ? 'native' : '',
2885  
-                 args         => $args,
2886  
-                 throws       => $item{ 'throws_clause(?)' },
2887  
-                 # add name and returns so constructor data is like a method
  2881
+                 args         => $item{ 'arg_list(?)' }[0] || [],
  2882
+                 throws       => $item{ 'throws_clause(?)' }[0] || [],
  2883
+                 # add name and type so constructor data is like a method
2888 2884
                  name         => 'new',
2889 2885
                  type         => {
2890 2886
                     array_depth => 0,
@@ -7135,7 +7131,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7135 7131
                                                                                                  'implicit' => undef,
7136 7132
                                                                                                  'argcode' => undef,
7137 7133
                                                                                                  'lookahead' => 0,
7138  
-                                                                                                 'line' => 127
  7134
+                                                                                                 'line' => 123
7139 7135
                                                                                                }, 'Parse::RecDescent::Subrule' ),
7140 7136
                                                                                         bless( {
7141 7137
                                                                                                  'subrule' => 'var_modifier',
@@ -7146,7 +7142,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7146 7142
                                                                                                  'matchrule' => 0,
7147 7143
                                                                                                  'repspec' => 's?',
7148 7144
                                                                                                  'lookahead' => 0,
7149  
-                                                                                                 'line' => 127
  7145
+                                                                                                 'line' => 123
7150 7146
                                                                                                }, 'Parse::RecDescent::Repetition' ),
7151 7147
                                                                                         bless( {
7152 7148
                                                                                                  'subrule' => 'arg',
@@ -7154,7 +7150,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7154 7150
                                                                                                  'implicit' => undef,
7155 7151
                                                                                                  'argcode' => undef,
7156 7152
                                                                                                  'lookahead' => 0,
7157  
-                                                                                                 'line' => 127
  7153
+                                                                                                 'line' => 123
7158 7154
                                                                                                }, 'Parse::RecDescent::Subrule' ),
7159 7155
                                                                                         bless( {
7160 7156
                                                                                                  'subrule' => 'NAME',
@@ -7162,19 +7158,19 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7162 7158
                                                                                                  'implicit' => undef,
7163 7159
                                                                                                  'argcode' => undef,
7164 7160
                                                                                                  'lookahead' => 0,
7165  
-                                                                                                 'line' => 127
  7161
+                                                                                                 'line' => 123
7166 7162
                                                                                                }, 'Parse::RecDescent::Subrule' ),
7167 7163
                                                                                         bless( {
7168 7164
                                                                                                  'pattern' => ';',
7169 7165
                                                                                                  'hashname' => '__STRING1__',
7170 7166
                                                                                                  'description' => '\';\'',
7171 7167
                                                                                                  'lookahead' => 0,
7172  
-                                                                                                 'line' => 127
  7168
+                                                                                                 'line' => 123
7173 7169
                                                                                                }, 'Parse::RecDescent::Literal' ),
7174 7170
                                                                                         bless( {
7175 7171
                                                                                                  'hashname' => '__ACTION1__',
7176 7172
                                                                                                  'lookahead' => 0,
7177  
-                                                                                                 'line' => 127,
  7173
+                                                                                                 'line' => 123,
7178 7174
                                                                                                  'code' => '{
7179 7175
     {
7180 7176
         body_element => \'variable\',
@@ -7190,7 +7186,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7190 7186
                                                                 ],
7191 7187
                                                      'name' => 'variable',
7192 7188
                                                      'vars' => '',
7193  
-                                                     'line' => 127
  7189
+                                                     'line' => 123
7194 7190
                                                    }, 'Parse::RecDescent::Rule' ),
7195 7191
                               'arg' => bless( {
7196 7192
                                                 'impcount' => 0,
@@ -7216,7 +7212,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7216 7212
                                                                                             'implicit' => undef,
7217 7213
                                                                                             'argcode' => undef,
7218 7214
                                                                                             'lookahead' => 0,
7219  
-                                                                                            'line' => 159
  7215
+                                                                                            'line' => 155
7220 7216
                                                                                           }, 'Parse::RecDescent::Subrule' ),
7221 7217
                                                                                    bless( {
7222 7218
                                                                                             'subrule' => 'array_depth',
@@ -7224,12 +7220,12 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7224 7220
                                                                                             'implicit' => undef,
7225 7221
                                                                                             'argcode' => undef,
7226 7222
                                                                                             'lookahead' => 0,
7227  
-                                                                                            'line' => 159
  7223
+                                                                                            'line' => 155
7228 7224
                                                                                           }, 'Parse::RecDescent::Subrule' ),
7229 7225
                                                                                    bless( {
7230 7226
                                                                                             'hashname' => '__ACTION1__',
7231 7227
                                                                                             'lookahead' => 0,
7232  
-                                                                                            'line' => 159,
  7228
+                                                                                            'line' => 155,
7233 7229
                                                                                             'code' => '{
7234 7230
     my $array_text = \'\';
7235 7231
     foreach my $i ( 1 .. $item[2] ) {
@@ -7250,7 +7246,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7250 7246
                                                            ],
7251 7247
                                                 'name' => 'arg',
7252 7248
                                                 'vars' => '',
7253  
-                                                'line' => 159
  7249
+                                                'line' => 155
7254 7250
                                               }, 'Parse::RecDescent::Rule' ),
7255 7251
                               'constant_modifier' => bless( {
7256 7252
                                                               'impcount' => 0,
@@ -7344,14 +7340,14 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7344 7340
                                                                                                  'implicit' => undef,
7345 7341
                                                                                                  'argcode' => undef,
7346 7342
                                                                                                  'lookahead' => 0,
7347  
-                                                                                                 'line' => 156
  7343
+                                                                                                 'line' => 152
7348 7344
                                                                                                }, 'Parse::RecDescent::Subrule' ),
7349 7345
                                                                                         bless( {
7350 7346
                                                                                                  'pattern' => ',',
7351 7347
                                                                                                  'hashname' => '__STRING1__',
7352 7348
                                                                                                  'description' => '\',\'',
7353 7349
                                                                                                  'lookahead' => 0,
7354  
-                                                                                                 'line' => 156
  7350
+                                                                                                 'line' => 152
7355 7351
                                                                                                }, 'Parse::RecDescent::Literal' ),
7356 7352
                                                                                         bless( {
7357 7353
                                                                                                  'subrule' => 'arg_list',
@@ -7359,12 +7355,12 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7359 7355
                                                                                                  'implicit' => undef,
7360 7356
                                                                                                  'argcode' => undef,
7361 7357
                                                                                                  'lookahead' => 0,
7362  
-                                                                                                 'line' => 156
  7358
+                                                                                                 'line' => 152
7363 7359
                                                                                                }, 'Parse::RecDescent::Subrule' ),
7364 7360
                                                                                         bless( {
7365 7361
                                                                                                  'hashname' => '__ACTION1__',
7366 7362
                                                                                                  'lookahead' => 0,
7367  
-                                                                                                 'line' => 156,
  7363
+                                                                                                 'line' => 152,
7368 7364
                                                                                                  'code' => '{ [ @{ $item[1] }, @{ $item[3] } ] }'
7369 7365
                                                                                                }, 'Parse::RecDescent::Action' )
7370 7366
                                                                                       ],
@@ -7385,21 +7381,21 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7385 7381
                                                                                                  'implicit' => undef,
7386 7382
                                                                                                  'argcode' => undef,
7387 7383
                                                                                                  'lookahead' => 0,
7388  
-                                                                                                 'line' => 157
  7384
+                                                                                                 'line' => 153
7389 7385
                                                                                                }, 'Parse::RecDescent::Subrule' ),
7390 7386
                                                                                         bless( {
7391 7387
                                                                                                  'hashname' => '__ACTION1__',
7392 7388
                                                                                                  'lookahead' => 0,
7393  
-                                                                                                 'line' => 157,
  7389
+                                                                                                 'line' => 153,
7394 7390
                                                                                                  'code' => '{ $item[1] }'
7395 7391
                                                                                                }, 'Parse::RecDescent::Action' )
7396 7392
                                                                                       ],
7397  
-                                                                           'line' => 157
  7393
+                                                                           'line' => 153
7398 7394
                                                                          }, 'Parse::RecDescent::Production' )
7399 7395
                                                                 ],
7400 7396
                                                      'name' => 'arg_list',
7401 7397
                                                      'vars' => '',
7402  
-                                                     'line' => 156
  7398
+                                                     'line' => 152
7403 7399
                                                    }, 'Parse::RecDescent::Rule' ),
7404 7400
                               'body' => bless( {
7405 7401
                                                  'impcount' => 0,
@@ -7463,7 +7459,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7463 7459
                                                                                                      'hashname' => '__STRING1__',
7464 7460
                                                                                                      'description' => '\'volatile\'',
7465 7461
                                                                                                      'lookahead' => 0,
7466  
-                                                                                                     'line' => 136
  7462
+                                                                                                     'line' => 132
7467 7463
                                                                                                    }, 'Parse::RecDescent::Literal' )
7468 7464
                                                                                           ],
7469 7465
                                                                                'line' => undef
@@ -7482,10 +7478,10 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7482 7478
                                                                                                      'hashname' => '__STRING1__',
7483 7479
                                                                                                      'description' => '\'final\'',
7484 7480
                                                                                                      'lookahead' => 0,
7485  
-                                                                                                     'line' => 136
  7481
+                                                                                                     'line' => 132
7486 7482
                                                                                                    }, 'Parse::RecDescent::Literal' )
7487 7483
                                                                                           ],
7488  
-                                                                               'line' => 136
  7484
+                                                                               'line' => 132
7489 7485
                                                                              }, 'Parse::RecDescent::Production' ),
7490 7486
                                                                       bless( {
7491 7487
                                                                                'number' => 2,
@@ -7501,15 +7497,15 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7501 7497
                                                                                                      'hashname' => '__STRING1__',
7502 7498
                                                                                                      'description' => '\'transient\'',
7503 7499
                                                                                                      'lookahead' => 0,
7504  
-                                                                                                     'line' => 136
  7500
+                                                                                                     'line' => 132
7505 7501
                                                                                                    }, 'Parse::RecDescent::Literal' )
7506 7502
                                                                                           ],
7507  
-                                                                               'line' => 136
  7503
+                                                                               'line' => 132
7508 7504
                                                                              }, 'Parse::RecDescent::Production' )
7509 7505
                                                                     ],
7510 7506
                                                          'name' => 'var_modifier',
7511 7507
                                                          'vars' => '',
7512  
-                                                         'line' => 136
  7508
+                                                         'line' => 132
7513 7509
                                                        }, 'Parse::RecDescent::Rule' ),
7514 7510
                               'comp_unit_decl' => bless( {
7515 7511
                                                            'impcount' => 0,
@@ -7642,12 +7638,12 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7642 7638
                                                                                                     'matchrule' => 0,
7643 7639
                                                                                                     'repspec' => 's?',
7644 7640
                                                                                                     'lookahead' => 0,
7645  
-                                                                                                    'line' => 173
  7641
+                                                                                                    'line' => 169
7646 7642
                                                                                                   }, 'Parse::RecDescent::Repetition' ),
7647 7643
                                                                                            bless( {
7648 7644
                                                                                                     'hashname' => '__ACTION1__',
7649 7645
                                                                                                     'lookahead' => 0,
7650  
-                                                                                                    'line' => 173,
  7646
+                                                                                                    'line' => 169,
7651 7647
                                                                                                     'code' => '{
7652 7648
                 my $depth = scalar @{ $item[1] };
7653 7649
                 $depth;
@@ -7659,7 +7655,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7659 7655
                                                                    ],
7660 7656
                                                         'name' => 'array_depth',
7661 7657
                                                         'vars' => '',
7662  
-                                                        'line' => 173
  7658
+                                                        'line' => 169
7663 7659
                                                       }, 'Parse::RecDescent::Rule' ),
7664 7660
                               'ACCESS' => bless( {
7665 7661
                                                    'impcount' => 0,
@@ -7681,12 +7677,12 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7681 7677
                                                                                                'hashname' => '__STRING1__',
7682 7678
                                                                                                'description' => '\'public\'',
7683 7679
                                                                                                'lookahead' => 0,
7684  
-                                                                                               'line' => 182
  7680
+                                                                                               'line' => 178
7685 7681
                                                                                              }, 'Parse::RecDescent::Literal' ),
7686 7682
                                                                                       bless( {
7687 7683
                                                                                                'hashname' => '__ACTION1__',
7688 7684
                                                                                                'lookahead' => 0,
7689  
-                                                                                               'line' => 182,
  7685
+                                                                                               'line' => 178,
7690 7686
                                                                                                'code' => '{ $item[1] }'
7691 7687
                                                                                              }, 'Parse::RecDescent::Action' )
7692 7688
                                                                                     ],
@@ -7706,16 +7702,16 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7706 7702
                                                                                                'hashname' => '__STRING1__',
7707 7703
                                                                                                'description' => '\'protected\'',
7708 7704
                                                                                                'lookahead' => 0,
7709  
-                                                                                               'line' => 183
  7705
+                                                                                               'line' => 179
7710 7706
                                                                                              }, 'Parse::RecDescent::Literal' ),
7711 7707
                                                                                       bless( {
7712 7708
                                                                                                'hashname' => '__ACTION1__',
7713 7709
                                                                                                'lookahead' => 0,
7714  
-                                                                                               'line' => 183,
  7710
+                                                                                               'line' => 179,
7715 7711
                                                                                                'code' => '{ $item[1] }'
7716 7712
                                                                                              }, 'Parse::RecDescent::Action' )
7717 7713
                                                                                     ],
7718  
-                                                                         'line' => 183
  7714
+                                                                         'line' => 179
7719 7715
                                                                        }, 'Parse::RecDescent::Production' ),
7720 7716
                                                                 bless( {
7721 7717
                                                                          'number' => 2,
@@ -7731,16 +7727,16 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7731 7727
                                                                                                'hashname' => '__STRING1__',
7732 7728
                                                                                                'description' => '\'private\'',
7733 7729
                                                                                                'lookahead' => 0,
7734  
-                                                                                               'line' => 184
  7730
+                                                                                               'line' => 180
7735 7731
                                                                                              }, 'Parse::RecDescent::Literal' ),
7736 7732
                                                                                       bless( {
7737 7733
                                                                                                'hashname' => '__ACTION1__',
7738 7734
                                                                                                'lookahead' => 0,
7739  
-                                                                                               'line' => 184,
  7735
+                                                                                               'line' => 180,
7740 7736
                                                                                                'code' => '{ $item[1] }'
7741 7737
                                                                                              }, 'Parse::RecDescent::Action' )
7742 7738
                                                                                     ],
7743  
-                                                                         'line' => 184
  7739
+                                                                         'line' => 180
7744 7740
                                                                        }, 'Parse::RecDescent::Production' ),
7745 7741
                                                                 bless( {
7746 7742
                                                                          'number' => 3,
@@ -7754,16 +7750,16 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7754 7750
                                                                                       bless( {
7755 7751
                                                                                                'hashname' => '__ACTION1__',
7756 7752
                                                                                                'lookahead' => 0,
7757  
-                                                                                               'line' => 185,
  7753
+                                                                                               'line' => 181,
7758 7754
                                                                                                'code' => '{ \'\' }'
7759 7755
                                                                                              }, 'Parse::RecDescent::Action' )
7760 7756
                                                                                     ],
7761  
-                                                                         'line' => 185
  7757
+                                                                         'line' => 181
7762 7758
                                                                        }, 'Parse::RecDescent::Production' )
7763 7759
                                                               ],
7764 7760
                                                    'name' => 'ACCESS',
7765 7761
                                                    'vars' => '',
7766  
-                                                   'line' => 182
  7762
+                                                   'line' => 178
7767 7763
                                                  }, 'Parse::RecDescent::Rule' ),
7768 7764
                               'method' => bless( {
7769 7765
                                                    'impcount' => 0,
@@ -7872,16 +7868,14 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7872 7868
                                                                                                'line' => 83,
7873 7869
                                                                                                'code' => '{
7874 7870
              $methods{ $item[4] }++;
7875  
-             my $args = $item{ \'arg_list(?)\' }[0];
7876  
-             $args    = [] unless defined $args;
7877 7871
              {
7878 7872
                  body_element => \'method\',
7879 7873
                  access       => $item[1],
7880 7874
                  attrs        => $item[2],
7881 7875
                  type         => $item[3][0],
7882 7876
                  name         => $item[4],
7883  
-                 args         => $args,
7884  
-                 throws       => $item{ \'throws_clause(?)\' },
  7877
+                 args         => $item{ \'arg_list(?)\' }[0] || [],
  7878
+                 throws       => $item{ \'throws_clause(?)\' }[0] || [],
7885 7879
              }
7886 7880
          }'
7887 7881
                                                                                              }, 'Parse::RecDescent::Action' )
@@ -7903,7 +7897,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7903 7897
                                                                                                'implicit' => undef,
7904 7898
                                                                                                'argcode' => undef,
7905 7899
                                                                                                'lookahead' => 0,
7906  
-                                                                                               'line' => 97
  7900
+                                                                                               'line' => 95
7907 7901
                                                                                              }, 'Parse::RecDescent::Subrule' ),
7908 7902
                                                                                       bless( {
7909 7903
                                                                                                'pattern' => '(native)?',
@@ -7911,7 +7905,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7911 7905
                                                                                                'description' => '/(native)?/',
7912 7906
                                                                                                'lookahead' => 0,
7913 7907
                                                                                                'rdelim' => '/',
7914  
-                                                                                               'line' => 97,
  7908
+                                                                                               'line' => 95,
7915 7909
                                                                                                'mod' => '',
7916 7910
                                                                                                'ldelim' => '/'
7917 7911
                                                                                              }, 'Parse::RecDescent::Token' ),
@@ -7921,14 +7915,14 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7921 7915
                                                                                                'implicit' => undef,
7922 7916
                                                                                                'argcode' => undef,
7923 7917
                                                                                                'lookahead' => 0,
7924  
-                                                                                               'line' => 97
  7918
+                                                                                               'line' => 95
7925 7919
                                                                                              }, 'Parse::RecDescent::Subrule' ),
7926 7920
                                                                                       bless( {
7927 7921
                                                                                                'pattern' => '(',
7928 7922
                                                                                                'hashname' => '__STRING1__',
7929 7923
                                                                                                'description' => '\'(\'',
7930 7924
                                                                                                'lookahead' => 0,
7931  
-                                                                                               'line' => 97
  7925
+                                                                                               'line' => 95
7932 7926
                                                                                              }, 'Parse::RecDescent::Literal' ),
7933 7927
                                                                                       bless( {
7934 7928
                                                                                                'subrule' => 'arg_list',
@@ -7939,14 +7933,14 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7939 7933
                                                                                                'matchrule' => 0,
7940 7934
                                                                                                'repspec' => '?',
7941 7935
                                                                                                'lookahead' => 0,
7942  
-                                                                                               'line' => 97
  7936
+                                                                                               'line' => 95
7943 7937
                                                                                              }, 'Parse::RecDescent::Repetition' ),
7944 7938
                                                                                       bless( {
7945 7939
                                                                                                'pattern' => ')',
7946 7940
                                                                                                'hashname' => '__STRING2__',
7947 7941
                                                                                                'description' => '\')\'',
7948 7942
                                                                                                'lookahead' => 0,
7949  
-                                                                                               'line' => 97
  7943
+                                                                                               'line' => 95
7950 7944
                                                                                              }, 'Parse::RecDescent::Literal' ),
7951 7945
                                                                                       bless( {
7952 7946
                                                                                                'subrule' => 'throws_clause',
@@ -7957,31 +7951,29 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7957 7951
                                                                                                'matchrule' => 0,
7958 7952
                                                                                                'repspec' => '?',
7959 7953
                                                                                                'lookahead' => 0,
7960  
-                                                                                               'line' => 98
  7954
+                                                                                               'line' => 96
7961 7955
                                                                                              }, 'Parse::RecDescent::Repetition' ),
7962 7956
                                                                                       bless( {
7963 7957
                                                                                                'pattern' => ';',
7964 7958
                                                                                                'hashname' => '__STRING3__',
7965 7959
                                                                                                'description' => '\';\'',
7966 7960
                                                                                                'lookahead' => 0,
7967  
-                                                                                               'line' => 98
  7961
+                                                                                               'line' => 96
7968 7962
                                                                                              }, 'Parse::RecDescent::Literal' ),
7969 7963
                                                                                       bless( {
7970 7964
                                                                                                'hashname' => '__ACTION1__',
7971 7965
                                                                                                'lookahead' => 0,
7972  
-                                                                                               'line' => 98,
  7966
+                                                                                               'line' => 96,
7973 7967
                                                                                                'code' => '{
7974 7968
              $constructors++;
7975 7969
              $methods{ \'new\' }++;
7976  
-             my $args = $item{ \'arg_list(?)\' }[0];
7977  
-             $args    = [] unless defined $args;
7978 7970
              {
7979 7971
                  body_element => \'constructor\',
7980 7972
                  access       => $item[1],
7981 7973
                  native       => ( $item[2] eq \'native\' ) ? \'native\' : \'\',
7982  
-                 args         => $args,
7983  
-                 throws       => $item{ \'throws_clause(?)\' },
7984  
-                 # add name and returns so constructor data is like a method
  7974
+                 args         => $item{ \'arg_list(?)\' }[0] || [],
  7975
+                 throws       => $item{ \'throws_clause(?)\' }[0] || [],
  7976
+                 # add name and type so constructor data is like a method
7985 7977
                  name         => \'new\',
7986 7978
                  type         => {
7987 7979
                     array_depth => 0,
@@ -7992,7 +7984,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
7992 7984
          }'
7993 7985
                                                                                              }, 'Parse::RecDescent::Action' )
7994 7986
                                                                                     ],
7995  
-                                                                         'line' => 97
  7987
+                                                                         'line' => 95
7996 7988
                                                                        }, 'Parse::RecDescent::Production' )
7997 7989
                                                               ],
7998 7990
                                                    'name' => 'method',
@@ -8019,12 +8011,12 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8019 8011
                                                                                                     'hashname' => '__STRING1__',
8020 8012
                                                                                                     'description' => '\'[]\'',
8021 8013
                                                                                                     'lookahead' => 0,
8022  
-                                                                                                    'line' => 178
  8014
+                                                                                                    'line' => 174
8023 8015
                                                                                                   }, 'Parse::RecDescent::Literal' ),
8024 8016
                                                                                            bless( {
8025 8017
                                                                                                     'hashname' => '__ACTION1__',
8026 8018
                                                                                                     'lookahead' => 0,
8027  
-                                                                                                    'line' => 178,
  8019
+                                                                                                    'line' => 174,
8028 8020
                                                                                                     'code' => '{ 1 }'
8029 8021
                                                                                                   }, 'Parse::RecDescent::Action' )
8030 8022
                                                                                          ],
@@ -8033,7 +8025,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8033 8025
                                                                    ],
8034 8026
                                                         'name' => 'ARRAY_LEVEL',
8035 8027
                                                         'vars' => '',
8036  
-                                                        'line' => 178
  8028
+                                                        'line' => 174
8037 8029
                                                       }, 'Parse::RecDescent::Rule' ),
8038 8030
                               'comp_unit' => bless( {
8039 8031
                                                       'impcount' => 0,
@@ -8158,14 +8150,14 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8158 8150
                                                                                              'description' => '/^([\\\\w\\\\d\\\\$]+)/',
8159 8151
                                                                                              'lookahead' => 0,
8160 8152
                                                                                              'rdelim' => '/',
8161  
-                                                                                             'line' => 180,
  8153
+                                                                                             'line' => 176,
8162 8154
                                                                                              'mod' => '',
8163 8155
                                                                                              'ldelim' => '/'
8164 8156
                                                                                            }, 'Parse::RecDescent::Token' ),
8165 8157
                                                                                     bless( {
8166 8158
                                                                                              'hashname' => '__ACTION1__',
8167 8159
                                                                                              'lookahead' => 0,
8168  
-                                                                                             'line' => 180,
  8160
+                                                                                             'line' => 176,
8169 8161
                                                                                              'code' => '{ $1 }'
8170 8162
                                                                                            }, 'Parse::RecDescent::Action' )
8171 8163
                                                                                   ],
@@ -8174,7 +8166,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8174 8166
                                                             ],
8175 8167
                                                  'name' => 'NAME',
8176 8168
                                                  'vars' => '',
8177  
-                                                 'line' => 180
  8169
+                                                 'line' => 176
8178 8170
                                                }, 'Parse::RecDescent::Rule' ),
8179 8171
                               'throws_clause' => bless( {
8180 8172
                                                           'impcount' => 0,
@@ -8198,7 +8190,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8198 8190
                                                                                                       'hashname' => '__STRING1__',
8199 8191
                                                                                                       'description' => '\'throws\'',
8200 8192
                                                                                                       'lookahead' => 0,
8201  
-                                                                                                      'line' => 125
  8193
+                                                                                                      'line' => 121
8202 8194
                                                                                                     }, 'Parse::RecDescent::Literal' ),
8203 8195
                                                                                              bless( {
8204 8196
                                                                                                       'subrule' => 'comma_list',
@@ -8206,12 +8198,12 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8206 8198
                                                                                                       'implicit' => undef,
8207 8199
                                                                                                       'argcode' => undef,
8208 8200
                                                                                                       'lookahead' => 0,
8209  
-                                                                                                      'line' => 125
  8201
+                                                                                                      'line' => 121
8210 8202
                                                                                                     }, 'Parse::RecDescent::Subrule' ),
8211 8203
                                                                                              bless( {
8212 8204
                                                                                                       'hashname' => '__ACTION1__',
8213 8205
                                                                                                       'lookahead' => 0,
8214  
-                                                                                                      'line' => 125,
  8206
+                                                                                                      'line' => 121,
8215 8207
                                                                                                       'code' => '{ $item{comma_list} }'
8216 8208
                                                                                                     }, 'Parse::RecDescent::Action' )
8217 8209
                                                                                            ],
@@ -8220,7 +8212,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8220 8212
                                                                      ],
8221 8213
                                                           'name' => 'throws_clause',
8222 8214
                                                           'vars' => '',
8223  
-                                                          'line' => 125
  8215
+                                                          'line' => 121
8224 8216
                                                         }, 'Parse::RecDescent::Rule' ),
8225 8217
                               'implements_clause' => bless( {
8226 8218
                                                               'impcount' => 0,
@@ -8440,12 +8432,12 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8440 8432
                                                                                                          'hashname' => '__STRING1__',
8441 8433
                                                                                                          'description' => '\'abstract\'',
8442 8434
                                                                                                          'lookahead' => 0,
8443  
-                                                                                                         'line' => 119
  8435
+                                                                                                         'line' => 115
8444 8436
                                                                                                        }, 'Parse::RecDescent::Literal' ),
8445 8437
                                                                                                 bless( {
8446 8438
                                                                                                          'hashname' => '__ACTION1__',
8447 8439
                                                                                                          'lookahead' => 0,
8448  
-                                                                                                         'line' => 119,
  8440
+                                                                                                         'line' => 115,
8449 8441
                                                                                                          'code' => '{ \'abstract\'     }'
8450 8442
                                                                                                        }, 'Parse::RecDescent::Action' )
8451 8443
                                                                                               ],
@@ -8465,16 +8457,16 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8465 8457
                                                                                                          'hashname' => '__STRING1__',
8466 8458
                                                                                                          'description' => '\'native\'',
8467 8459
                                                                                                          'lookahead' => 0,
8468  
-                                                                                                         'line' => 120
  8460
+                                                                                                         'line' => 116
8469 8461
                                                                                                        }, 'Parse::RecDescent::Literal' ),
8470 8462
                                                                                                 bless( {
8471 8463
                                                                                                          'hashname' => '__ACTION1__',
8472 8464
                                                                                                          'lookahead' => 0,
8473  
-                                                                                                         'line' => 120,
  8465
+                                                                                                         'line' => 116,
8474 8466
                                                                                                          'code' => '{ \'native\'       }'
8475 8467
                                                                                                        }, 'Parse::RecDescent::Action' )
8476 8468
                                                                                               ],
8477  
-                                                                                   'line' => 120
  8469
+                                                                                   'line' => 116
8478 8470
                                                                                  }, 'Parse::RecDescent::Production' ),
8479 8471
                                                                           bless( {
8480 8472
                                                                                    'number' => 2,
@@ -8490,16 +8482,16 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8490 8482
                                                                                                          'hashname' => '__STRING1__',
8491 8483
                                                                                                          'description' => '\'static\'',
8492 8484
                                                                                                          'lookahead' => 0,
8493  
-                                                                                                         'line' => 121
  8485
+                                                                                                         'line' => 117
8494 8486
                                                                                                        }, 'Parse::RecDescent::Literal' ),
8495 8487
                                                                                                 bless( {
8496 8488
                                                                                                          'hashname' => '__ACTION1__',
8497 8489
                                                                                                          'lookahead' => 0,
8498  
-                                                                                                         'line' => 121,
  8490
+                                                                                                         'line' => 117,
8499 8491
                                                                                                          'code' => '{ \'static\'       }'
8500 8492
                                                                                                        }, 'Parse::RecDescent::Action' )
8501 8493
                                                                                               ],
8502  
-                                                                                   'line' => 121
  8494
+                                                                                   'line' => 117
8503 8495
                                                                                  }, 'Parse::RecDescent::Production' ),
8504 8496
                                                                           bless( {
8505 8497
                                                                                    'number' => 3,
@@ -8515,16 +8507,16 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8515 8507
                                                                                                          'hashname' => '__STRING1__',
8516 8508
                                                                                                          'description' => '\'synchronized\'',
8517 8509
                                                                                                          'lookahead' => 0,
8518  
-                                                                                                         'line' => 122
  8510
+                                                                                                         'line' => 118
8519 8511
                                                                                                        }, 'Parse::RecDescent::Literal' ),
8520 8512
                                                                                                 bless( {
8521 8513
                                                                                                          'hashname' => '__ACTION1__',
8522 8514
                                                                                                          'lookahead' => 0,
8523  
-                                                                                                         'line' => 122,
  8515
+                                                                                                         'line' => 118,
8524 8516
                                                                                                          'code' => '{ \'synchronized\' }'
8525 8517
                                                                                                        }, 'Parse::RecDescent::Action' )
8526 8518
                                                                                               ],
8527  
-                                                                                   'line' => 122
  8519
+                                                                                   'line' => 118
8528 8520
                                                                                  }, 'Parse::RecDescent::Production' ),
8529 8521
                                                                           bless( {
8530 8522
                                                                                    'number' => 4,
@@ -8540,21 +8532,21 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8540 8532
                                                                                                          'hashname' => '__STRING1__',
8541 8533
                                                                                                          'description' => '\'final\'',
8542 8534
                                                                                                          'lookahead' => 0,
8543  
-                                                                                                         'line' => 123
  8535
+                                                                                                         'line' => 119
8544 8536
                                                                                                        }, 'Parse::RecDescent::Literal' ),
8545 8537
                                                                                                 bless( {
8546 8538
                                                                                                          'hashname' => '__ACTION1__',
8547 8539
                                                                                                          'lookahead' => 0,
8548  
-                                                                                                         'line' => 123,
  8540
+                                                                                                         'line' => 119,
8549 8541
                                                                                                          'code' => '{ \'final\'        }'
8550 8542
                                                                                                        }, 'Parse::RecDescent::Action' )
8551 8543
                                                                                               ],
8552  
-                                                                                   'line' => 123
  8544
+                                                                                   'line' => 119
8553 8545
                                                                                  }, 'Parse::RecDescent::Production' )
8554 8546
                                                                         ],
8555 8547
                                                              'name' => 'method_qualifier',
8556 8548
                                                              'vars' => '',
8557  
-                                                             'line' => 119
  8549
+                                                             'line' => 115
8558 8550
                                                            }, 'Parse::RecDescent::Rule' ),
8559 8551
                               'comma_list' => bless( {
8560 8552
                                                        'impcount' => 0,
@@ -8580,14 +8572,14 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8580 8572
                                                                                                    'implicit' => undef,
8581 8573
                                                                                                    'argcode' => undef,
8582 8574
                                                                                                    'lookahead' => 0,
8583  
-                                                                                                   'line' => 142
  8575
+                                                                                                   'line' => 138
8584 8576
                                                                                                  }, 'Parse::RecDescent::Subrule' ),
8585 8577
                                                                                           bless( {
8586 8578
                                                                                                    'pattern' => ',',
8587 8579
                                                                                                    'hashname' => '__STRING1__',
8588 8580
                                                                                                    'description' => '\',\'',
8589 8581
                                                                                                    'lookahead' => 0,
8590  
-                                                                                                   'line' => 142
  8582
+                                                                                                   'line' => 138
8591 8583
                                                                                                  }, 'Parse::RecDescent::Literal' ),
8592 8584
                                                                                           bless( {
8593 8585
                                                                                                    'subrule' => 'comma_list',
@@ -8595,12 +8587,12 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8595 8587
                                                                                                    'implicit' => undef,
8596 8588
                                                                                                    'argcode' => undef,
8597 8589
                                                                                                    'lookahead' => 0,
8598  
-                                                                                                   'line' => 142
  8590
+                                                                                                   'line' => 138
8599 8591
                                                                                                  }, 'Parse::RecDescent::Subrule' ),
8600 8592
                                                                                           bless( {
8601 8593
                                                                                                    'hashname' => '__ACTION1__',
8602 8594
                                                                                                    'lookahead' => 0,
8603  
-                                                                                                   'line' => 142,
  8595
+                                                                                                   'line' => 138,
8604 8596
                                                                                                    'code' => '{
8605 8597
                 my @names = ( $item[1] );
8606 8598
                 if ( ref( $item[3] ) eq \'ARRAY\' ) {
@@ -8630,23 +8622,23 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8630 8622
                                                                                                    'implicit' => undef,
8631 8623
                                                                                                    'argcode' => undef,
8632 8624
                                                                                                    'lookahead' => 0,
8633  
-                                                                                                   'line' => 152
  8625
+                                                                                                   'line' => 148
8634 8626
                                                                                                  }, 'Parse::RecDescent::Subrule' ),
8635 8627
                                                                                           bless( {
8636 8628
                                                                                                    'hashname' => '__ACTION1__',
8637 8629
                                                                                                    'lookahead' => 0,
8638  
-                                                                                                   'line' => 152,
  8630
+                                                                                                   'line' => 148,
8639 8631
                                                                                                    'code' => '{
8640 8632
                 [ $item[1] ]
8641 8633
             }'
8642 8634
                                                                                                  }, 'Parse::RecDescent::Action' )
8643 8635
                                                                                         ],
8644  
-                                                                             'line' => 152
  8636
+                                                                             'line' => 148
8645 8637
                                                                            }, 'Parse::RecDescent::Production' )
8646 8638
                                                                   ],
8647 8639
                                                        'name' => 'comma_list',
8648 8640
                                                        'vars' => '',
8649  
-                                                       'line' => 142
  8641
+                                                       'line' => 138
8650 8642
                                                      }, 'Parse::RecDescent::Rule' ),
8651 8643
                               'body_element' => bless( {
8652 8644
                                                          'impcount' => 0,
@@ -8868,7 +8860,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8868 8860
                                                                                                 'hashname' => '__STRING1__',
8869 8861
                                                                                                 'description' => '\'/*\'',
8870 8862
                                                                                                 'lookahead' => 0,
8871  
-                                                                                                'line' => 190
  8863
+                                                                                                'line' => 186
8872 8864
                                                                                               }, 'Parse::RecDescent::Literal' ),
8873 8865
                                                                                        bless( {
8874 8866
                                                                                                 'pattern' => '[^*]*',
@@ -8876,7 +8868,7 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8876 8868
                                                                                                 'description' => '/[^*]*/',
8877 8869
                                                                                                 'lookahead' => 0,
8878 8870
                                                                                                 'rdelim' => '/',
8879  
-                                                                                                'line' => 190,
  8871
+                                                                                                'line' => 186,
8880 8872
                                                                                                 'mod' => '',
8881 8873
                                                                                                 'ldelim' => '/'
8882 8874
                                                                                               }, 'Parse::RecDescent::Token' ),
@@ -8885,12 +8877,12 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8885 8877
                                                                                                 'hashname' => '__STRING2__',
8886 8878
                                                                                                 'description' => '\'*/\'',
8887 8879
                                                                                                 'lookahead' => 0,
8888  
-                                                                                                'line' => 190
  8880
+                                                                                                'line' => 186
8889 8881
                                                                                               }, 'Parse::RecDescent::Literal' ),
8890 8882
                                                                                        bless( {
8891 8883
                                                                                                 'hashname' => '__ACTION1__',
8892 8884
                                                                                                 'lookahead' => 0,
8893  
-                                                                                                'line' => 190,
  8885
+                                                                                                'line' => 186,
8894 8886
                                                                                                 'code' => '{}'
8895 8887
                                                                                               }, 'Parse::RecDescent::Action' )
8896 8888
                                                                                      ],
@@ -8905,12 +8897,12 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
8905 8897
                                                                           'patcount' => 0,
8906 8898
                                                                           'actcount' => 0,
8907 8899
                                                                           'items' => [],
8908  
-                                                                          'line' => 191
  8900
+                                                                          'line' => 187
8909 8901
                                                                         }, 'Parse::RecDescent::Production' )
8910 8902
                                                                ],
8911 8903
                                                     'name' => 'comment',
8912 8904
                                                     'vars' => '',
8913  
-                                                    'line' => 190
  8905
+                                                    'line' => 186
8914 8906
                                                   }, 'Parse::RecDescent::Rule' ),
8915 8907
                               'comp_stmt' => bless( {
8916 8908
                                                       'impcount' => 0,
@@ -9035,14 +9027,14 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
9035 9027
                                                                                                        'implicit' => undef,
9036 9028
                                                                                                        'argcode' => undef,
9037 9029
                                                                                                        'lookahead' => 0,
9038  
-                                                                                                       'line' => 138
  9030
+                                                                                                       'line' => 134
9039 9031
                                                                                                      }, 'Parse::RecDescent::Subrule' ),
9040 9032
                                                                                               bless( {
9041 9033
                                                                                                        'pattern' => '.',
9042 9034
                                                                                                        'hashname' => '__STRING1__',
9043 9035
                                                                                                        'description' => '\'.\'',
9044 9036
                                                                                                        'lookahead' => 0,
9045  
-                                                                                                       'line' => 138
  9037
+                                                                                                       'line' => 134
9046 9038
                                                                                                      }, 'Parse::RecDescent::Literal' ),
9047 9039
                                                                                               bless( {
9048 9040
                                                                                                        'subrule' => 'qualified_name',
@@ -9050,12 +9042,12 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
9050 9042
                                                                                                        'implicit' => undef,
9051 9043
                                                                                                        'argcode' => undef,
9052 9044
                                                                                                        'lookahead' => 0,
9053  
-                                                                                                       'line' => 138
  9045
+                                                                                                       'line' => 134
9054 9046
                                                                                                      }, 'Parse::RecDescent::Subrule' ),
9055 9047
                                                                                               bless( {
9056 9048
                                                                                                        'hashname' => '__ACTION1__',
9057 9049
                                                                                                        'lookahead' => 0,
9058  
-                                                                                                       'line' => 139,
  9050
+                                                                                                       'line' => 135,
9059 9051
                                                                                                        'code' => '{ "$item{NAME}.$item{qualified_name}" }'
9060 9052
                                                                                                      }, 'Parse::RecDescent::Action' )
9061 9053
                                                                                             ],
@@ -9076,21 +9068,21 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
9076 9068
                                                                                                        'implicit' => undef,
9077 9069
                                                                                                        'argcode' => undef,
9078 9070
                                                                                                        'lookahead' => 0,
9079  
-                                                                                                       'line' => 140
  9071
+                                                                                                       'line' => 136
9080 9072
                                                                                                      }, 'Parse::RecDescent::Subrule' ),
9081 9073
                                                                                               bless( {
9082 9074
                                                                                                        'hashname' => '__ACTION1__',
9083 9075
                                                                                                        'lookahead' => 0,
9084  
-                                                                                                       'line' => 140,
  9076
+                                                                                                       'line' => 136,
9085 9077
                                                                                                        'code' => '{ $item[1] }'
9086 9078
                                                                                                      }, 'Parse::RecDescent::Action' )
9087 9079
                                                                                             ],
9088  
-                                                                                 'line' => 140
  9080
+                                                                                 'line' => 136
9089 9081
                                                                                }, 'Parse::RecDescent::Production' )
9090 9082
                                                                       ],
9091 9083
                                                            'name' => 'qualified_name',
9092 9084
                                                            'vars' => '',
9093  
-                                                           'line' => 138
  9085
+                                                           'line' => 134
9094 9086
                                                          }, 'Parse::RecDescent::Rule' ),
9095 9087
                               'CLASS_OR_INTERFACE' => bless( {
9096 9088
                                                                'impcount' => 0,
@@ -9112,12 +9104,12 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
9112 9104
                                                                                                            'hashname' => '__STRING1__',
9113 9105
                                                                                                            'description' => '\'class\'',
9114 9106
                                                                                                            'lookahead' => 0,
9115  
-                                                                                                           'line' => 187
  9107
+                                                                                                           'line' => 183
9116 9108
                                                                                                          }, 'Parse::RecDescent::Literal' ),
9117 9109
                                                                                                   bless( {
9118 9110
                                                                                                            'hashname' => '__ACTION1__',
9119 9111
                                                                                                            'lookahead' => 0,
9120  
-                                                                                                           'line' => 187,
  9112
+                                                                                                           'line' => 183,
9121 9113
                                                                                                            'code' => '{ $item[1] }'
9122 9114
                                                                                                          }, 'Parse::RecDescent::Action' )
9123 9115
                                                                                                 ],
@@ -9137,21 +9129,21 @@ package Java::Javap::Grammar; sub new { my $self = bless( {
9137 9129
                                                                                                            'hashname' => '__STRING1__',
9138 9130
                                                                                                            'description' => '\'interface\'',
9139 9131
                                                                                                            'lookahead' => 0,
9140  
-                                                                                                           'line' => 188
  9132
+                                                                                                           'line' => 184
9141 9133
                                                                                                          }, 'Parse::RecDescent::Literal' ),
9142 9134
                                                                                                   bless( {
9143 9135
                                                                                                            'hashname' => '__ACTION1__',
9144 9136
                                                                                                            'lookahead' => 0,
9145  
-                                                                                                           'line' => 188,
  9137
+                                                                                                           'line' => 184,
9146 9138
                                                                                                            'code' => '{ $item[1] }'
9147 9139
                                                                                                          }, 'Parse::RecDescent::Action' )
9148 9140
                                                                                                 ],
9149  
-                                                                                     'line' => 188
  9141
+                                                                                     'line' => 184
9150 9142
                                                                                    }, 'Parse::RecDescent::Production' )
9151 9143
                                                                           ],
9152 9144
                                                                'name' => 'CLASS_OR_INTERFACE',
9153 9145
                                                                'vars' => '',
9154  
-                                                               'line' => 187
  9146
+                                                               'line' => 183
9155 9147
                                                              }, 'Parse::RecDescent::Rule' )
9156 9148
                             },
9157 9149
                  '_AUTOTREE' => undef,
14  lib/Java/Javap/javap.grammar
@@ -82,31 +82,27 @@ method : ACCESS method_qualifier(s?)
82 82
          arg NAME '(' arg_list(?) ')'
83 83
          throws_clause(?) ';' {
84 84
              $methods{ $item[4] }++;
85  
-             my $args = $item{ 'arg_list(?)' }[0];
86  
-             $args    = [] unless defined $args;
87 85
              {
88 86
                  body_element => 'method',
89 87
                  access       => $item[1],
90 88
                  attrs        => $item[2],
91 89
                  type         => $item[3][0],
92 90
                  name         => $item[4],
93  
-                 args         => $args,
94  
-                 throws       => $item{ 'throws_clause(?)' },
  91
+                 args         => $item{ 'arg_list(?)' }[0] || [],
  92
+                 throws       => $item{ 'throws_clause(?)' }[0] || [],
95 93
              }
96 94
          }
97 95
        | ACCESS /(native)?/ qualified_name '(' arg_list(?) ')'
98 96
          throws_clause(?) ';' {
99 97
              $constructors++;
100 98
              $methods{ 'new' }++;
101  
-             my $args = $item{ 'arg_list(?)' }[0];
102  
-             $args    = [] unless defined $args;
103 99
              {
104 100
                  body_element => 'constructor',
105 101
                  access       => $item[1],
106 102
                  native       => ( $item[2] eq 'native' ) ? 'native' : '',
107  
-                 args         => $args,
108  
-                 throws       => $item{ 'throws_clause(?)' },
109  
-                 # add name and returns so constructor data is like a method
  103
+                 args         => $item{ 'arg_list(?)' }[0] || [],
  104
+                 throws       => $item{ 'throws_clause(?)' }[0] || [],
  105
+                 # add name and type so constructor data is like a method
110 106
                  name         => 'new',
111 107
                  type         => {
112 108
                     array_depth => 0,

0 notes on commit 90eb631

Please sign in to comment.
Something went wrong with that request. Please try again.