Recent

Author Topic: New Syn(whatever)Syn Highlighter for SynEdit  (Read 10004 times)

Edson

  • Hero Member
  • *****
  • Posts: 1301
New Syn(whatever)Syn Highlighter for SynEdit
« on: September 25, 2013, 02:34:03 am »
Like someone of you must know, I been working these days on develop a fast and flexible highlighter for SynEdit. This is the result:

blog.pucp.edu.pe/media/4946/20130924-tsyngensyn.rar

It could be configured using an external syntax file, with something like this:

<Language name="php">
  <String Start="'" End="'"></String>
  <String Start="&quot;" End="&quot;" ></String>
  <Comment Start="//" ></Comment>
  <Comment Start="/*" End="*/" ></Comment>
  <Keywords>  fool bar other_fool other_bar
   </Keywords>
</Language>


It's still on development, but I think it could be useful.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: New Syn(whatever)Syn Highlighter for SynEdit
« Reply #1 on: October 26, 2013, 07:58:37 pm »
Can a scriptable highlighter be faster than a hardcoded?
Of course, it depends on algorithm/implementation/source text.

After some depuration, here is this "scriptable-external-file-sintax-highlighter".
I have included a simple test of speed for a PHP syntax and the comparison with the native PHP lazarus highlighter.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Morton

  • Full Member
  • ***
  • Posts: 111
Re: New Syn(whatever)Syn Highlighter for SynEdit
« Reply #2 on: October 26, 2013, 11:10:41 pm »
Of course, it depends on algorithm/implementation/source text.

Algorithms and knowing how to implement are the most important prerequisites, aside of a good brain.
I never understood why most developers do not care.

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: New Syn(whatever)Syn Highlighter for SynEdit
« Reply #3 on: October 27, 2013, 04:53:25 pm »
Quote
I never understood why most developers do not care.

Calm down. If everybody was a good programmer, Programming wouldn't be a skill, it would be a human feature. So it would be boring.

Talking of highlighters, I want to clarify that I haven't defined identifiers and numbers in the syntax, because the default is:

<Identifiers
Start = “ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz$_”
Content = “ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_”>
</Identifiers>

<Number Start=”0123456789.” > </Number>
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Morton

  • Full Member
  • ***
  • Posts: 111
Re: New Syn(whatever)Syn Highlighter for SynEdit
« Reply #4 on: October 27, 2013, 05:11:04 pm »
Calm down. If everybody was a good programmer, Programming wouldn't be a skill, it would be a human feature. So it would be boring.

Not everybody got the same gifts.
Regardles of the gifts one could do better with tools as good as one can handle.

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: New Syn(whatever)Syn Highlighter for SynEdit
« Reply #5 on: November 05, 2013, 05:10:50 am »
Improving my scriptable-fast-highlighter, now it can accept a simple syntax of Pascal (and of many other languages).

I have made a speed comparison with the Lazarus highlighter, and it's clearly faster.

EDIT: Link removed. See the later posts.
« Last Edit: January 18, 2014, 07:07:52 pm by Edson »
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: New Syn(whatever)Syn Highlighter for SynEdit
« Reply #6 on: January 08, 2014, 04:59:47 am »
Here, the new version of the Highlighter.

http://blog.pucp.edu.pe/action.php?action=plugin&name=LinkCounter&type=c&k=20140107-synfilesyn08_public.rar

It support now the "CaseSensitive" property, the ability for defining tokens like subsets of Symbols, and some improves on defining the language using file or instructions.

The more difficult part of the work was the documentation. :o

It includes a test program for compare the speed, using a Pascal syntax.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: New Syn(whatever)Syn Highlighter for SynEdit
« Reply #7 on: January 18, 2014, 07:19:17 pm »
This is the last version of the Fast Scriptable Highlighter: TSynFileSyn. It is smaller, more configurable and the same fast.

Some improves have been made for the definiton of symbols and delimited tokens. Some bugs corrected. Moreover, now it supports simple folding for multilines tokens.

As usually, it includes a comparison with the Pascal HL.

http://blog.pucp.edu.pe/media/4946/20140118-synfilesyn12_public.rar
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

 

TinyPortal © 2005-2018