Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

added Literate Haskell filetype #163

Open
wants to merge 2 commits into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 16, 2013
  1. @exbb2

    added Literate Haskell filetype

    exbb2 authored
  2. @exbb2

    fix extension

    exbb2 authored
This page is out of date. Refresh to see the latest.
View
3  data/filetype_extensions.conf
@@ -32,7 +32,8 @@ Genie=*.gs;
GLSL=*.glsl;*.frag;*.vert;
Go=*.go;
Graphviz=*.gv;*.dot;
-Haskell=*.hs;*.lhs;*.hs-boot;*.lhs-boot;
+Haskell=*.hs;*.hs-boot;
+LiterateHaskell=*.lhs;*.lhs-boot;
Haxe=*.hx;
HTML=*.htm;*.html;*.shtml;*.hta;*.htd;*.htt;*.cfm;
Java=*.java;*.jsp;
View
77 data/filetypes.literatehaskell
@@ -0,0 +1,77 @@
+# For complete documentation of this file, please see Geany's main documentation
+[styling]
+# Edit these in the colorscheme .conf file instead
+default=default
+commentline=comment_line
+commentblock=comment
+commentblock2=comment
+commentblock3=comment
+literate_comment=comment
+literate_codedelim=preprocessor
+number=number_1
+keyword=keyword_1
+reserved_operator=keyword_1
+import=preprocessor
+string=string_1
+character=character
+class=class
+operator=operator
+identifier=identifier_1
+instance=type
+capital=type
+module=function
+data=number_2
+pragma=preprocessor
+preprocessor=preprocessor
+stringeol=string_eol
+
+[keywords]
+# all items must be in one line
+keywords=case class data default deriving do else forall foreign if import in infix infixl infixr instance let module newtype of then type where
+ffi=capi ccall export import interruptible prim safe stdcall unsafe
+reserved_operators=-> .. :: <- = => @ \ | ~ ← → ∀ ∷ ★
+
+[lexer_properties]
+lexer.haskell.allow.hash=1
+lexer.haskell.allow.quotes=1
+lexer.haskell.allow.questionmark=0
+lexer.haskell.import.safe=1
+lexer.haskell.cpp=1
+styling.within.preprocessor=0
+fold.haskell.imports=0
+
+[settings]
+# default extension used when saving files
+extension=lhs
+
+# the following characters are these which a "word" can contains, see documentation
+#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
+
+# single comments, like # in this file
+comment_single=--
+# multiline comments
+#comment_open=
+#comment_close=
+
+# set to false if a comment character/string should start at column 0 of a line, true uses any
+# indentation of the line, e.g. setting to true causes the following on pressing CTRL+d
+ #command_example();
+# setting to false would generate this
+# command_example();
+# This setting works only for single line comments
+comment_use_indent=true
+
+# context action command (please see Geany's main documentation for details)
+context_action_cmd=
+
+[indentation]
+#width=4
+# 0 is spaces, 1 is tabs, 2 is tab & spaces
+#type=1
+
+[build_settings]
+# %f will be replaced by the complete filename
+# %e will be replaced by the filename without extension
+# (use only one of it at one time)
+compiler=ghc --make "%f"
+run_cmd="./%e"
View
2  scintilla/scintilla_changes.patch
@@ -82,7 +82,7 @@ index 84d003e..37b2a3c 100644
- LINK_LEXER(lmKix);
LINK_LEXER(lmLatex);
LINK_LEXER(lmLISP);
-- LINK_LEXER(lmLiterateHaskell);
+ LINK_LEXER(lmLiterateHaskell);
- LINK_LEXER(lmLot);
- LINK_LEXER(lmLout);
LINK_LEXER(lmLua);
View
1  scintilla/src/Catalogue.cxx
@@ -102,6 +102,7 @@ int Scintilla_LinkLexers() {
LINK_LEXER(lmHTML);
LINK_LEXER(lmLatex);
LINK_LEXER(lmLISP);
+ LINK_LEXER(lmLiterateHaskell);
LINK_LEXER(lmLua);
LINK_LEXER(lmMake);
LINK_LEXER(lmMarkdown);
View
8 src/filetypes.c
@@ -281,6 +281,14 @@ static void init_builtin_filetypes(void)
ft->mime_type = g_strdup("text/x-haskell");
ft->group = GEANY_FILETYPE_GROUP_COMPILED;
+#define LITERATEHASKELL
+ ft = filetypes[GEANY_FILETYPES_LITERATEHASKELL];
+ ft->lang = 24;
+ ft->name = g_strdup("LiterateHaskell");
+ filetype_make_title(ft, TITLE_SOURCE_FILE);
+ ft->mime_type = g_strdup("text/x-literate-haskell");
+ ft->group = GEANY_FILETYPE_GROUP_COMPILED;
+
#define MARKDOWN
ft = filetypes[GEANY_FILETYPES_MARKDOWN];
ft->lang = 36;
View
1  src/filetypes.h
@@ -94,6 +94,7 @@ typedef enum
GEANY_FILETYPES_ABAQUS,
GEANY_FILETYPES_BATCH,
GEANY_FILETYPES_POWERSHELL,
+ GEANY_FILETYPES_LITERATEHASKELL,
/* ^ append items here */
GEANY_MAX_BUILT_IN_FILETYPES /* Don't use this, use filetypes_array->len instead */
}
View
2  src/highlighting.c
@@ -1062,6 +1062,7 @@ void highlighting_init_styles(guint filetype_idx, GKeyFile *config, GKeyFile *co
init_styleset_case(FORTH);
init_styleset_case(FORTRAN);
init_styleset_case(HASKELL);
+ init_styleset_case(LITERATEHASKELL);
init_styleset_case(HAXE);
init_styleset_case(AS);
init_styleset_case(HTML);
@@ -1144,6 +1145,7 @@ void highlighting_set_styles(ScintillaObject *sci, GeanyFiletype *ft)
styleset_case(FORTH);
styleset_case(FORTRAN);
styleset_case(HASKELL);
+ styleset_case(LITERATEHASKELL);
styleset_case(HAXE);
styleset_case(AS);
styleset_case(HTML);
View
6 src/highlightingmappings.h
@@ -648,6 +648,12 @@ static const HLKeyword highlighting_keywords_HASKELL[] =
};
#define highlighting_properties_HASKELL EMPTY_PROPERTIES
+/* Literate Haskell */
+#define highlighting_lexer_LITERATEHASKELL SCLEX_LITERATEHASKELL
+#define highlighting_styles_LITERATEHASKELL highlighting_styles_HASKELL
+#define highlighting_keywords_LITERATEHASKELL highlighting_keywords_HASKELL
+#define highlighting_properties_LITERATEHASKELL highlighting_properties_HASKELL
+
/* HAXE */
#define highlighting_lexer_HAXE SCLEX_CPP
View
1  src/symbols.c
@@ -706,6 +706,7 @@ static void add_top_level_items(GeanyDocument *doc)
break;
}
case GEANY_FILETYPES_HASKELL:
+ case GEANY_FILETYPES_LITERATEHASKELL:
tag_list_add_groups(tag_store,
&tv_iters.tag_namespace, _("Module"), NULL,
&tv_iters.tag_type, _("Types"), NULL,
Something went wrong with that request. Please try again.