Recent

Author Topic: SynFacilSyn --- help  (Read 2707 times)

Saylo_49

  • New Member
  • *
  • Posts: 43
SynFacilSyn --- help
« on: April 06, 2019, 08:18:40 pm »
Hello everyone
I have questions about SynFacil
1- how to create multicolor syntax highlighting using XML
exemple :
use style 1 for some keywords and style 2 for other keywords
(style : color , background ...)

2- how to define the code folding settings in XML

p.s. The docs available in github repo were only in spanish and I don t understand spanish
Lazarus 2.0.2 - FPC 3.0.4 - Win32

Edson

  • Hero Member
  • *****
  • Posts: 1302
Re: SynFacilSyn --- help
« Reply #1 on: April 08, 2019, 01:02:28 am »
Hi.

1- how to create multicolor syntax highlighting using XML
exemple :
use style 1 for some keywords and style 2 for other keywords
(style : color , background ...)

You can define any number of new attributes:

Code: XML  [Select][+][-]
  1.  
  2.   <Attribute Name="Keyword1"   ForeCol="#00A4F2" Bold="false"  Italic="False" Underline="False"/>
  3.   <Attribute Name="Keyword2"   ForeCol="Purple" Bold="false"  Italic="False" Underline="False"/>
  4.  


Then you can define words for them:

Code: XML  [Select][+][-]
  1.  
  2. <Keyword1>EDIT STORE RECALL TRON TROFF PLOT LORES DOKE
  3.         LLIST LPRINT DATA DEEK LOG LEN STR$ VAL ASC CHR$ PI
  4.         TRUE FALSE KEY$ SCRN POINT LEFT$ RIGHT$ MID$
  5.   </Keyword1>
  6.   <Keyword2> END POP PULL
  7.         ON TO IF ELSE THEN STEP STOP
  8.   </Keyword2>
  9.  

2- how to define the code folding settings in XML

Folding are implemented using blocks. Blocks are defined with delimiters:

Code: XML  [Select][+][-]
  1.   <Block Start="Begin" End="End" Folding="True">
  2.   </Block>
  3.  

p.s. The docs available in github repo were only in spanish and I don t understand spanish

There is an english translation of de Technical documentation in the GitHub repo. Probably no the best translation but it's a translation.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Saylo_49

  • New Member
  • *
  • Posts: 43
Re: SynFacilSyn --- help
« Reply #2 on: April 09, 2019, 12:05:33 am »
thnx Edson
I have another questions if you dont mind
1- does synfacil highlight brace and parenthesis and symbols like dollar and others (if they are included in the keyword like in PHP or in Javascript)
2- does it support hyphened and diaphracted words (like é è ñ ...)

3- why there is two units (synfacil    and synbasic) instead of one unit
Lazarus 2.0.2 - FPC 3.0.4 - Win32

Edson

  • Hero Member
  • *****
  • Posts: 1302
Re: SynFacilSyn --- help
« Reply #3 on: April 09, 2019, 12:53:27 am »
1- does synfacil highlight brace and parenthesis and symbols like dollar and others (if they are included in the keyword like in PHP or in Javascript)
I'm not sure I understand the question. 
Only "Spaces" and "Line endings" are fixed (relativity) in SynFacilSyn. All other kinds of tokens can be set to any attribute. You can define "$" as keyword, or "(" as a number or whatever.

thnx Edson
2- does it support hyphened and diaphracted words (like é è ñ ...)
The UTF-8 codepage C3, that contains á, é, í, ó, ú, ñ, Ñ, ...  can be included (moreless accurate) in the identifiers definition. Check the section 4.5.1 of the documentation.

3- why there is two units (synfacil    and synbasic) instead of one unit
By modularity.
The old versions included just one unit.
« Last Edit: April 09, 2019, 01:01:56 am by Edson »
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

 

TinyPortal © 2005-2018