Plotscript on Notepad++
Moderators: marionline, SDHawk
Plotscript on Notepad++
Well, the title is self explanatory but, is there a way to write plotscript on Notepad++ with support? I tried importing plotscr.xml but it dint work.
"I can't buy food with glory"
I assume you're talking just about syntax highlighting?
I don't believe anyone has ever written a HamsterSpeak definition file for Notepad++. IIRC Notepad++ actually has two different ways to define highlighting: standard Scintilla definition files, and a custom format (or is it just a custom editor?). It doesn't look too hard to define using the friendly editor they provide for it.
I don't believe anyone has ever written a HamsterSpeak definition file for Notepad++. IIRC Notepad++ actually has two different ways to define highlighting: standard Scintilla definition files, and a custom format (or is it just a custom editor?). It doesn't look too hard to define using the friendly editor they provide for it.
Last edited by TMC on Tue May 19, 2015 9:41 pm, edited 1 time in total.
That would be great.
Are you aware of the HamsterWhisper editor James created? It's based on GtkSourceView, so you can look at the HamsterSpeak definition file for that:
Are you aware of the HamsterWhisper editor James created? It's based on GtkSourceView, so you can look at the HamsterSpeak definition file for that:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!--
Author: James Paige <Bob@HamsterRepublic.com>
Copyright (C) 2010 James Paige <Bob@HamsterRepublic.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
-->
<language id="hamsterspeak" _name="OHRRPGCE Plotscript (HamsterSpeak)" version="2.0" _section="Scripts">
<metadata>
<property name="mimetypes">text/x-hamsterspeak</property>
<property name="globs">*.hss;*.hsi;*.hsd;*.txt</property>
<property name="line-comment-start">#</property>
</metadata>
<styles>
<style id="comment" _name="Comment" map-to="def:comment"/>
<style id="include" _name="Include" map-to="def:preprocessor"/>
<style id="declare" _name="Declare" map-to="def:statement"/>
<style id="obsolete" _name="Obsolete" map-to="def:error"/>
<style id="flow" _name="Flow" map-to="def:statement"/>
<style id="number" _name="Number" map-to="def:number"/>
<style id="operator" _name="Operator" map-to="def:operator"/>
<style id="string" _name="string" map-to="def:string"/>
<style id="token" _name="Token" map-to="def:identifier"/>
</styles>
<default-regex-options case-sensitive="false"/>
<definitions>
<!-- d is for delimiter -->
<define-regex id="d">(?=[ \t]*($|[,\(\)]))</define-regex>
<context id="comment" style-ref="comment">
<match>#.*$</match>
</context>
<context id="include" style-ref="include">
<match>^[ \t]*include[ \t]*,.*$</match>
</context>
<context id="declare" style-ref="declare">
<match>((plot)?[ \t]*script|define[ \t]*(constant|function|operator)|(global)?[ \t]*variable)\%{d}</match>
</context>
<context id="obsolete" style-ref="obsolete">
<match>[define[ \t]*script\%{d}</match>
</context>
<context id="flow" style-ref="flow">
<match>(begin|end|if|then|else|while|do|for|return|exit[ \t]+(returning|script)|break|continue|switch|case)\%{d}</match>
</context>
<context id="operator" style-ref="operator">
<match>(\^|(mod|xor|and|or|not)\%{d}|/|\*|[-][-]|\+=|\+|==|<>|<<|>>|<=|>=|&&|\|\||\^\^|:=|[+]=|[-]=|\$=|\$\+|@)</match>
</context>
<context id="number" style-ref="number">
<match extended="true">
(?<![\w\.])
[+-]?[0-9]+
(?![\w\.])
</match>
</context>
<context id="string" style-ref="string">
<match>".*?"</match>
</context>
<context id="token" style-ref="token">
<match>\b[A-Z_][-A-Z0-9_ \t:]*\b</match>
</context>
<context id="hamsterspeak">
<include>
<context ref="comment"/>
<context ref="include"/>
<context ref="operator"/>
<context ref="number"/>
<context ref="declare"/>
<context ref="obsolete"/>
<context ref="flow"/>
<context ref="string"/>
<context ref="token"/>
</include>
</context>
</definitions>
</language>
Last edited by TMC on Fri May 22, 2015 1:02 am, edited 1 time in total.