Sublime Forum

Own highlight language from Perl

#1

Hi all,

I would like to create a new syntax highlight based on Perl language.
At the bgining I would like to add support multiline comments with /* … */

How to do that?

0 Likes

#2

I found it :bulb:

Put the code into:

<string>Perl</string> <key>patterns</key> <array> >HERE<

In case you want to quick create your own language from perl, copy whole dir and in each file change string “perl” with your language name.

This code is from Javascript ( JavaScript.tmLanguage )
code:

<dict> <key>begin</key> <string>/\*\*(?!/)</string> <key>captures</key> <dict> <key>0</key> <dict> <key>name</key> <string>punctuation.definition.comment.js</string> </dict> </dict> <key>end</key> <string>\*/</string> <key>name</key> <string>comment.block.documentation.js</string> </dict> <dict> <key>begin</key> <string>/\*</string> <key>captures</key> <dict> <key>0</key> <dict> <key>name</key> <string>punctuation.definition.comment.js</string> </dict> </dict> <key>end</key> <string>\*/</string> <key>name</key> <string>comment.block.js</string> </dict> <dict> <key>captures</key> <dict> <key>1</key> <dict> <key>name</key> <string>punctuation.definition.comment.js</string> </dict> </dict> <key>match</key> <string>(//).*$\n?</string> <key>name</key> <string>comment.line.double-slash.js</string> </dict>

0 Likes

#3

But Perl doesn’t support multiline comments…

0 Likes

#4

Yes that is right.
I need to create highlight for QORE language. It is like perl but more powerful.

0 Likes