]> git.sur5r.net Git - cc65/commitdiff
Fixed handling of expressions in .word and .addr instructions.
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 31 Jul 2005 12:25:20 +0000 (12:25 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 31 Jul 2005 12:25:20 +0000 (12:25 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@3562 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ca65html/ca65html

index 82bdf53aa169890b7c2d015df0c7be7a77a4d1e2..09a222ce4ada42a0ed505e7d813657aaab888a4e 100755 (executable)
@@ -687,23 +687,21 @@ sub Process2 {
                    $OutLine .= $&;
 
            # Print all identifiers if there are any
-           while ($Line =~ /^([_a-zA-Z]\w*)(.*)$/) {
-               if (exists ($Labels{$OutName}{$1})) {
-                   $Label = $Labels{$OutName}{$1};
-                           $OutLine .= sprintf ("<a href=\"#%s\">%s</a>", $Label, $1);
+                   while ($Line =~ /^([^_a-zA-Z]*)([_a-zA-Z]\w*)(.*)$/) {
+                # Add the non label stuff
+                $OutLine .= Cleanup ($1);
+
+                # If the identifier is a known label, add a link
+               if (exists ($Labels{$OutName}{$2})) {
+                   $Label = $Labels{$OutName}{$2};
+                           $OutLine .= sprintf ("<a href=\"#%s\">%s</a>", $Label, $2);
                } else {
-                   $OutLine .= $1;
+                   $OutLine .= $2;
                }
-               $Line = $2;
-               if ($Line =~ s/^\s*,\s*//) {
-                   $OutLine .= $&;
-               } else {
-                   last;
-               }
-           }
 
-           # Add an remainder if there is one
-           $OutLine .= Cleanup ($Line);
+                # Proceed with the remainder of the line
+               $Line = $3;
+           }
 
        # Handle .proc
                } elsif ($Line =~ /^(\.proc)(\s+)([_a-zA-Z]\w*)?(.*)$/) {