Home Download Buy Blog Forum Support

Own highlight language from Perl

Own highlight language from Perl

Postby photolado on Fri Sep 14, 2012 8:02 am

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?
photolado
 
Posts: 6
Joined: Mon Sep 03, 2012 9:35 am

Re: Own highlight language from Perl

Postby photolado on Fri Sep 14, 2012 11:27 am

I found it :idea:

Put the code into:
Code: Select all
<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:
Code: Select all
<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>
photolado
 
Posts: 6
Joined: Mon Sep 03, 2012 9:35 am

Re: Own highlight language from Perl

Postby nick. on Fri Sep 14, 2012 4:39 pm

But Perl doesn't support multiline comments...
nick.
 
Posts: 266
Joined: Wed Jan 18, 2012 3:45 am

Re: Own highlight language from Perl

Postby photolado on Tue Sep 18, 2012 10:47 am

Yes that is right.
I need to create highlight for QORE language. It is like perl but more powerful.
photolado
 
Posts: 6
Joined: Mon Sep 03, 2012 9:35 am


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 20 guests