UDL Parsing sequence - should honor comments first



  • I created a new UDL and encountered a problem caused, apparently, by the UDL parsing sequence. My UDL has comments defined with a specific character sequence that must occur at the start of the line. That generally works, but lines that should be treated as comments but which happen to contain words defined as keywords or characters defined as delimiters or operators give erroneous results. The keywords or delimiters/operators are recognized and highlighted according to the defined styles, but those lines are not treated as comments. This causes numerous bad results. For example, this UDL uses the apostrophe character as a string delimiter, with a leading and a trailing apostrophe. But if there happens to be an apostrophe in a comment line (“yesterday’s file” or some such thing) it is being treated as the start of a delimited string (and highlighted according to the defined style for the delimited strings). The same thing happens if the comment line happens to contain a keyword. The keyword is highlighted according to the style for that keyword type, but the line is not treated as a comment.

    I think that is exactly backwards. When the comment indicator is defined as having to be at the start of the line, then if that comment indicator does occur at the start of a line, no other parsing should occur for that line. It should be highlighted in the “comment” style, but nothing in that comment line should be further scanned for keywords, delimiters, operators, or whatever. If it is a comment, treat it as such.

    Agree? Disagree? Will the UDL developers see this, or is there a better way to pass this suggestion on to them?

    Thanks!



  • @Gerry-Palmer

    actually I think this is the case, maybe I misunderstood your concerns.

    Cheers
    Claudia


Log in to reply