]> git.sur5r.net Git - cc65/blobdiff - src/ca65/pseudo.c
Added cc65_line_bysource
[cc65] / src / ca65 / pseudo.c
index 5437f07401aa46457bef5a8ac578e78098cc28a3..3a2e391d39796aa600a99d896c3c4ff0a46b5c12 100644 (file)
@@ -47,6 +47,7 @@
 #include "cddefs.h"
 #include "coll.h"
 #include "intstack.h"
+#include "scopedefs.h"
 #include "symdefs.h"
 #include "tgttrans.h"
 #include "xmalloc.h"
@@ -816,7 +817,7 @@ static void DoEnd (void)
 static void DoEndProc (void)
 /* Leave a lexical level */
 {
-    if (GetCurrentSymTabType () != ST_PROC) {
+    if (CurrentScope->Type != SCOPE_SCOPE || CurrentScope->Label == 0) {
         /* No local scope */
         ErrorSkip ("No open .PROC");
     } else {
@@ -829,7 +830,7 @@ static void DoEndProc (void)
 static void DoEndScope (void)
 /* Leave a lexical level */
 {
-    if ( GetCurrentSymTabType () != ST_SCOPE) {
+    if (CurrentScope->Type != SCOPE_SCOPE || CurrentScope->Label != 0) {
         /* No local scope */
         ErrorSkip ("No open .SCOPE");
     } else {
@@ -1508,12 +1509,12 @@ static void DoProc (void)
 {
     StrBuf Name = STATIC_STRBUF_INITIALIZER;
     unsigned char AddrSize;
+    SymEntry* Sym = 0;
 
-    if (CurTok.Tok == TOK_IDENT) {
 
-        SymEntry* Sym;
+    if (CurTok.Tok == TOK_IDENT) {
 
-       /* The new scope has a name. Remember it. */
+       /* The new scope has a name. Remember it. */
         SB_Copy (&Name, &CurTok.SVal);
 
         /* Search for the symbol, generate a new one if needed */
@@ -1538,7 +1539,7 @@ static void DoProc (void)
     }
 
     /* Enter a new scope */
-    SymEnterLevel (&Name, ST_PROC, AddrSize);
+    SymEnterLevel (&Name, SCOPE_SCOPE, AddrSize, Sym);
 
     /* Free memory for Name */
     SB_Done (&Name);
@@ -1665,7 +1666,7 @@ static void DoScope (void)
     AddrSize = OptionalAddrSize ();
 
     /* Enter the new scope */
-    SymEnterLevel (&Name, ST_SCOPE, AddrSize);
+    SymEnterLevel (&Name, SCOPE_SCOPE, AddrSize, 0);
 
     /* Free memory for Name */
     SB_Done (&Name);
@@ -1759,7 +1760,7 @@ static void DoTag (void)
         ErrorSkip ("Unknown struct");
         return;
     }
-    if (GetSymTabType (Struct) != ST_STRUCT) {
+    if (GetSymTabType (Struct) != SCOPE_STRUCT) {
         ErrorSkip ("Not a struct");
         return;
     }