Posted 20 years ago
by tobias weltner

After searching for hours trying to track down some strange parsing behavior, I discovered a problem in the underlying sample language definitions (I testet both VB.NET and VBScript):
Use this as a document:
"test"
Make sure to add two blank lines after the string.
Then, when you enumerate all tokens, you'll find that the string scope is never exited and that the trailing two line breaks are misinterpreted as StringDefaultToken and StringEndToken while the real string end token turned to be a StringDefaultToken, too.
Now, whenever you put anything after the string (whitespace, comma, etc.), it works as expected.
Looking at the language defintion, string end is defined like this:
<RegexPatternGroup Type="EndScope" TokenKey="StringEndToken" Style="StringDelimiterStyle" PatternValue="[\"\n]" LookAhead="[^\"\n]" />
I must admit I don't know why this is working at all. You are looking for a pattern of quote and new line. This however seems to be the only condition in which it DOES NOT work. Maybe I programmed too much today, I just can't figure this out. Can you?
Use this as a document:
"test"
Make sure to add two blank lines after the string.
Then, when you enumerate all tokens, you'll find that the string scope is never exited and that the trailing two line breaks are misinterpreted as StringDefaultToken and StringEndToken while the real string end token turned to be a StringDefaultToken, too.
Now, whenever you put anything after the string (whitespace, comma, etc.), it works as expected.
Looking at the language defintion, string end is defined like this:
<RegexPatternGroup Type="EndScope" TokenKey="StringEndToken" Style="StringDelimiterStyle" PatternValue="[\"\n]" LookAhead="[^\"\n]" />
I must admit I don't know why this is working at all. You are looking for a pattern of quote and new line. This however seems to be the only condition in which it DOES NOT work. Maybe I programmed too much today, I just can't figure this out. Can you?