XIDE: Unexpected behavior in the editor

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
Irwin
Posts: 255
Joined: Wed Mar 23, 2022 10:24 am
Location: Spain

XIDE: Unexpected behavior in the editor

Post by Irwin »

Hi Chris,

Look at this picture Image

I suspect the editor believes I'm performing a TEXT / END TEXT (because of the variable name) operation because is highlighting everything as a string but that's not true. When I delete or comment this line text := row["text"]:ToString():Trim() then the editor highlights everything without any problem.

This isn't harmful (I can solve the problem by renaming my "text" variable), but it is a small issue that needs to be fixed at some point in the future ;)
XSharp Development Team (VFP)
Spain | irwin@xsharp.eu
User avatar
Chris
Posts: 5679
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: XIDE: Unexpected behavior in the editor

Post by Chris »

Hi Irwin

You discovered my dirty way of highlighting TEXT TO strings :)

Not sure what's the correct way to do it, so that it always works correctly, is it enough to decide that a command is a TEXT command when it starts with "TEXT TO" or "TEXT INTO"?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
robert
Posts: 5084
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: XIDE: Unexpected behavior in the editor

Post by robert »

Chris,
The compiler uses a UDC to convert the various TEXT commands into a #text preprocessor command.
Basically it matches:

TEXT
TEXT TO <something>
TEXT INTO <something>

The #text preprocessor command is quite complicated. I'll explain some other time.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply