Menu

#458 Python Highlighter does not highligh all Keywords

Not Fixed
open
nobody
3
2015-04-11
2015-04-11
Claudio H.
No

Hello

I tried to use SynEdit with Delphi XE6

I use SynEdit r117 from the Repository in my Delphi XE6 application. I would like to highlight Python code.

For that, I placed a SynEdit Component onto my Form. Additionaly I added the Component SynPythonSyn onto it. I have connected them through the Objectinspector.

Now I am able to highlight SOME Python keywords. After a few hours of searching, I opened the Sourcfile SynHighlighterPython.pas which was included in the Package ZIP of SynEdit.

There is a section with all the Keywords of python:

// List of keywords
KEYWORDCOUNT = 29;
KEYWORDS: array [1..KEYWORDCOUNT] of UnicodeString =
(
'and',
'assert',
'break',
'class',
'continue',
'def',
'del',
'elif',
'else',
'except',
'exec',
'finally',
'for',
'from',
'global',
'if',
'import',
'in',
'is',
'lambda',
'not',
'or',
'pass',
'print',
'raise',
'return',
'try',
'while',
'yield'
);

My problem is, that "exec" is the last highlighted keyword. All other in the list after "exec" will not be highlighted.

If i change the SourceCode and only add "import" ord "not" as an example.
It will also not recognize these words!

Really strange behaviour

1 Attachments

Discussion


Log in to post a comment.

MongoDB Logo MongoDB