9222 Importance "Grammar elements" not refreshed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chrisjj
    Carpal Tunnel
    • Apr 2008
    • 2537

    9222 Importance "Grammar elements" not refreshed

    Changes under Importance "Edit Grammar..." to the order of elements is not reflected upon OK in the order of those same elements already present under Importance "Grammar elements".
  • Michael Bulgrien
    Carpal Tunnel
    • Oct 2007
    • 1772

    #2
    I noticed this as well. Even if you close the Session Settings then reopen it, the order of the grammar elements on the Importance tab do not change. Perhaps they were never intended to be reordered???
    BC v4.0.7 build 19761
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

    Comment

    • chrisjj
      Carpal Tunnel
      • Apr 2008
      • 2537

      #3
      > Even if you close the Session Settings then reopen it ...

      And even if you duplicate the grammar under another name!

      > Perhaps they were never intended to be reordered???

      How so??? It results in failure of the comparison to accurately express a grammar the elements of which have been reordered on the Grammar tab.

      Comment

      • Michael Bulgrien
        Carpal Tunnel
        • Oct 2007
        • 1772

        #4
        I wasn't saying that it shouldn't be reordered. I was just suggesting that perhaps it wasn't thought of by the programmers. I agree that it would be nice to see the grammar elements ordered the same way in both places.
        BC v4.0.7 build 19761
        ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

        Comment

        • Erik
          Team Scooter
          • Oct 2007
          • 437

          #5
          Sorry guys, the order in the importance list can't practically be changed to match the order in the grammar list. The major reason is that you can have multiple grammar items that use the same element name and thus only show as one entry in the importance list. Another reason is that the importance list includes elements used by either side which could have different grammars and thus be in a different order. We wouldn't want separate importance lists for each side because that would be awkward and confusing (Comment on left is important but Comment on right is unimportant just doesn't make sense).
          Erik Scooter Software

          Comment

          • chrisjj
            Carpal Tunnel
            • Apr 2008
            • 2537

            #6
            OK... but when I have a grammar in which multiple items do /not/ have the same element name, and are such that ordering is significant, by concealing the true order, the Importance tab leaves me with insufficient info to choose the important/un checkbox states. (Not to mention: misleads).

            Or am I supposed to click Edit Grammar to peek the true order?

            Comment

            • Erik
              Team Scooter
              • Oct 2007
              • 437

              #7
              The order in the grammar list only matters if 2 grammar items match the same text. For this reason, "Keywords" need to be defined before "Identifiers". Are you suggesting that an element's importance is somehow related to its position in the grammar list? If so, please describe your situation better because it doesn't make any sense to me.
              Erik Scooter Software

              Comment

              • chrisjj
                Carpal Tunnel
                • Apr 2008
                • 2537

                #8
                > Are you suggesting that an element's importance is
                > somehow related to its position in the grammar list?

                Yes.

                > If so, please describe your situation better

                Code:
                Grammar elements
                [ ] New Element (3)=Text matching myvariable = .*
                [X] New Element (4)=Text matching myvariable = 1
                with order according with the (UI-unnamed) Grammar list.

                PS I wonder why this forum software inserted a blank line before and after the end of /CODE.

                Comment

                • Chris
                  Team Scooter
                  • Oct 2007
                  • 5538

                  #9
                  Chris,

                  If you aren't naming the grammar elements, it might help to give them a specific name instead of letting them be auto named. Instead of the auto name "New Element (3)", use something descriptive like "comment", "date", etc.
                  Chris K Scooter Software

                  Comment

                  • chrisjj
                    Carpal Tunnel
                    • Apr 2008
                    • 2537

                    #10
                    It might help me? Actually not - I'd prefer no name at all.

                    Or it might help BC's ordering issue? How so?

                    Comment

                    • Chris
                      Team Scooter
                      • Oct 2007
                      • 5538

                      #11
                      Chris,

                      A descriptive name will make it clearer which expression is which when checking or unchecking them in the Importance tab of session settings.

                      As an example, if you enter a grammar item that matches // to end of line for comments, it makes sense to name it "Comment" rather than the auto name "New Element (3)".

                      Once you've defined the grammar, it is clearer to say "Comments" are important or unimportant in the session settings rather than saying "New Element (3)s" are important or unimportant.

                      If you don't want to use a descriptive name, you can also copy the expression from the grammar as the grammar name to make it clearer in session settings.
                      Last edited by Chris; 24-Oct-2008, 09:55 AM.
                      Chris K Scooter Software

                      Comment

                      • chrisjj
                        Carpal Tunnel
                        • Apr 2008
                        • 2537

                        #12
                        > A descriptive name will make it clearer which expression is which when
                        > checking or unchecking them in the Importance tab of session settings.

                        Thanks, but that is already sufficiently clear.

                        I might though add line numbers (!) to reveal the hidden order.

                        > As an example, if you enter a grammar item that matches // to
                        > end of line for comments, it makes sense to name it "Comment"

                        Agreed, but ISTM this multi-match issue is confined to ad-hoc elements such as my example rather than planned grammars.

                        Comment

                        Working...