<=[[cw4:common_scripting_language]] ===== Creating xRPL scripts ===== Any text editor can be used to edit xRPL files. However, syntax highlight and auto completion makes coding a lot easier. Support files are provided for several available editors. ==== Notepad++ ==== Notepad++ is a popular, free, open-source editor. Notepad++ can be obtained from here: [[http://notepad-plus-plus.org/]]Make sure you download only from the official Notepad++ website to avoid malware. https://notepad-plus-plus.org/ * Once Notepad++ is installed you can add **syntax highlight** for the CRPL language. Currently there are two sample thems, one for the "normal (llisth) theme and one for the "dark" (Deep Black) theme. * Light theme: [[crpl:crpl-syntax|crpl-syntax.xml]] * Deep Black theme: [[crpl:crpl-syntax-deep-black.xml]] * Download either (or both) of those files, then: * Open Notepad++, select Language from the menu bar, click "Define Your Language", then "Import". *You can add **keyword auto completion** to Notepad++ by download this file [[4rpl:4rpl.xml]] * To install into Notepad++ you need to copy 4rpl.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. * Alternatively, download this file [[https://drive.google.com/open?id=18U2nQ32AajOZESGKERYBtrNlS1YHjlmD|crpl.xml]] instead, which works for **keyword auto completion** as well, but also contains the input, output, and the description of each command. * Use the same process to install as above. To see the description of the command, type the opening bracket "(" after the command you want to see help for. Then press Esc to dismiss the help, or click elsewhere in the code. Disclaimer: these hints were autogenerated from the wiki, so the formatting might not be the best. * You can also create a keyboard shortcut to open the wiki of the current command you have your cursor on. * In Notepad++, go into "Run -> Run", then type ''https://knucklecracker.com/wiki/doku.php?id=crpl:docs:$(CURRENT_WORD)'' into the input field and click "Save". After that, select a name (for example "Open CRPL Wiki") and a keyboard shortcut (for example Ctrl+Shift+H) and click OK, then just close the Run... dialog. After that, you should see your shortcut in the "Run" menu, and you can use it to open the current command (the one that your input cursor is currently on) in the wiki. By default, Notepad++ has a "reto" look (to put it kindly). The UI for it has not been revamped since inception. For those that prefer, notepad++ has several dark theme, and [[https://medium.com/@HiSandy/notepad-plus-plus-material-theme-2c3951e65e01|here]] is a link to a Material design. Clearly the UI can't be changed, but at least it will be less glaring on the eyes. ==== Visual Studio Code ==== Visual Studio Code can be obtained from here: [[https://code.visualstudio.com/]]. Features: * Syntax Highlighting * Looking stuff up on the wiki * Syntactical diagnostics (making sure block delimiters match, $ parameters are at the start of the file, etc) * Implements several VSCode features for named entities (variables/functions): go-to-definition, rename, and find references * Checks to make sure variables are used (written to at least once and read from at least once) Instructions: * Download this *.vsix file: [[https://github.com/stellHex/crpl-vscode/releases/download/v0.3.0-beta/crpl-0.3.0.vsix]] * In Visual Studio Code, Go to View -> Extensions. * In the menu that opens, expand the more options menu in top right and press Install from VSIX, then point to the downloaded file. * All files with the *.crpl extension will now automatically utilize the features above. ==== Sublime Text ==== Sublime Text can be obtained from here: [[https://www.sublimetext.com/3]]. Features include syntax highlighting and auto completion. Instructions: * In Sublime Text, go to Tools -> Command Palette. * Type "Install Package Control" and hit Enter. * Open the Command Palette again and type "Package Control: Install Package". * In the menu that opens, type "CRPL", then select the Creeper Reverse Polish Language package. * All files with the *.crpl extension should now use this package. ===== Translation Front-end ===== Forum user [[https://knucklecracker.com/forums/index.php?action=profile;u=6122 | Arin112]] (Discord: Arin112#8343) wrote a C-lookalike front-end translator that will produce xRPL code as output. There is a [[https://knucklecracker.com/forums/index.php?topic=31849.msg179146#msg179146 | reference to the translator (MplLang) on the forum]] , and the source code and examples are on [[https://github.com/Arin112/mplLang | Github]]. Time permitting, this deserves a more complete treatment and probably a section of it's own. \\ \\ ===== Miscellaneous Highlighting Schemes ===== === Syntax Highlighting in the Wiki === Dokuwiki uses [[http://qbnz.com/highlighter/|GeSHi]] syntax highlighting. === Syntax Highlighting for Discord ===