Recent

Author Topic: TSynAnySyn Highlighting  (Read 1202 times)

Baltazar

  • New Member
  • *
  • Posts: 12
TSynAnySyn Highlighting
« on: April 24, 2019, 11:35:06 pm »
Hi Everyone,
I am designing a custom IDE for BASIC language. Instead of using the standard TSynVBSyn, I instead used TSynAnySyn highlighter as my keywords are from the old set of ANSI BASIC (subset  of VB) . Here's what happened (pls see attachment):
1. I turned ON csVBStyle commenting but it doesn't recognize the REM comment marker, only the apostrophe. Turning ON csBasStyle also didn't help.
2. The # character is also getting highlighted as a string.
I don't get these issues when I use a TSynVBSyn highlighter, the problem is those unnecessary keywords in my target flavor of BASIC are also getting highlighted.
FPC version: 3.0.4
Lazarus V 2.0.0
« Last Edit: April 24, 2019, 11:42:45 pm by Baltazar »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5523
    • wiki
Re: TSynAnySyn Highlighting
« Reply #1 on: April 24, 2019, 11:53:48 pm »
SynAnySyn is very simple. It almost has no support for any build in stuff.

You can create your own copy, and modify it.
Or you can modify the basic hl, do remove the parts you do not need.

Or create your own.
http://wiki.lazarus.freepascal.org/SynEdit_Highlighter

There is currently no good freely configurable HL. (I hear ATSynEdit has, but I don't know anything about it)

Edson

  • Hero Member
  • *****
  • Posts: 1029
Re: TSynAnySyn Highlighting
« Reply #2 on: April 25, 2019, 12:37:15 am »
Don't use SynAnySyn. Is slow and limited. Use SynFacilSyn, is fast, flexible, and well documented.

For Basic comments, you can use some XML syntax like this:

Code: XML  [Select]
  1. <?xml version="1.0"?>
  2. <Language>
  3.   <Comment Start="REM"></Comment>
  4.   <Comment Start="&apos;" ></Comment>
  5. </Language>
  6.  
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

lucamar

  • Hero Member
  • *****
  • Posts: 1959
Re: TSynAnySyn Highlighting
« Reply #3 on: April 25, 2019, 12:54:29 am »
Perhaps a link to Edson's SynFacilSyn page on GitHub won't be amiss, will it?  8-)

It's in fact the closer to a "good freely configurable HL" there is, AFAICT.
« Last Edit: April 25, 2019, 12:58:57 am by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

Edson

  • Hero Member
  • *****
  • Posts: 1029
Re: TSynAnySyn Highlighting
« Reply #4 on: April 25, 2019, 01:18:54 am »
Perhaps a link to Edson's SynFacilSyn page on GitHub won't be amiss, will it?  8-)

It's in fact the closer to a "good freely configurable HL" there is, AFAICT.

Thanks for the link.

I think Martin should include SynFacilSyn (no need to be the last version) in Lazarus, and remove the old SynAnySyn. Many of the current Hardcoded SynEdit highlighters can be replaced and improved with SynFacilSyn.
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5523
    • wiki
Re: TSynAnySyn Highlighting
« Reply #5 on: April 25, 2019, 02:02:45 pm »
I must admitted that I always thought SynFacilSyn was for AtSynEdit. Now I am impressed.

Yes this is certainly important for SynEdit.

I wonder if it would be possible/better to get it to the OPM (it seems not there yet). IMHO it should have its own entry there (not mixed with the extra syn hl package).

* Pro OPM
- Easier maintenance. No need to continually integrate updates.
* Con OPM
- Still less visible.

IMHO the latter is a general issue. It would be a nice feature if the OPM could display dummy entries in the component palette.

Thausand

  • Full Member
  • ***
  • Posts: 227
Re: TSynAnySyn Highlighting
« Reply #6 on: April 25, 2019, 02:24:08 pm »
Now I am impressed.
SynFacilSyn is very good and work many thing anysyn no work. Then i write +1  :)

Baltazar

  • New Member
  • *
  • Posts: 12
Re: TSynAnySyn Highlighting
« Reply #7 on: May 03, 2019, 10:34:22 pm »
Thank you  ;D all for the replies/dicussions.  ;)

Edson

  • Hero Member
  • *****
  • Posts: 1029
Re: TSynAnySyn Highlighting
« Reply #8 on: May 04, 2019, 02:45:12 am »
I must admitted that I always thought SynFacilSyn was for AtSynEdit. Now I am impressed.

Strange  %). I ask you several times about Synedit where developing SynFacilSyn.

Recently SynFacilSyn included too, an adapter for using with ATSynEdit  :), but only implements uni-line tokens and no support for blocks.

I wonder if it would be possible/better to get it to the OPM (it seems not there yet). IMHO it should have its own entry there (not mixed with the extra syn hl package).

* Pro OPM
- Easier maintenance. No need to continually integrate updates.
* Con OPM
- Still less visible.

SynFacilSyn hasn't been changing too recently. I think it would be useful even if Lazarus includes and old version.

I haven't used OPM, but I can include SynFacilSyn if someone tell me how.
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

wp

  • Hero Member
  • *****
  • Posts: 6010
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

Edson

  • Hero Member
  • *****
  • Posts: 1029
Re: TSynAnySyn Highlighting
« Reply #10 on: May 04, 2019, 05:47:13 pm »
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

wp

  • Hero Member
  • *****
  • Posts: 6010
Re: TSynAnySyn Highlighting
« Reply #11 on: May 04, 2019, 06:02:11 pm »
You must activate the "Package maintainer" profile: Select "Options" > "Profiles" > "Select profile".
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

Edson

  • Hero Member
  • *****
  • Posts: 1029
Re: TSynAnySyn Highlighting
« Reply #12 on: May 05, 2019, 06:37:41 am »
OK. I've sent the SynFacilSyn. I don't know if it is OK  :-\. SynFacilSyn is just a pair of units. No component, no package.
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

wp

  • Hero Member
  • *****
  • Posts: 6010
Re: TSynAnySyn Highlighting
« Reply #13 on: May 05, 2019, 11:26:25 am »
I think you need a package, a run-time package should be enough. But I notified the maintainer of OPM (https://forum.lazarus.freepascal.org/index.php/topic,34297.1600.html).
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

GetMem

  • Hero Member
  • *****
  • Posts: 3478
Re: TSynAnySyn Highlighting
« Reply #14 on: May 05, 2019, 01:45:55 pm »
Hi all,

I got the package, but I cannot compile it. This is the error message:"SynEditHighlighter was not found." If I add synedit to the "Required packages", everything works fine except for a missing license file(see attached image 1). Can I remove it from the Files entry? Can you please provide a Description, Author, License and version(see attached image 2)?