Syntax Highlight and Code Completion

Started by knucracker, December 21, 2012, 06:22:08 PM

Previous topic - Next topic

knucracker

This topic is now obsoletete and replaced by the "Creating CRPL Scripts" in the wiki.



SEE THE DOCS PAGE (NEAR THE BEGINNING IN THE SECTION TITLED 'EDITING CRPL') FOR SYNTAX AND AUTO COMPLETION FILES FOR NOTEPAD++.
http://knucklecracker.com/creeperworld3/CRPL/docs/crpldocs.html


This topic will be removed soon.


Attached is the latest syntax highlight definition file and the code completion file for CRPL in Notepad++
( http://notepad-plus-plus.org/ )

crpl-syntax.xml:  The Syntax highlight file. To install into Notepad++ select Language from the menu, then click "Defined Your Language", then "import".

CRPL.xml: The Code completion file.  To install into Notepad++ you need to copy CRPL.xml to your Notepad++ install directory\plugins\APIs directory.  Then, restart Notepad++.  Next, go to the Settings/Preferences menu in Notepad++.  Click the "Backup/Auto-Completion" tab.  Check the "Enable auto-completion on each input" checkbox, and make sure the "Function completion" radio button is selected.

eduran

Quote from: Grayzzur on February 03, 2014, 08:57:45 AM
Also, my Notepad++ syntax highlighter is getting more out of date with each update!

Mine is mostly up-to-date, files are attached. I'll add them to the wiki once someone other than me gave them a test run.

Grayzzur

Eduran,

Your crpl.xml auto-complete list is missing "return".

My notes on your crpl-syntax.xml are below. This is all off the Keywords Lists tab in the user defined language dialog.

1st Group
CONST_GETATTRIBUTE and CONST_SETATTRIBUTE -- I'm not sure what these are for. They only place they seem to exist is in the Notepad++ syntax file. Probably need to just whack them.

You are missing: return

Also, I prefer to remove the rest of the language functions and keep just the program flow control and stack manipulation commands in this list, and give them a color (brown, 804000). If the commands like CreateSpore/CurrentCoords/etc. are all just going to be black anyway, they don't need to occupy one of these spots. I like the flow control keywords to stand out, though. This may just be my personal preference.

My list is just: break concat do dup dup2 else endif endonce endwhile if loop once pop repeat return swap while

2nd Group
->! <-! -?! -> <- -? --

5th Group
You're missing a few here. Complete list as I have it:
abs acos add and asfloat asin asint atan atan2 ceil cos div eq eq0 floor gt gte lt lte ln log log10 max min mod mul neg neq neq0 not or pow sin sqrt sub tan xor

Preference of mine: I like true/false (as well as e, pi, i, j & k) down in the 8th group, previously unused, as these represent numerical values and not program flow. Seeing TRUE and FALSE in red just bugs me. :)

7th Group
You are missing:
CONST_ACPACKETREQUESTDELAY
CONST_CONNECTABLE

My 8th Group
I J K E PI TRUE FALSE
Color: (004080)
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

Clean0nion

You're also missing a good deal of CONST_s.
To be more specific:
Spoiler
CONST_BEAMTARGET
CONST_BUILDCOST
CONST_CANREQUESTAMMO
CONST_CELLHEIGHT
CONST_CELLWIDTH
CONST_CONNECTABLE
CONST_DESTROYMODE
CONST_DESTROYONDAMAGE
CONST_HEALRATE
CONST_ISBUILDING
CONST_ISLANDED
CONST_NULLIFIERDAMAGEAMT
CONST_NULLIFIERDAMAGES
CONST_PACKETREQUESTDELAY
CONST_PIXELCOORDX
CONST_PIXELCOORDY
CONST_REQUESTACPACKETS
CONST_REQUESTPACKETS
CONST_SHOWAMMOACBAR
CONST_SHOWAMMOBAR
CONST_SHOWHEALTHBAR
CONST_SNIPERTARGET
CONST_SNIPERIGNORELOS
CONST_THORTARGET
[close]
Unless I'm using an outdated version, in which case where is the newest?

Grayzzur

I am discussion the version attached to Eduran's post above mine, which includes all the constants you listed, except CONST_CONNECTABLE which I mentioned.
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

Clean0nion

Quote from: Grayzzur on February 03, 2014, 12:42:19 PM
I am discussion the version attached to Eduran's post above mine, which includes all the constants you listed, except CONST_CONNECTABLE which I mentioned.
Downloaded both. The first seems to be just the same as the old version and the second fails to import.

eduran

I've simply added the most of the new stuff, without removing anything or changing the format. I'd say your version is probably more suited for the wiki than mine.

Quote from: Clean0nion on February 03, 2014, 12:45:07 PM
Downloaded both. The first seems to be just the same as the old version and the second fails to import.
The second file is meant for auto-completion. It's supposed to go into the ...\Notepad++\plugins\APIs folder.

Grayzzur

I've attached my version here, if you or anyone else wants to double-check that I haven't messed up something.
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

Grayzzur

I also added a half-dozen missing commands to the auto-completion list after comparing to the missing commands page.

The updates are in the wiki now at the usual place near the bottom of the CRPL Overview page.

"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker