[cc65] Another ca65html tweak

From: MagerValp <MagerValp1cling.gu.se>
Date: 2006-10-12 21:39:57
I adjusted some of the regexps in ca65html again, to better detect
labels, and to eliminate false positives where labels start with three
characters matching an opcode:

--- ca65html     2006-09-20 17:34:04.000000000 +0200
+++ ca65html     2006-10-12 21:31:54.000000000 +0200
@@ -430,7 +430,7 @@
                chomp ($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 "\@") {
@@ -605,7 +605,7 @@

                # 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 "\@") {
@@ -873,7 +873,7 @@
            $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;
@@ -902,7 +902,7 @@
                    $OutLine .= $Operand;

        # Check for all other instructions
-       } elsif ($Line =~ /^($AllIns)(.*)$/) {
+       } elsif ($Line =~ /^($AllIns)\b(.*)$/) {

            # Colorize and print
             $OutLine .= ColorizeKeyword ($1) . Cleanup ($2);

-- 
    ___          .     .  .         .       . +  .         .      o   
  _|___|_   +   .  +     .     +         .  Per Olofsson, arkadspelare
    o-o    .      .     .   o         +          MagerValp@cling.gu.se
     -       +            +    .     http://www.cling.gu.se/~cl3polof/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Oct 12 21:40:10 2006

This archive was generated by hypermail 2.1.8 : 2006-10-12 21:40:15 CEST