Recent

Author Topic: New Scriptable Highlighter for SynEdit  (Read 32168 times)

Edson

  • Hero Member
  • *****
  • Posts: 1124
Re: New Scriptable Highlighter for SynEdit
« Reply #30 on: June 07, 2014, 07:31:29 pm »
Unfortunately, this highlighter is focused on speed and easily for configuration. That's why, it doesn't support RegExp.

Using RegExp, could make it slower. Probably It would be other different project.
Lazarus 2.0.10 - FPC 3.2.0 - x86_64-win64 on Windows 8

Alextp

  • Hero Member
  • *****
  • Posts: 1167
    • UVviewsoft
Re: New Scriptable Highlighter for SynEdit
« Reply #31 on: June 07, 2014, 08:08:51 pm »
Of course, another proj needed. With another XML format

Edson

  • Hero Member
  • *****
  • Posts: 1124
Re: New Scriptable Highlighter for SynEdit
« Reply #32 on: August 07, 2014, 07:08:16 pm »
New release (0.8.3) is avaliable of this hihglighter:

https://github.com/t-edson/SynFacilSyn

Changes, basically about the back color of blocks and routines for completion.

Lazarus 2.0.10 - FPC 3.2.0 - x86_64-win64 on Windows 8

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: New Scriptable Highlighter for SynEdit
« Reply #33 on: August 07, 2014, 08:10:05 pm »
It's a pity that your highlighter does not accept UTF-8 chars in keywords for an algorithm editor.
« Last Edit: August 07, 2014, 08:19:45 pm by typo »

Edson

  • Hero Member
  • *****
  • Posts: 1124
Re: New Scriptable Highlighter for SynEdit
« Reply #34 on: August 07, 2014, 08:31:51 pm »
I've checked that issue, but by the moment no support. This is a character lexer, like most of lexers.

I'm too interested on support the UTF page 195 for the latin characters, because of my native language.

I will probably let to define kewords using all the page 195 (but no filtering some). It's in my Todo list, but by the moment I'm working on implement the autocompletion feature.
Lazarus 2.0.10 - FPC 3.2.0 - x86_64-win64 on Windows 8

Edson

  • Hero Member
  • *****
  • Posts: 1124
Re: New Scriptable Highlighter for SynEdit
« Reply #35 on: August 11, 2014, 09:49:10 pm »
Release 0.9 is available: https://github.com/t-edson/SynFacilSyn

News:

* The load of several syntaxes is improved.
* Some additional protections.
* Basic support for UTF-8.

Now it's possible to define identifiers and keywords, using UTF-8 chars of two bytes, with the byte $C3 at the beginning. This cover characters of latin languages.

Case insensitivity not implemented yet for UTF-8.
« Last Edit: August 11, 2014, 09:51:26 pm by Edson »
Lazarus 2.0.10 - FPC 3.2.0 - x86_64-win64 on Windows 8

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: New Scriptable Highlighter for SynEdit
« Reply #36 on: August 11, 2014, 10:25:26 pm »
Setting a keyword with letter ã ( a + tilde) gives me an Invalid Character on Input Stream error.

howardpc

  • Hero Member
  • *****
  • Posts: 3608
Re: New Scriptable Highlighter for SynEdit
« Reply #37 on: August 11, 2014, 10:54:06 pm »
Now it's possible to define identifiers and keywords, using UTF-8 chars of two bytes, with the byte $C3 at the beginning. This cover characters of latin languages.

The purpose of this eludes me. Niklaus Wirth defined the original Pascal keywords using a subset of ASCII. Borland and other compiler-writers who extended Wirth's work as Object Pascal defined a handful of further keywords (class, try, initialization etc., all using ASCII characters). Keywords are not user-defined items, and even if they were, FPC would rightly choke on any non-ASCII word that it considered illegal. Are FPC developers considering allowing accented characters and other non-ASCII tokens in Pascal language keywords?

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: New Scriptable Highlighter for SynEdit
« Reply #38 on: August 11, 2014, 10:59:41 pm »
See my previous post, it is for an algorithm editor.

