musiKk / plyj

A Java parser written in Python using PLY.
Other
150 stars 69 forks source link

Information loss of FieldDeclaration Types Dimension #39

Closed AKST closed 9 years ago

AKST commented 9 years ago

Here is a sample file

/* IndexUF.java */
public class IndexUF<T extends Object> {
  private Indexed<T>[] parent;

  static private class Indexed<T> {
    public int index;
    public T value;
  }
}

When I check the parse output of parent's type's dimension, it is set too 0 so example below will fail the assertion.

index_uf = parser.parse_file(file('IndexUF.java'))
assert index_uf.type_declarations[0].body[0].type.dimensions == 1

I found this while testing the output of my pretty printer, and it turned out the issue was in the AST.

musiKk commented 9 years ago

Thanks! Fixed in master.

AKST commented 9 years ago

No worries!