]> git.sur5r.net Git - cc65/commitdiff
Allow to leave of the end address of a range if it is identical to the start
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 13 Jun 2011 21:43:26 +0000 (21:43 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 13 Jun 2011 21:43:26 +0000 (21:43 +0000)
address. Currently unused.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5059 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/dbginfo/dbginfo.c

index fce96c3e229e5a471a572d45129af1bb65d6c45e..0b1d9e2c091efc580109b8eccd60eec5f26db6f0 100644 (file)
@@ -1733,14 +1733,6 @@ static int ConsumeEqual (InputData* D)
 
 
 
-static int ConsumeMinus (InputData* D)
-/* Consume a minus sign */
-{
-    return Consume (D, TOK_MINUS, "'-'");
-}
-
-
-
 static void ConsumeEOL (InputData* D)
 /* Consume an end-of-line token, if we aren't at end-of-file */
 {
@@ -1959,14 +1951,18 @@ static void ParseLine (InputData* D)
                 }
                 Start = (cc65_addr) D->IVal;
                 NextToken (D);
-                if (!ConsumeMinus (D)) {
-                    goto ErrorExit;
-                }
-                if (!IntConstFollows (D)) {
-                    goto ErrorExit;
+                if (D->Tok == TOK_MINUS) {
+                    /* End of range follows */
+                    NextToken (D);
+                    if (!IntConstFollows (D)) {
+                        goto ErrorExit;
+                    }
+                    End = (cc65_addr) D->IVal;
+                    NextToken (D);
+                } else {
+                    /* Start and end are identical */
+                    End = Start;
                 }
-                End = (cc65_addr) D->IVal;
-                NextToken (D);
                 InfoBits |= ibRange;
                 break;
 
@@ -2237,7 +2233,7 @@ static void ParseSym (InputData* D)
 
         /* Something we know? */
         if (D->Tok != TOK_ADDRSIZE      && D->Tok != TOK_NAME   &&
-            D->Tok != TOK_SEGMENT       && D->Tok != TOK_SIZE   && 
+            D->Tok != TOK_SEGMENT       && D->Tok != TOK_SIZE   &&
             D->Tok != TOK_TYPE          && D->Tok != TOK_VALUE) {
 
             /* Try smart error recovery */