Dr.Ruud wrote:

Erik schreef:
Dr.Ruud:
Erik:
Right. That code2html is full of those superfluous capture groups, so I
guess there is no real need to use (?:...).
I think it would be a good idea to fix them at least for the places that I modify.


If you dont want to allow "a_", you can make it
 /\b[[:alpha:]]+(?:_?[[:alpha:]0-9]+)*\b/
That does not seem to be necessary, because the previous expression
aready seems to exclude "a_".

Oops, you're right, the [a-zA-Z](_?[a-zA-Z0-9])* did it already.
I inserted the '+' there, because often more that 1 letter follows an
underscore.
That should work without the + because of the * at the end.


It is a good idea to put an
  use encoding 'latin1';
in the top of your source, because the default is utf8 (which is the
Perl-variant of UTF-8).
I tried it but then I get a lot of errors when I run the script:
<FILENAME>: Malformed UTF-8 character (unexpected non-continuation
byte 0x00, immediately after start byte 0xe5) in pattern match (m//)
at <FILENAME> line 841.
Which version of Perl did you use?
This is perl, v5.8.7 built for i686-linux (Gentoo). It seems like it is not the file code2html itself it complains about. I can also colorize the file itself. It is when I try it with "use encoding 'latin1';" on the Ada file that it fails. If I change the letter 'å' to something else, code2html works. Adding "use locale;" to the script reduces the number of errors to 14% (from 99 to 14 or from 297 to 42, depending on wether I have 1 or 3 'å' characters in the Ada file). Do you get the error if you try code2html on the attached prov.adb?
with Ada.Text_IO; use Ada.Text_IO;
procedure Prov is
   Aål     : Natural := 0;
   A_      : Natural := 0; --  Illegal
   A_Boro  : Natural := 0;
   Go_9r_5 : Natural := 0;
   9_Are_7 : Natural := 0; --  Illegal
   AB__CD  : Natural := 0; --  Illegal
   _P      : Natural := 0; --  Illegal
begin
   Put_Line ("Aål =" & Aål'Img);
end Prov;

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>

Reply via email to