PDA

View Full Version : Problem with string literals in rules


Aizar
12-Jan-2004, 12:28 PM
Hi,

I seem to have trouble with defining a string literal to be included into comparison:

What I want to do is simple: ignore text between { and } but compare text from {$ to }.

Example:
ignore this > {This is a Delphi comment}
compare this> {$DEFINE DELPHI_COMPILER_DIRECTIVE}

I have "Text from { to }" set as Unimportant Text and "Text from {$ to }" as a string Literal but both lines are ignored in this case.

Any help appreciated :)

Craig
12-Jan-2004, 01:29 PM
Unimportant text is always checked before string literals, so it's not possible to do this using the standard "delimiter" type. Regular expressions are applied after delimiters though, so you can use that to override the unimportant text classification.

Change the string literal's "Category" from "Delimited" to "Regular Expression", and use this expression:
\{\$.*\}

Aizar
13-Jan-2004, 06:12 AM
Thanks, works perfectly ;)