Community
    • Login

    VDHL Block comment adding incorrect delimiter

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 1.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Paul FitchP
      Paul Fitch
      last edited by

      Running version v8.1.1 64 bit of Notepad++. When I highlight a group of lines and right click and ask for a block comment the insert is a /* … */ around the block of text. This is not correct for VHDL. It should just insert “–” at the start of each line.

      Inversion 7.5.9 the proper insertion is done.

      Where can I look to find out why this function has changed and how can I correct it?

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Paul Fitch
        last edited by PeterJones

        @Paul-Fitch

        why this function has changed

        C-style comments /* ... */ have been valid in VHDL since VHDL-2008 (aka VHDL 4.0).

        Some references:

        • https://www.doxygen.nl/manual/docblocks.html#vhdlblocks
        • https://www.doulos.com/httpswwwdouloscomknowhow/vhdl/vhdl-2008-small-changes/#comment
        • https://www.doulos.com/knowhow/vhdl_designers_guide/vhdl_2008/vhdl_200x_small/#env
        • https://www.intel.com/content/www/us/en/programmable/quartushelp/13.0/mergedProjects/hdl/ahdl/ahdl_guide_comments_documentation.htm

        and, most importantly, in the IEEE Std 1076-2008 (but without IEEE Xplore, you might not be able to see it, so I will make a small quote and screenshot, hoping that such a small section is within fair use):

        • https://ieeexplore.ieee.org/document/4772740 => Section 15.9 “Comments” (emphasis added)

        A comment is either a single-line comment or a delimited comment. A single-line comment starts with two adjacent hyphens and extends up to the end of the line. A delimited comment starts with a solidus (slash) character immediately followed by an asterisk character and extends up to the first subsequent occurrence of an asterisk character immediately followed by a solidus character.

        bc04f461-95e4-478d-8982-9ef91a39a551-image.png

        – Copyright © 2009 IEEE. All rights reserved. (Quoted under fair use.)

        Regarding Notepad++ and VHDL:

        I did some bisecting of the Notepad++ versions I have. Originally, I thought it was going to be a feature of the lexer, and thus was checking the NPP versions where Scintilla was updated (v7.7, v7.8, v7.9.4)… but that didn’t turn out to be it. NPP used just -- in v7.8.6, but used /* ... */ for v7.8.7. I believe it was commit d20e11b, where langs.model.xml (and thus langs.xml) was updated for VHDL-2008 support, including adding the commentStart and commentEnd attributes to the VHDL language start tag.

        You asked:

        how can I correct it?

        If you want to “correct it” (ie, disable VHDL-2008 support) in v7.8.7 and onward, you are able to edit langs.xml (following “Editing Configuration Files” recommendations from the user manual), and remove the commentStart and commentEnd attributes to the VHDL language, so it will change from:

           <Language name="vhdl" ext="vhd vhdl" commentLine="--" commentStart="/*" commentEnd="*/">
        

        to

           <Language name="vhdl" ext="vhd vhdl" commentLine="--">
        

        If you edit the file, save the change, exit Notepad++, and come back; when I do that, the comment-block command will use multiple -- single-line comments for the block, instead of using the VHDL-2008-and-newer comment-block syntax. (My experiment with v7.8.7 showed this to be true.)

        So, if you want to only use line-style comments when using block-style comment command, just remove those two attributes from the config file.

        Good luck.

        Mike TysonM 1 Reply Last reply Reply Quote 2
        • Mike TysonM
          Mike Tyson @PeterJones
          last edited by

          @PeterJones FYI - although VHDL 2008 is indeed the latest standard, it is not the default standard for a lot of tools. In addition, it is not uncommon to lock a legacy product to an older version of a synthesis tool, for which VHDL 2008 support does not exist at all. In other words, while VHDL 2008 support can be (explicitly) enabled in contemporary versions of any simulation / synthesis tool, you may, for a variety of practical reasons, not actually want to do so.

          Notepad++ is therefore enforcing a style that is not supported by all code bases, and should, as OP is suggesting, revert to block-commenting with “–” on every line, as this is backward compatible.

          PeterJonesP 1 Reply Last reply Reply Quote 0
          • PeterJonesP
            PeterJones @Mike Tyson
            last edited by

            @Mike-Tyson said in VDHL Block comment adding incorrect delimiter:

            should, as OP is suggesting, revert to block-commenting with “–” on every line, as this is backward compatible

            I maintain that it is already configurable, and my post from a year ago already explained how to configure it. If this is not sufficient for your needs, you are free to put in a feature request (as explained in this FAQ), as we can do nothing about changing the codebase in this Community of fellow users of Notepad++

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors