Author Topic: syntax highlight  (Read 2163 times)

Offline linsys

  • Single posting newcomer
  • *
  • Posts: 4
syntax highlight
« on: May 04, 2015, 03:46:29 pm »
Hello,

I've found a strange behavior in syntax highlight related to
WIN32, _WIN32, __WIN32, __WIN32__ symbols, it appear as if they
are always defined but only in syntax highlight.

I've attached a captured image to better explain

Best Regards

Offline linsys

  • Single posting newcomer
  • *
  • Posts: 4
Re: syntax highlight
« Reply #1 on: May 05, 2015, 11:40:07 pm »
well after same more testing it come out that in:

Settings->editor->C/C++ Editor settings

options:

- Collect defines from project file
- Include host platform defines

changes this behavior, but not in the expected way:

it appear as if definitions from host and project have
precedence over definitions in local file



Offline linsys

  • Single posting newcomer
  • *
  • Posts: 4
Re: syntax highlight
« Reply #2 on: May 06, 2015, 12:45:01 am »
ok got it, the collector collect
all #define but not the #undef
like in the following example

#define T1
#undef T1

#if defined T1
   #warning "defined"
   #define TEST() printf("defined")
#else
   #warning "not defined"
   #define TEST() printf("not defined")
#endif

int main()
{
   TEST();
   return 0;
}

Online oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12625
    • Travis build status
Re: syntax highlight
« Reply #3 on: May 06, 2015, 01:15:22 am »
As you've already found this is a pretty basic feature by design and also it is implemented in our editor component which is provided by the Scintilla project.
The only thing we can do is implement our own semantic highlight, but no one has done it yet, unfortunately.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline linsys

  • Single posting newcomer
  • *
  • Posts: 4
Re: syntax highlight
« Reply #4 on: May 06, 2015, 01:17:09 pm »
as you pointed also SciTE suffer of this bug, it appear that exist a two year old lexUndef.patch
I will investigate furter.
thank you