You are here: PSPad forum > English discussion forum > Comment string <<< not recognized

Comment string <<< not recognized

#1 Comment string <<< not recognized

Posted by: Zababa | Date: 2013-01-24 07:13 | IP: IP Logged

Hello,

I am trying to write a custon syntax highlighter INI file. I need, that everything on a line following "<<<" is highlighted as a comment. My file looks like this (without Keywords):

[Settings]
Name=KPM Tickets
FileType=*.txt,*.kpm
CommentString=<<<
HTMLGroup=0
TabWidth=4
CaseSensitive=1
KeyWordChars=_
CodeExplorer=ftUnknown
SingleQuote=1
DoubleQuote=1
[KeyWords]

The Keywirds I write there are highlighted properly, so the file is working somehow. Yet it does not recognize the comments. Why is that?

Options: Reply | Quote | Up ^


#2 Re: Comment string <<< not recognized

Posted by: Zababa | Date: 2013-02-14 07:03 | IP: IP Logged

Careful bump. Is there nobody who would know why PSPad has got a problem with this?

Options: Reply | Quote | Up ^


#3 Re: Comment string <<< not recognized

Posted by: pspad | Date: 2013-02-14 11:51 | IP: IP Logged

Sorry, I though I wrote you replay.

There is necessary to modify program. I will add your line comment. Can you tell me name of your syntax?

Options: Reply | Quote | Up ^


#4 Re: Comment string <<< not recognized

Posted by: pspad | Date: 2013-02-14 16:55 | IP: IP Logged

And I need to know more details. This comment can start from any line position or from the begin of the line or from the first position on the line?

Options: Reply | Quote | Up ^


#5 Re: Comment string <<< not recognized

Posted by: Zababa | Date: 2013-03-19 07:36 | IP: IP Logged

Sorry for not replying, I almost gave up checking whether there are any new replies.

Why is it necessary know the name of the syntax? It is custom user syntax, for writing tickets for a specialized bugtracker. I called the file "KPM Tickets.ini". But I wish not that PSPad is offering a Syntax hightlight for KPM-Tickets like it's offering C/C++ or Java. Stuff around this is confidential and it shall only support this if it's got the file linked to one of the user-defined syntax highlight slots.

The comment is meant to start at the end of a line. It's primary purpose is to point our things which are right or wrong. I'll make up an example of a bug for a game in development, so you can see what kind of documents shall be highlighted with KPM Tickets.ini

Action:
You hero talks to the level boss.

Result:
Dialogue window opens.
You hero dies. <<< This is the bug

Expected Result:
Dialogue window opens.
You hero is still alive.

So you see that the comments are meant to be used at the end of a line. Actually, another thing that surprises me is that I cannot define multi-word keywords. I'd like to have Action, Result, and "Expected Result" as keywords. Can't I just add space " " to "KeyWordChars="? This way, if I want to have "Expected Result" highlighted, I have to make "Expected" a keyword itself, but I actually want to have "Expected Result" highlighted and "expected" or "Expected" in all other contexts shall be plain.

Also, for some reason words preceding ":" are highlighted in a different color than normal keywords. I did not define ":" as something special, so why does it do that? Is it because program languages start their loops with ":"? I need to highlight plain text, not a program code. Including ":" as a regular character of keywords ("KeyWordChars=:") does not do the trick.

Here is what I use now as syntax highlight file (I have many more keywords there, just keeping it small as a minimal working example):

;PSPad user HighLighter definition file
[Settings]
Name=KPM Tickets
HTMLGroup=0
Label=1
FileType=*.txt,*.kpm
CommentString=<<<
IndentChar=
UnIndentChar=
TabWidth=4
CaseSensitive=1
SingleQuote=1
DoubleQuote=1
EscString=1
KeyWordChars=_
CodeExplorer=ftUnknown
[KeyWords]
Action=
Expected Result=
Expected=
Result=
[ReservedWords]
[KeyWords2]
[KeyWords3]

Options: Reply | Quote | Up ^


#6 Re: Comment string <<< not recognized

Posted by: Zababa | Date: 2013-04-05 05:35 | IP: IP Logged

Any progress on this one yet?

Options: Reply | Quote | Up ^


#7 Re: Comment string <<< not recognized

Posted by: pspad | Date: 2013-04-05 05:46 | IP: IP Logged

It's done long time already. Download the latest developer build. Modify your user highlighter - check single line comment <<<

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR