summary refs log tree commit diff
path: root/pkgs/applications/misc/far2l
diff options
context:
space:
mode:
authorVolth <volth@webmaster.ms>2017-08-13 15:09:37 +0000
committerVolth <volth@webmaster.ms>2017-08-13 15:10:04 +0000
commitd9854884fa52f0207faa1f5d431d2a48f3d57eb4 (patch)
tree2b3e741d583b4887cc791a2af8f751b7a07659d1 /pkgs/applications/misc/far2l
parent7d50d5e304caa148f1bcde7ee9ae42aac30f8111 (diff)
downloadnixpkgs-d9854884fa52f0207faa1f5d431d2a48f3d57eb4.tar
nixpkgs-d9854884fa52f0207faa1f5d431d2a48f3d57eb4.tar.gz
nixpkgs-d9854884fa52f0207faa1f5d431d2a48f3d57eb4.tar.bz2
nixpkgs-d9854884fa52f0207faa1f5d431d2a48f3d57eb4.tar.lz
nixpkgs-d9854884fa52f0207faa1f5d431d2a48f3d57eb4.tar.xz
nixpkgs-d9854884fa52f0207faa1f5d431d2a48f3d57eb4.tar.zst
nixpkgs-d9854884fa52f0207faa1f5d431d2a48f3d57eb4.zip
far2l: add nix syntax highlighting
Diffstat (limited to 'pkgs/applications/misc/far2l')
-rw-r--r--pkgs/applications/misc/far2l/add-nix-syntax-highlighting.patch157
-rw-r--r--pkgs/applications/misc/far2l/default.nix2
2 files changed, 159 insertions, 0 deletions
diff --git a/pkgs/applications/misc/far2l/add-nix-syntax-highlighting.patch b/pkgs/applications/misc/far2l/add-nix-syntax-highlighting.patch
new file mode 100644
index 00000000000..68a16b196fa
--- /dev/null
+++ b/pkgs/applications/misc/far2l/add-nix-syntax-highlighting.patch
@@ -0,0 +1,157 @@
+diff --git a/colorer/configs/base/hrc/nix.hrc b/colorer/configs/base/hrc/nix.hrc
+new file mode 100644
+index 0000000..1bd9bb5
+--- /dev/null
++++ b/colorer/configs/base/hrc/nix.hrc
+@@ -0,0 +1,132 @@
++<?xml version="1.0" encoding="windows-1251"?>
++<!DOCTYPE hrc PUBLIC "-//Cail Lomecb//DTD Colorer HRC take5//EN"
++  "http://colorer.sf.net/2003/hrc.dtd">
++<hrc version="take5" xmlns="http://colorer.sf.net/2003/hrc"
++     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
++     xsi:schemaLocation="http://colorer.sf.net/2003/hrc http://colorer.sf.net/2003/hrc.xsd">
++
++  <type name="nix">
++
++    <annotation><documentation>
++        Nix
++    </documentation></annotation>
++
++    <import type="def"/>
++
++    <region name="Code" parent="def:Text"/>
++    <region name="StringEscape" parent="def:StringContent"/>
++    <region name='Import' parent='def:Directive'/>
++    <region name='ImportOutline' parent='def:Outlined'/>
++    <region name="Path"     parent="def:Path"/>
++    <region name="URL"      parent="def:String"/>
++    <region name="LiteralKeyword" parent="def:Keyword"/>
++    <region name='Interpolation' parent='def:StringEdge'/>
++    <region name="Ident" parent="def:Identifier"/> <!-- Label  -->
++
++    <scheme name="TabsAsErrors" if="tabs-as-errors">
++      <regexp match="/\t+/" region='def:Error'/>
++    </scheme>
++
++    <scheme name="SpacesAsErrors" if="spaces-as-errors">
++      <regexp match="/\x20+$/" region='def:Error'/>
++    </scheme>
++
++    <scheme name="NotNestedComment">
++      <inherit scheme="TabsAsErrors"/>
++      <inherit scheme="SpacesAsErrors"/>
++      <inherit scheme="Comment"/>
++    </scheme>
++
++    <scheme name="String">
++      <inherit scheme="TabsAsErrors"/>
++      <inherit scheme="SpacesAsErrors"/>
++<!--  <regexp match="/\\[xX]0*[\da-fA-F]{1,2}/"                   region0="StringEscape"/> -->
++      <regexp match="/\\./"                                       region0="StringEscape"/>
++      <block start="/(\$\{)/" end="/(\})/" scheme="NixExpression" region="Code" region00="Interpolation" region01="PairStart" region10="Interpolation" region11="PairEnd"/>
++    </scheme>
++
++    <scheme name="BlockString">
++      <inherit scheme="TabsAsErrors"/>
++      <inherit scheme="SpacesAsErrors"/>
++
++      <regexp match="/&apos;&apos;\$/"                                          region0="StringEscape"/>
++      <regexp match="/&apos;&apos;&apos;/"                                      region0="StringEscape"/>
++      <block start="/(\$\{)/" end="/(\})/" scheme="NixExpression" region="Code" region00="Interpolation" region01="PairStart" region10="Interpolation" region11="PairEnd"/>
++    </scheme>
++
++    <scheme name="NixIdent">
++      <regexp match="/\w[\w\d-]*'*/"           region0="Ident"/>
++    </scheme>
++
++    <scheme name="NixExpression">
++      <inherit scheme="TabsAsErrors"/>
++      <inherit scheme="SpacesAsErrors"/>
++
++      <inherit scheme="def:unixCommentDirective"/>
++      <block start="/#/"    end="/\s*$/"            scheme="Comment"          region="LineComment" region10="def:Error"/>
++      <block start="/\/\*/" end="/\*\//"            scheme="NotNestedComment" region="Comment"     region00="PairStart" region10="PairEnd"/>
++
++      <block start="/(\$\{)/" end="/(\})/" scheme="NixExpression" region00="Interpolation" region01="PairStart" region10="Interpolation" region11="PairEnd"/>
++      <block start="/(\{)/"   end="/(\})/" scheme="NixExpression" region00="Symbol"        region01="PairStart" region10="Symbol"        region11="PairEnd"/>
++      <block start="/(\()/"   end="/(\))/" scheme="NixExpression" region00="Symbol"        region01="PairStart" region10="Symbol"        region11="PairEnd"/>
++      <block start="/(\[)/"   end="/(\])/" scheme="NixExpression" region00="Symbol"        region01="PairStart" region10="Symbol"        region11="PairEnd"/>
++
++      <regexp match="/(\.\.|\.|\~|)\/[\w\d.+=?-]+(\/[\w\d.+=?-]+)*/"            region0="Path"/>
++      <regexp match="/&lt;[\w\d\/.-]+&gt;/"                                     region0="Path"/>
++      <regexp match="/(ftp|mirror|http|https|git):\/\/[\w\d\/:?=&amp;.~-]+/"    region0="URL"/>
++      <block start="/(&quot;)/"       end="/(&quot;)/"       scheme="String"      region="String" region00="def:StringEdge" region01="def:PairStart" region10="def:StringEdge" region11="def:PairEnd"/>
++      <block start="/(&apos;&apos;)/" end="/(&apos;&apos;)/" scheme="BlockString" region="String" region00="def:StringEdge" region01="def:PairStart" region10="def:StringEdge" region11="def:PairEnd"/>
++
++      <keywords region="Keyword">
++        <word name="assert"/>
++        <word name="else"/>
++        <word name="if"/>
++        <word name="in"/>
++        <word name="inherit"/>
++        <word name="import"/>
++        <word name="let"/>
++        <word name="rec"/>
++        <word name="then"/>
++        <word name="throw"/>
++        <word name="with"/>
++      </keywords>
++      <keywords region="LiteralKeyword">
++        <word name="true"/>
++        <word name="false"/>
++        <word name="null"/>
++      </keywords>
++      <keywords region="Symbol">
++        <symb name="."/>
++        <symb name=":"/>
++        <symb name=","/>
++        <symb name=";"/>
++
++        <symb name="*"/>
++        <symb name="/"/>
++        <symb name="%"/>
++        <symb name="+"/>
++        <symb name="-"/>
++        <symb name="!"/>
++        <symb name="?"/>
++        <symb name="@"/>
++        <symb name="&lt;"/>
++        <symb name="&gt;"/>
++        <symb name="&amp;"/>
++        <symb name="|"/>
++        <symb name="="/>
++        <symb name="..."/>
++      </keywords>
++
++      <inherit scheme="def:Number"/>
++      <inherit scheme="NixIdent"/>
++
++      <regexp match="/[^\)\}\]\s]/" region='def:Error'/>
++
++    </scheme>
++
++    <scheme name="nix">
++      <inherit scheme="NixExpression"/>
++    </scheme>
++
++  </type>
++</hrc>
+diff --git a/colorer/configs/base/hrc/proto.hrc b/colorer/configs/base/hrc/proto.hrc
+index 11e493b..2a67263 100644
+--- a/colorer/configs/base/hrc/proto.hrc
++++ b/colorer/configs/base/hrc/proto.hrc
+@@ -156,6 +156,14 @@
+     <location link="jar:common.jar!base/lua.hrc"/>
+     <filename>/\.(w?lua)$/i</filename>
+   </prototype>
++  <prototype name="nix" group="main" description="Nix">
++    <location link="nix.hrc"/>
++    <filename>/\.(nix)$/i</filename>
++    <parameters>
++      <param name="tabs-as-errors" value="true" description="Shows tabulation symbol as error"/>
++      <param name="spaces-as-errors" value="true" description="Shows trailing spaces as error"/>
++    </parameters>
++  </prototype>
+   <prototype name="ruby" group="main" description="Ruby">
+     <location link="jar:common.jar!base/ruby.hrc"/>
+     <filename>/\.(rb|rbw|ruby|rake)$/i</filename>
diff --git a/pkgs/applications/misc/far2l/default.nix b/pkgs/applications/misc/far2l/default.nix
index 658fe3477b3..926b1a41ede 100644
--- a/pkgs/applications/misc/far2l/default.nix
+++ b/pkgs/applications/misc/far2l/default.nix
@@ -17,6 +17,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ wxGTK30 glib pcre ];
 
+  patches = [ ./add-nix-syntax-highlighting.patch ];
+
   postPatch = ''
     echo 'echo ${build}' > far2l/bootstrap/scripts/vbuild.sh