Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 133176 - code2html does not recognize Ada identifiers (partial fix attached)
Summary: code2html does not recognize Ada identifiers (partial fix attached)
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Leonardo Boshell (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-13 01:12 UTC by Erik
Modified: 2009-05-30 16:41 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix for the first part of the problem. (ada_identifiers_fix_partial-1.diff,580 bytes, patch)
2006-05-13 01:13 UTC, Erik
Details | Diff
Patch that fixes the first part of the problem. (ada_identifiers_fix_partial-1.diff,767 bytes, patch)
2006-05-13 10:03 UTC, Erik
Details | Diff
Patch that fixes the problem for me if I have LANG set to swedish. (ada_identifiers_fix-2.diff,1.59 KB, patch)
2006-05-14 04:41 UTC, Erik
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erik 2006-05-13 01:12:13 UTC
Upstream bug report at:
https://sourceforge.net/tracker/index.php?func=detail&aid=1487803&group_id=2902&atid=102902

Ada identifiers are not correctly recognized. The first problem is that it detects words like A__B and B_ as Ada identifiers, which they are not. The second problem is that it does not detect words like T
Comment 1 Erik 2006-05-13 01:12:13 UTC
Upstream bug report at:
https://sourceforge.net/tracker/index.php?func=detail&aid=1487803&group_id=2902&atid=102902

Ada identifiers are not correctly recognized. The first problem is that it detects words like A__B and B_ as Ada identifiers, which they are not. The second problem is that it does not detect words like Täthet and Anlaß as identifiers, which they are.
Comment 2 Erik 2006-05-13 01:13:30 UTC
Created attachment 86687 [details, diff]
Fix for the first part of the problem.
Comment 3 Erik 2006-05-13 10:03:27 UTC
Created attachment 86708 [details, diff]
Patch that fixes the first part of the problem.

After getting some help at 
http://www.nntp.perl.org/group/perl.beginners/83569 I have 
modified the partial fix:
* use character class [:alpha:]
* use more compact and clever character class [^\W_]
* use the non-capturing group (?:)

The second problem is more complicated. Perl expects input 
in UTF-8 encoding. Since Ada sourcecode is in latin1 
(comments can be in any encoding), an input layer is 
needed. An output layer is probably also needed, since HTML 
should have things like "å".
Comment 4 Erik 2006-05-14 04:40:37 UTC
Now I finally made a patch that fixes all the problem cases for me. It adds "use locale;". I also added character set headers to the HTML templates. I had to make sure that LANG is set to swedish in the shell where I run code2html to make it work.
Comment 5 Erik 2006-05-14 04:41:34 UTC
Created attachment 86744 [details, diff]
Patch that fixes the problem for me if I have LANG set to swedish.
Comment 6 Leonardo Boshell (RETIRED) gentoo-dev 2006-05-17 13:45:26 UTC
Thanks, committed for code2html-0.9.1-r1.