]> git.sur5r.net Git - cc65/blobdiff - src/ca65html/ca65html
MagerValp: I adjusted some of the regexps in ca65html again, to better detect
[cc65] / src / ca65html / ca65html
index 09a222ce4ada42a0ed505e7d813657aaab888a4e..6062db0f68a97ac3232441400b1c48a1940b1214 100755 (executable)
@@ -388,7 +388,7 @@ sub Process1 {
                chop ($Line);
 
                # Check for a label
-               if ($Line =~ /^\s*(\@?)([_a-zA-Z]\w*)\s*(:|=)/) {
+        if ($Line =~ /^\s*(\@?)([_a-zA-Z]\w*)(:(?!=)|\s*:?=)/)
 
            # Is this a local label?
            if ($1 eq "\@") {
@@ -559,7 +559,7 @@ sub Process2 {
 
                # Check for a label at the start of the line. If we have one, process
         # it and remove it from the line
-       if ($Line =~ s/^\s*?(\@?)([_a-zA-Z]\w*)(\s*)(:|=)//) {
+        if ($Line =~ s/^\s*?(\@?)([_a-zA-Z]\w*)(:(?!=)|\s*:?=)//) {
 
            # Is this a local label?
                    if ($1 eq "\@") {
@@ -703,6 +703,9 @@ sub Process2 {
                $Line = $3;
            }
 
+           # Add an remainder if there is one
+           $OutLine .= Cleanup ($Line);
+
        # Handle .proc
                } elsif ($Line =~ /^(\.proc)(\s+)([_a-zA-Z]\w*)?(.*)$/) {
 
@@ -822,7 +825,7 @@ sub Process2 {
            $OutLine .= Cleanup ($Line);
 
        # Check for instructions with labels
-       } elsif ($Line =~ /^($LabelIns)(\s+)(.*)$/) {
+        } elsif ($Line =~ /^($LabelIns)\b(\s+)(.*)$/) {
 
            # Print the instruction and white space
             $OutLine .= ColorizeKeyword ($1) . $2;
@@ -851,7 +854,7 @@ sub Process2 {
                    $OutLine .= $Operand;
 
        # Check for all other instructions
-       } elsif ($Line =~ /^($AllIns)(.*)$/) {
+        } elsif ($Line =~ /^($AllIns)\b(.*)$/) {
 
            # Colorize and print
             $OutLine .= ColorizeKeyword ($1) . Cleanup ($2);