dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/codegen cg_scope.c,1.12,1.13 cg_scope.h,


From: Gopal.V <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/codegen cg_scope.c,1.12,1.13 cg_scope.h,1.11,1.12
Date: Fri, 15 Nov 2002 15:26:31 -0500

Update of /cvsroot/dotgnu-pnet/pnet/codegen
In directory subversions:/tmp/cvs-serv6796/codegen

Modified Files:
        cg_scope.c cg_scope.h 
Log Message:
hopefully this should fixing using aliases


Index: cg_scope.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/codegen/cg_scope.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** cg_scope.c  15 Nov 2002 12:50:57 -0000      1.12
--- cg_scope.c  15 Nov 2002 20:26:28 -0000      1.13
***************
*** 382,415 ****
  }
  
! int ILScopeUsing(ILScope *scope, const char *identifier, const char *alias)
  {
        ILScope *namespaceScope = FindNamespaceScope(scope, identifier);
        if(!namespaceScope)
        {
                return 0;
        }
!       if(alias)
        {
!               /* Create a sub-scope that links across to the "using" 
namespace */
!               AddToScope(scope, alias, IL_SCOPE_SUBSCOPE, 0, namespaceScope, 
0);
        }
!       else
!       {
!               /* Add the "using" declaration to the scope as an attribute.
!                  We allocate from the data pool, because it isn't worth
!                  creating a special pool just for "using" declarations */
!               ILScopeUsingInfo *using;
!               using = ILMemPoolAlloc(&(scope->info->scopeDataPool), 
ILScopeUsingInfo);
!               if(!using)
!               {
!                       ILGenOutOfMemory(scope->info);
!               }
!               using->refScope = namespaceScope;
!               using->next = scope->using;
!               scope->using = using;
  
-               /* Change the lookup function to one which handles "using" 
clauses */
-               scope->lookup = UsingScope_Lookup;
-       }
        return 1;
  }
--- 382,408 ----
  }
  
! int ILScopeUsing(ILScope *scope, const char *identifier)
  {
        ILScope *namespaceScope = FindNamespaceScope(scope, identifier);
+       ILScopeUsingInfo *using;
        if(!namespaceScope)
        {
                return 0;
        }
!       /* Add the "using" declaration to the scope as an attribute.
!          We allocate from the data pool, because it isn't worth
!          creating a special pool just for "using" declarations */
!       using = ILMemPoolAlloc(&(scope->info->scopeDataPool), ILScopeUsingInfo);
!       if(!using)
        {
!               ILGenOutOfMemory(scope->info);
        }
!       using->refScope = namespaceScope;
!       using->next = scope->using;
!       scope->using = using;
!       
!       /* Change the lookup function to one which handles "using" clauses */
!       scope->lookup = UsingScope_Lookup;
  
        return 1;
  }

Index: cg_scope.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/codegen/cg_scope.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** cg_scope.h  15 Nov 2002 12:50:57 -0000      1.11
--- cg_scope.h  15 Nov 2002 20:26:28 -0000      1.12
***************
*** 78,82 ****
   * is not a namespace.
   */
! int ILScopeUsing(ILScope *scope, const char *identifier, const char *alias);
  
  /*
--- 78,82 ----
   * is not a namespace.
   */
! int ILScopeUsing(ILScope *scope, const char *identifier);
  
  /*





reply via email to

[Prev in Thread] Current Thread [Next in Thread]