Edson

  • Hero Member
  • *****
  • Posts: 1124
Re: New Scriptable Highlighter for SynEdit
« Reply #39 on: August 11, 2014, 11:16:22 pm »
@howardpc
I understand your point, but this is supposed to be an all purpose highlighter, not only for Pascal language. For Pascal we have a very good highlighter, in Lazarus.

There are languages than use more than the ASCII chars for identifiers.


@typo
For to define keywords with UTF-8, first you need to define identifiers that accepts UTF-8 chars.

In the documentation, there is an example:

Code: [Select]
  <Identifiers CharsStart= "A..Za..z_&#xC3;" Content = "A..Za..z0..9_%HIGH%">
    <keyword>
alfa
&#xC3;&#xAD;cono
    </keyword>
  </Identifiers>

Lazarus 2.0.10 - FPC 3.2.0 - x86_64-win64 on Windows 8

Edson

  • Hero Member
  • *****
  • Posts: 1124
Re: New Scriptable Highlighter for SynEdit
« Reply #40 on: August 21, 2014, 12:23:10 am »
Release 0.9.2 is available: https://github.com/t-edson/SynFacilSyn

It has been improved the syntax on XML for to configure the attributes of tokens.

And now SynFacilSyn has a brother:

https://github.com/t-edson/SynFacilCompletion

This highlighter, it's the same that SynFacilSyn, with support for completion code.
Lazarus 2.0.10 - FPC 3.2.0 - x86_64-win64 on Windows 8

Basile B.

  • Guest
Re: New Scriptable Highlighter for SynEdit
« Reply #41 on: August 21, 2014, 01:24:51 am »
Hi, I'm curious to know if a range can be defined dynamically, while typing, I particularly think to this string syntax from D2:
Quote
q" Delimiter WysiwygCharacters MatchingDelimiter "
.
Which means that Delimiter CANT be statically defined in a const or in the xml file, but is only know after the white following the delimiter. I know this is an very particular example but I try to know if SynFacilSyn has any king of limitation. Thx.

Edson

  • Hero Member
  • *****
  • Posts: 1124
Re: New Scriptable Highlighter for SynEdit
« Reply #42 on: August 21, 2014, 05:55:15 pm »
There is always limitations.

SynFacilSyn is very flexible, but has no the flexibility of a regex lexer.

It's not possible to define dynamic delimiters. But the syntax can be defined by code too. So it would be possible to modify the language definition while writing, but I suspect It would be some slow, because SynFacilSyn has been designed for to be a fast lexer, not for to be fast on re-defining the language. I haven't done such experiment.

There is some features, I have contemplated for future versions, and I have analyzed some kind of dynamic definitions, in order to deal with the HTML/XML format.
« Last Edit: August 21, 2014, 05:58:01 pm by Edson »
Lazarus 2.0.10 - FPC 3.2.0 - x86_64-win64 on Windows 8

Edson

  • Hero Member
  • *****
  • Posts: 1124
Re: New Scriptable Highlighter for SynEdit
« Reply #43 on: November 26, 2014, 07:45:57 pm »
SynFacilSyn 0.9.4 is available: https://github.com/t-edson/SynFacilSyn

It has been improved the definitions of delimited tokens and the code has been cleaned.

Some features has been added, in order to power the highlighter: SynFacilCompletion
Lazarus 2.0.10 - FPC 3.2.0 - x86_64-win64 on Windows 8

Edson

  • Hero Member
  • *****
  • Posts: 1124
Re: New Scriptable Highlighter for SynEdit
« Reply #44 on: December 11, 2014, 09:30:14 pm »
SynFacilSyn 0.9.5 is released:

https://github.com/t-edson/SynFacilSyn

It has been fixed some bugs, of the version 0.9.4 and has been improved the definition of sections.

It's expected that the next version will support some basic RegEx definitions.
Lazarus 2.0.10 - FPC 3.2.0 - x86_64-win64 on Windows 8

 

TinyPortal © 2005-2018