Tapatalk

ada95 wordfile erroneous

ada95 wordfile erroneous

2
NewbieNewbie
2

    Mar 22, 2005#1

    Here's a simple piece of ada code :

    Code: Select all

    with text_io;
    
    procedure proc is
    
    	subtype string6 is string(1..6);
    
    	achar   : character := 'a';
    	astring : string6   := "string";
    
    begin
    
    	text_io.put("toto" & integer'image(10));
    	null;
    
    end;
    Now, when using the ada95 wordfile from Downloads - Extras - Wordfiles, there are several problems :
    1. the 'a' @ line 2 should be displayed like the "string" @ line 3, as stated in /C1 part.
    2. the ' of integer'image hasn't the same meaning, and shouldn't lead to corruption of the next lines as it will never be "closed" (remove it and the last 2 lines will look the way they should).

    Seeing single quotes need only to be matched for 1 character long expressions, whereas single quotes used to access special attributes of a given type will always be fallowed by a opening parenthesis, as in "type'attribute(", I guess there should be an easy way to fix this. I would be much gratefull if someone fluent with Wordfiles and regular expressions could provide me with the solution.

    6,685587
    Grand MasterGrand Master
    6,685587

      Mar 23, 2005#2

      Can't see what's the problem with integer'image but first problem can be easily solved.

      Remove ' from /C4, because a "word" cannot be defined twice and ' at /C4 has no effect at integer'image because it is not defined as word delimiter. You can also delete whole group /C1, because the color of the strings can also be defined at syntax highlighting configuration dialog so it is not necessary to assign the strings to color group 1.

      Second mistake I found in the ada95.txt file is, that Nocase is defined wrong. The language definition words are case-sensitive, so NoCASE is ignored by UltraEdit. If the language is case-sensitive, remove NoCASE. If it is not case-sensitive, define it correct with Nocase.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Mar 23, 2005#3

        Mofi wrote:Remove ' from /C4, because a "word" cannot be defined twice and ' at /C4 has no effect at integer'image because it is not defined as word delimiter. You can also delete whole group /C1, because the color of the strings can also be defined at syntax highlighting configuration dialog so it is not necessary to assign the strings to color group 1.
        Done, indeed, 'a' and "string" appear now in the same color and I can change it using syntax highlighting configuration dialog.
        Mofi wrote:Can't see what's the problem with integer'image
        If you simply copy/paste this text and highlight it, "null" and "end" lines appear as strings... Remove the quote from integer'image and they will look the way they should.
        Only way I found to fix this is to remove ' from "/L20 "Ada95" Line Comment = -- NoCASE String Chars = "' File Extensions = ADA ADS ADB", but then 'a' isn't highlighted...
        Mofi wrote:Second mistake I found in the ada95.txt file is, that Nocase is defined wrong. The language definition words are case-sensitive, so NoCASE is ignored by UltraEdit. If the language is case-sensitive, remove NoCASE. If it is not case-sensitive, define it correct with Nocase.
        Ada isn't case sensitive afaik (at least the version I use isn't). What would be the correct definition then?

        6,685587
        Grand MasterGrand Master
        6,685587

          Mar 23, 2005#4

          occultus wrote:If you simply copy/paste this text and highlight it, "null" and "end" lines appear as strings... Remove the quote from integer'image and they will look the way they should.
          I have tested it and "end" and "null" are highlighted correct with V10.10c of UE. The ' of integer'image is ignored by UE because the ' is part of word "integer'image". The ' is not a delimiter. Check if you don't have added ' to the delimiters characters. I don't have any experience with V11.00 of UE and it's multiline string highlighting capability.
          occultus wrote:Ada isn't case sensitive afaik (at least the version I use isn't). What would be the correct definition then?
          Write Nocase instead of NoCASE in the language definition line.
          Best regards from an UC/UE/UES for Windows user from Austria