Author Topic: C code NOT inactivated if compiler switches on multiple lines  (Read 805 times)

at5dapa1

  • Senior Community Member
  • Posts: 282
  • Hero Points: 24
C code NOT inactivated if compiler switches on multiple lines
« on: December 01, 2022, 06:00:51 AM »
This modified code works:
Code: [Select]
#if defined(_SILICON_LABS_32B_SERIES_1) && defined(_EFR_DEVICE) && (_SILICON_LABS_GECKO_INTERNAL_SDID >= 84)
  MSC->CTRL |= 0x1UL << 8;  // displayed as inactive code
#endif

This original code, doesn't:
Code: [Select]
#if defined(_SILICON_LABS_32B_SERIES_1) \
  && defined(_EFR_DEVICE) && (_SILICON_LABS_GECKO_INTERNAL_SDID >= 84)
  MSC->CTRL |= 0x1UL << 8;  // NOT displayed as inactive code
#endif

The defines are defined project_cpp.h:
Code: [Select]
#define _SILICON_LABS_32B_SERIES_1
#define _SILICON_LABS_GECKO_INTERNAL_SDID 106
#undef _EFR_DEVICE



Quote
SlickEdit Pro 2022 (v27.0.0.6 64-bit Qt5)

Serial number: WB951378
Licensed number of users: Single user
License file: C:\ProgramData\slickedit\27\slickedit.lic

Build Date: October 18, 2022
Emulation: CUA

OS: Windows 10 x64
OS Version: 10.00.0 
Memory: 19% Load, 6359MB/32464MB Physical, 8620MB/32464MB Page File, 5289MB/134217727MB Virtual
Shell Information: C:\Windows\system32\cmd.exe /q
Screen Size: 1920 x 1200 (0 0 1920 1200), 1920 x 1200 (-1920 0 1920 1200)

Project Type: Cpp
Language: .h (C/C++)
Encoding: ACP (1252)

Installation Directory: D:\tools\totalcmd\Tools\dev\SlickEdit\core\27.0.0\ (non-removable drive,NTFS,264324MB free)
Configuration Directory: D:\tools\totalcmd\Tools\dev\SlickEdit\config\27.0.0\ (non-removable drive,NTFS,264324MB free)
Spill File: C:\Users\work\AppData\Local\Temp\$slk.8228 (non-removable drive,NTFS,375090MB free)

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: C code NOT inactivated if compiler switches on multiple lines
« Reply #1 on: December 02, 2022, 02:51:56 PM »
Reproduced, we'll take a look at it.  Thanks for the report.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6826
  • Hero Points: 526
Re: C code NOT inactivated if compiler switches on multiple lines
« Reply #2 on: December 02, 2022, 06:48:36 PM »
This is a limitation that is not easy to work around. Has to do with the color coding engine processing a line at a time and not having a way to look ahead and fetch subsequent lines. This same limitation is the reason that using a regular expression in the color coding engine can't match data on two separate lines. Definitely can't fix this in a point release. Might be possible to hack in some sort of line look ahead. Wouldn't fix the multi-line regex limitation.