My company uses a version of Perl where you can define by binary number using something like my $var = 'b010110110;
etc. Problem is both perl-mode
and cperl-mode
interpret '
as the start of the string and will apply a string font lock to everything until the next '
. This causes large sections of code are to appear as a string when they are not.
I have looked into how Emacs defines strings, and it does not have a string start
or string end
syntax class. Rather it just has a string quote character
syntax class of which both "
and '
are members of in Perl modes.
I have modified the syntax table to changed the '
character from the string quote character
class to the punctuation character
class. This fixes the problems of stringifying blocks of code but normal strings quoted with '
are no longer recognized.
I need a really smart person who can show me some code to modify the syntax highlighting of Perl so that strings are recognized as strings and binary notation is recognized as binary notation. How can I accomplish this?