Charj: wrap POINTER_TYPE, not just REFERENCE_TYPE
authorAaron Becker <akbecker@gmail.com>
Tue, 28 Sep 2010 20:25:07 +0000 (15:25 -0500)
committerAaron Becker <akbecker@gmail.com>
Tue, 28 Sep 2010 20:25:07 +0000 (15:25 -0500)
src/langs/charj/src/charj/translator/SymbolDefiner.g

index e540fca5da0b931ccf91bd9791042cd653de2f58..2f8de2bb1d268e5641bd97498ee82f1f70548c6d 100644 (file)
@@ -279,7 +279,11 @@ type returns [Type namedType]
                 $namedType = base == null ? null : new ProxyType(symtab, base);
             }
     |   ^(POINTER_TYPE ^(QUALIFIED_TYPE_IDENT (^(i1=IDENT {typeName.add(new TypeName($i1.text));} .*))+) .*)
-            { $POINTER_TYPE.scope = currentScope; }
+            {
+                $POINTER_TYPE.scope = currentScope;
+                Type base = currentScope.resolveType(typeName);
+                $namedType = base == null ? null : new PointerType(symtab, base);
+            }
        |       ^(ARRAY_SECTION_TYPE ^(QUALIFIED_TYPE_IDENT
             (^(IDENT {typeName.add(new TypeName($IDENT.text));} . ))+) .*)
                        {