Notepad++ simple GP syntax highlighting

Advanced GP Tips and Techniques

Moderator: MSandro

Post Reply
Spiralo-Idioïde
Posts: 11
Joined: Jun 16th, '19, 23:53

Notepad++ simple GP syntax highlighting

Post by Spiralo-Idioïde » Jul 3rd, '19, 13:41

Just few days ago i began to use the GP's textual libraries. And it's quite not user friendly with a basic textual editor. So I decided to use the user defined language feature of notepad ++.

Okay V2 Now !

I changed some things in the basic highlighting, but the main thing is the addition of the ability for Notepad++ to recognize class and global functions.
Function List.png


The main code for highlighting :

Code: Select all

<NotepadPlus>
    <UserLang name="GP" ext="gp" udlVersion="2.1">
        <Settings>
            <Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
            <Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
        </Settings>
        <KeywordLists>
            <Keywords name="Comments">00// 01 02 03 04</Keywords>
            <Keywords name="Numbers, prefix1"></Keywords>
            <Keywords name="Numbers, prefix2"></Keywords>
            <Keywords name="Numbers, extras1"></Keywords>
            <Keywords name="Numbers, extras2"></Keywords>
            <Keywords name="Numbers, suffix1"></Keywords>
            <Keywords name="Numbers, suffix2"></Keywords>
            <Keywords name="Numbers, range"></Keywords>
            <Keywords name="Operators1"></Keywords>
            <Keywords name="Operators2">== === + - / * &lt; &gt; &gt;= != % isNil notNil compareFloats &lt;=</Keywords>
            <Keywords name="Folders in code1, open">{ \n</Keywords>
            <Keywords name="Folders in code1, middle"></Keywords>
            <Keywords name="Folders in code1, close">}</Keywords>
            <Keywords name="Folders in code2, open"></Keywords>
            <Keywords name="Folders in code2, middle"></Keywords>
            <Keywords name="Folders in code2, close"></Keywords>
            <Keywords name="Folders in comment, open"></Keywords>
            <Keywords name="Folders in comment, middle"></Keywords>
            <Keywords name="Folders in comment, close"></Keywords>
            <Keywords name="Keywords1">if else while animate for repeat waitUntil</Keywords>
            <Keywords name="Keywords2">to&#x000D;&#x000A;method&#x000D;&#x000A;return&#x000D;&#x000A;argCount&#x000D;&#x000A;arg&#x000D;&#x000A;defineClass&#x000D;&#x000A;call&#x000D;&#x000A;callWith&#x000D;&#x000A;function</Keywords>
            <Keywords name="Keywords3">true false not and or</Keywords>
            <Keywords name="Keywords4">this</Keywords>
            <Keywords name="Keywords5"></Keywords>
            <Keywords name="Keywords6"></Keywords>
            <Keywords name="Keywords7"></Keywords>
            <Keywords name="Keywords8"></Keywords>
            <Keywords name="Delimiters">00&apos; 01 02&apos; 03( 04 05) 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
        </KeywordLists>
        <Styles>
            <WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="COMMENTS" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="LINE COMMENTS" fgColor="5E86BD" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="NUMBERS" fgColor="FF00FF" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS1" fgColor="C10000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="KEYWORDS2" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="KEYWORDS3" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="KEYWORDS4" fgColor="129300" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="KEYWORDS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="OPERATORS" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="FOLDER IN CODE1" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="FOLDER IN CODE2" fgColor="00FF40" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS1" fgColor="FF00FF" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="100924419" />
            <WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" fontName="nextUpdateDate" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" fontName="isMaximized" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontName="eu." fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontName="multiLine" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
        </Styles>
    </UserLang>
</NotepadPlus>
You need to copy the code to a .xml file and then import into notepad++ with the user defined language feature in the language panel. It will be easy to modify for anyone who wants to do so.


Code for functions :

Use the file in attachments and rename it to functionList.xml, then replace the original file in main notepadd++ folder.



Known Bugs :
  • When opening a file with GP code and selecting GP as language, the folding of blocks might display without any sense. The only workaround I found is to copy/paste the code in a new file to have it displayed correctly.
Others
-Not all primitives are highlighted


I'll add more screenshots later.
Attachments
functionList.gpp
Change extension to .xml and replace original file
(64.7 KiB) Downloaded 1560 times
Last edited by Spiralo-Idioïde on Jan 15th, '20, 19:50, edited 1 time in total.

User avatar
Calloway
Posts: 100
Joined: Apr 30th, '18, 00:28
Location: Eastern United States

Re: Notepad++ simple GP syntax highlighting

Post by Calloway » Jul 6th, '19, 03:22

Thank you for this!
I've been trying to do this exact thing but it seems you beat me to it lol

I'll try adding more primitives

Spiralo-Idioïde
Posts: 11
Joined: Jun 16th, '19, 23:53

Re: Notepad++ simple GP syntax highlighting

Post by Spiralo-Idioïde » Jan 15th, '20, 19:51

I made a V2. More in first post.

User avatar
Calloway
Posts: 100
Joined: Apr 30th, '18, 00:28
Location: Eastern United States

Re: Notepad++ simple GP syntax highlighting

Post by Calloway » Jan 18th, '20, 00:54

Spiralo-Idioïde wrote:
Jan 15th, '20, 19:51
I made a V2. More in first post.
Looks great! :D

Post Reply