Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-06

SynEdit Syntax implementation help

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ik

Hello List,

Following old emails of mine, I've started first doing some very simple syntax, and decided to create a BasicConfig syntax highlight<http://github.com/ik5/SynEdit-syntaxes/blob/master/synhighlighterbasicconfig.pas>(the link is to my code).
I implemented everything I'm thinking that I understand in implementing the highlight (it will be good to know that it's not the case). So now I need to understand better what to do next, and what does it mean each of the method that required to be implemented ?

Thanks,

Ido
http://ik.homelinux.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100611/46876b74/attachment.html>

Reply by email

Mattias Gaertner
to ik
Show quoted text 10 lines
Hello List, Following old emails of mine, I've started first doing some very simple syntax, and decided to create a BasicConfig syntax highlight<http://github.com/ik5/SynEdit-syntaxes/blob/master/synhighlighterbasicconfig.pas>(the link is to my code). I implemented everything I'm thinking that I understand in implementing the highlight (it will be good to know that it's not the case). So now I need to understand better what to do next, and what does it mean each of the method that required to be implemented ?

You can use the refactoring tool "Show abstract methods" to add the missing methods.

Mattias

Reply by email

ik
to Mattias Gaertner
Mattias Gaertner wrote 20 lines
On Fri, 11 Jun 2010 22:28:17 +0300 ik wrote: > Hello List, > > Following old emails of mine, I've started first doing some very simple > syntax, and decided to create a BasicConfig syntax > highlight< http://github.com/ik5/SynEdit-syntaxes/blob/master/synhighlighterbasicconfig.pas >(the > link is to my code). > I implemented everything I'm thinking that I understand in implementing the > highlight (it will be good to know that it's not the case). > So now I need to understand better what to do next, and what does it mean > each of the method that required to be implemented ? You can use the refactoring tool "Show abstract methods" to add the missing methods.

That's a cool feature I have not seen before.
However I the abstract methods that are not imported to the project yet, are not there (except one apparently that I missed, and it's now implemented) because I do not understand what is their task.

I've added {%TODO: } to such methods.

Show quoted text 8 lines
Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100611/c221bbd5/attachment.html>

Reply by email

Martin
to ik: Following old emails of mine, I've started first doing some very simple syntax, and…
ik wrote 11 lines
Hello List, Following old emails of mine, I've started first doing some very simple syntax, and decided to create a BasicConfig syntax highlight <http://github.com/ik5/SynEdit-syntaxes/blob/master/synhighlighterbasicconfig.pas> (the link is to my code). I implemented everything I'm thinking that I understand in implementing the highlight (it will be good to know that it's not the case). So now I need to understand better what to do next, and what does it mean each of the method that required to be implemented ?

I am writing this while away, and without full access to my usual work, so it will not be too detailed.

There are 2 places in synedit.pp you can look at to see, what is called.

TSynEdit.ScanRanges
TSynEdit.PaintLines (may be nested procedure)

They show you all the methods that get called on the highlighter/ On top of this SynExport, or HtmlExport or similar (and some pascal stuff in the IDE SourceEditorProcs) call SetLine/SetRange directly (so for now that may need to be supported too)

in the SynEdit folder docs dir is some xml/fpdoc stuff on CurrentLines/CurrentRanges ....

---
Highlighter.ScanRanges must ensure all lines are scanned (a proper range recored is stored for each line)

In PaintLines the individual tokens are requested by SynEdit. something similar to:
- StartAtLine
- GetToken(EX)
- GetAttribute

The tokens returned per line (GetEOL) must match the length of the actual line, otherwhise it will crash

Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100611/236033df/attachment.html>

Reply by email

Zaher Dirkey
to Martin

Hi Ido, as i noticed, you implementing some of highlighters for not duplicating work, i already have

SynHighlighterSQLite.pas

http://sourceforge.net/projects/minilib/
in Lazarus\projects\miniSQLViewer\lib

And in my home, not published yet but ported from my old Delphi project http://sourceforge.net/projects/lightphpedit

SynHighlighterHTMLPHP.pas
SynHighlighterApache.pas

I will publish it as soon as possible.

Thanks

Zaher Dirkey -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100612/99a10113/attachment.html>

Reply by email

ik
to Martin: I am writing this while away, and without full access to my usual work, so it will not be…

Thanks, that helped me a lot.

Ido

2010/6/11 Martin

Show quoted text 49 lines
On 11/06/2010 21:28, ik wrote: Hello List, Following old emails of mine, I've started first doing some very simple syntax, and decided to create a BasicConfig syntax highlight<http://github.com/ik5/SynEdit-syntaxes/blob/master/synhighlighterbasicconfig.pas>(the link is to my code). I implemented everything I'm thinking that I understand in implementing the highlight (it will be good to know that it's not the case). So now I need to understand better what to do next, and what does it mean each of the method that required to be implemented ? I am writing this while away, and without full access to my usual work, so it will not be too detailed. There are 2 places in synedit.pp you can look at to see, what is called. TSynEdit.ScanRanges TSynEdit.PaintLines (may be nested procedure) They show you all the methods that get called on the highlighter/ On top of this SynExport, or HtmlExport or similar (and some pascal stuff in the IDE SourceEditorProcs) call SetLine/SetRange directly (so for now that may need to be supported too) in the SynEdit folder docs dir is some xml/fpdoc stuff on CurrentLines/CurrentRanges .... --- Highlighter.ScanRanges must ensure all lines are scanned (a proper range recored is stored for each line) In PaintLines the individual tokens are requested by SynEdit. something similar to: - StartAtLine - GetToken(EX) - GetAttribute The tokens returned per line (GetEOL) must match the length of the actual line, otherwhise it will crash Martin -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100612/c0fcda20/attachment-0001.html>

Reply by email

ik
to Zaher Dirkey: Hi Ido, as i noticed, you implementing some of highlighters for not duplicating work, i…

Hi Zaher,

2010/6/12 Zaher Dirkey

Show quoted text 5 lines
Hi Ido, as i noticed, you implementing some of highlighters for not duplicating work, i already have SynHighlighterSQLite.pas

I'm not sure that I understand what you mean.

I'm working on two syntax highlight at the moment:

1. Ruby
2. Basic configuration file (just to understand how to create syntax highlighter)

I do not understand how are they duplicates of what you have done so far ?

Show quoted text 12 lines
http://sourceforge.net/projects/minilib/ in Lazarus\projects\miniSQLViewer\lib And in my home, not published yet but ported from my old Delphi project http://sourceforge.net/projects/lightphpedit SynHighlighterHTMLPHP.pas SynHighlighterApache.pas I will publish it as soon as possible.

Looks like cool tools what you have made, and I'm waiting for the highlighters you've made :)

Show quoted text 13 lines
Thanks -- Zaher Dirkey -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100612/d2eb386d/attachment.html>

Reply by email