On Wednesday 16 December 2015 14:15:31 Fred van Stappen wrote:
> > > Ha, ok, I agree with you, a code correctly indented will show the
> > > *begin* and *end* by geometry. But what if the code is not yours and
> > > not perfectly formatted ?
> >
> > Then normally it compiles and has correct begin/end pairing.
>
> Hum, my mind is not very clear those last time...
> I did not understand this one too...
> Do you mean that a not-well indented code, after compiling, will be
> re-indented ? (like JEDI does)
>
No, I mean that foreign code normally compiles so begin/end pairing is correct
and there is no need to find incorrect begin/end pairs by syntax colouring.
Although i must confess that if I need to debug someting in Free Pascal
RTL/FCL I often first need to change the coding style in order to be able to
grasp the structure. ;-)
For me the FPC coding style is the worst possible.
> > > So the new question is: Do you have some tips how to do that
> > > colored-begin-end with a MSEide syntax highlighter ?
> >
> > I fear that is not so easy to be done "right".
>
> I jump last night into pascal.sdef.
> Thanks Martin, it is easy to understand-make-work.
>
> So, deleting in => keyworddefs pascal => 'BEGIN' 'END'
> Adding => keyworddefs pascalplus 'BEGIN' 'END'
>
> And adding new color for pascalplus => isolate all the begin-end but with
> same color for all begin-end.
>
But that will not solve the task to colour pairs which belong together?
> It seems that *if, case and friends* are not allowed in syntax highlighter
> (or i miss something).
>
I don't understand.
> Does it exist help for the syntax of mseide syntax-designer files?
>
It is defined in lib/common/designutils/msesyntaxpainter.pas
"
(*
sdef file =
{globaldefinition}
{scope}
//last scope is default scope
globaldefinition = CASEINSENSITIVE | keywordchars | addkeywordchars |
keyworddefs | editorcolors | styles
keywordchars =
KEYWORDCHARS newline
{{string} newline}
//default = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxy0123456789_'
addkeywordchars =
ADDKEYWORDCHARS newline
{{string} newline}
string =
'{character}'
character =
ASCII-character
styles =
STYLE newline
{stylename styledef newline}
styledef =
[stylestring [fontcolor [colorbackground]]]
stylestring =
'[b][i][u][s]'
//b = bold i = italic u = underline s = strikeout
keyworddefs =
KEYWORDDEFS keyworddefsname [stylename] newline
{{keyword} newline}
keyword =
string
editorcolors =
COLORS [[[fontcolor [backgroundcolor [statementcolor]]]
// cl_default for project options settings
scope =
SCOPE scopename [stylename] newline
{localdefinition}
localdefinition =
keywords | calltokens | jumptokens | endtokens | RETURN newline
keywords =
KEYWORDS [style] newline //style used as default
{keyworddefsname [style] newline}
calltokens =
CALLTOKENS newline
{{[.|,]string}[.]} scopename newline}
//. -> whitespace, example:
//'begin' finds 'abeginz ...
//.'begin' finds newline'beginz', ' beginz' ...
//'begin'. finds 'abegin ', 'abegin'newline ...
//.'begin'. finds newline'begin ',' begin ', ' begin'newline ...
//, -> begin of line
jumptokens =
JUMPTOKENS newline
{{[.]string}[.]} scopename newline}
endtokens =
ENDTOKENS newline
{{[.]string}[.]} [stylename] newline}
*)
"
I don't think that tsyntaxpainter can fulfil your requirement.
Martin
------------------------------------------------------------------------------
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk