Posted 19 years ago by tobias weltner
Avatar
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="[\&quot;\n]" LookAhead="[^\&quot;\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?

Comments (3)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Take out this part in the scope:
LookAhead="[^\&quot;\n]"
That should not have been in there.


Actipro Software Support

Posted 19 years ago by tobias weltner
Avatar
This did it, thanks!
What about the definition for comments? I noticed that it "consumes" the Line Terminator tokens.
So if you write a couple of comment lines, there is a line terminator token missing after each one. Is this by design?
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes the CommentEndToken is itself a line-terminator.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.