No announcement yet.

Calrification as to grammer matching rules?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Calrification as to grammer matching rules?

    I keep running into weird problems with grammer rules only matching sometimes and the diff not ignoring grammer elements in some contexts.


    2 grammer rules

    STRING= from " to "
    SVN_KEYWORD = from $URL to $

    set to ignore SVN_KEYWORD but not STRING.

    "$URL: jkjjjjjj $"

    won't be ignored.

    also there seems to be something weird with regex lists
    I've noticed that when I have 2 entries neither seems to match but if i enter the same regex expression as 2 basic grammer elements it will work.

    I hoping you can shine some light on what is actually going on here.


  • #2

    For the first case, the " is leftmost of this section of text. This means it is likely to match as the beginning of a string, which will swallow the other definitions inside, and terminate at the trailing " as a String grammar type. Since String is important than it is not ignored. You can always click into any text (blinking cursor) and look at the bottom status bar of each pane to see the currently detected grammar type the cursor is within.

    For the later case, I would need an example. The List and Basic grammars should function similarly. The list of grammar elements is ordered, so if it is a tie for position, the topmost grammar will be detected before a lower one. If your List grammar was lower, but Basic grammars higher, this could explain the behavior you were seeing. The ordering of grammar elements is not an absolute priority list however, as seen in the previous example: even if SVN_KEYWORD were higher in the list, String would be found and matched first.
    Aaron P Scooter Software


    • #3
      Oh ok that makes sense and helps. I had line based pattern matching in mind.

      I can probably avoid my problem by using replacements and resetting the keywords to default strings.

      if I do something effectively like
      for right and left I should be able to work around my issue.

      But this brings me to another point is there some kind of debug mode where I can easily see what grammer rule is matching what? I find myself basically guessing, or figuring it out by trial and error. I mean you can see comments because they are syntax highlighted which is great.

      a debug mode with each grammer type assigned a unique color and a displayed color map would be great or is something like this already possible?



      • #4
        There is not a debug mode, though you can use the Tools menu -> Options dialog, File Views, Display section to assign a custom color to any grammar. We also show the current grammar the cursor resides in, in the bottom status bar. If you click into a word or text section, you can then look at the bottom status bar of each pane to see the current grammar name.
        Aaron P Scooter Software


        • #5
          How have I not noticed that, ok thanks that works just as well.