[geany/geany] 09e7d8: Haskell filetype improvements and support for Literal Haskell
exbb2
git-noreply at xxxxx
Thu Aug 15 06:16:39 UTC 2013
Branch: refs/heads/master
Author: exbb2 <kudahkukarek at gmail.com>
Committer: Matthew Brush <matt at geany.org>
Date: Thu, 15 Aug 2013 06:16:39 UTC
Commit: 09e7d8398fd168fd0aabfd908ffbdf429d7fc53e
https://github.com/geany/geany/commit/09e7d8398fd168fd0aabfd908ffbdf429d7fc53e
Log Message:
-----------
Haskell filetype improvements and support for Literal Haskell
Closes #155 and also closes #139
Modified Paths:
--------------
data/filetype_extensions.conf
data/filetypes.haskell
src/editor.c
src/highlighting.c
src/highlightingmappings.h
Modified: data/filetype_extensions.conf
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -30,7 +30,7 @@ FreeBasic=*.bas;*.bi;
Genie=*.gs;
GLSL=*.glsl;*.frag;*.vert;
Go=*.go;
-Haskell=*.hs;*.lhs;
+Haskell=*.hs;*.lhs;*.hs-boot;*.lhs-boot;
Haxe=*.hx;
HTML=*.htm;*.html;*.shtml;*.hta;*.htd;*.htt;*.cfm;
Java=*.java;*.jsp;
Modified: data/filetypes.haskell
20 files changed, 15 insertions(+), 5 deletions(-)
===================================================================
@@ -6,8 +6,11 @@ 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
@@ -15,20 +18,27 @@ class=class
operator=operator
identifier=identifier_1
instance=type
-capital=string_2
+capital=type
module=function
data=number_2
pragma=preprocessor
preprocessor=preprocessor
stringeol=string_eol
-reserved_operator=operator
-literate_comment=comment
-literate_codedelim=other
[keywords]
# all items must be in one line
-keywords=as case class data deriving do else if import in infixl infixr instance let module of primitive qualified then type where
+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
Modified: src/editor.c
4 files changed, 3 insertions(+), 1 deletions(-)
===================================================================
@@ -2900,7 +2900,9 @@ static gint get_multiline_comment_style(GeanyEditor *editor, gint line_start)
style_comment = SCE_H_COMMENT;
break;
}
- case SCLEX_HASKELL: style_comment = SCE_HA_COMMENTBLOCK; break;
+ case SCLEX_HASKELL:
+ case SCLEX_LITERATEHASKELL:
+ style_comment = SCE_HA_COMMENTBLOCK; break;
case SCLEX_LUA: style_comment = SCE_LUA_COMMENT; break;
case SCLEX_CSS: style_comment = SCE_CSS_COMMENT; break;
case SCLEX_SQL: style_comment = SCE_SQL_COMMENT; break;
Modified: src/highlighting.c
11 files changed, 9 insertions(+), 2 deletions(-)
===================================================================
@@ -1511,6 +1511,7 @@ gboolean highlighting_is_string_style(gint lexer, gint style)
style == SCE_LUA_STRING);
case SCLEX_HASKELL:
+ case SCLEX_LITERATEHASKELL:
return (style == SCE_HA_CHARACTER ||
style == SCE_HA_STRINGEOL ||
style == SCE_HA_STRING);
@@ -1671,11 +1672,13 @@ gboolean highlighting_is_comment_style(gint lexer, gint style)
style == SCE_LUA_COMMENTDOC);
case SCLEX_HASKELL:
+ case SCLEX_LITERATEHASKELL:
return (style == SCE_HA_COMMENTLINE ||
style == SCE_HA_COMMENTBLOCK ||
style == SCE_HA_COMMENTBLOCK2 ||
style == SCE_HA_COMMENTBLOCK3 ||
- style == SCE_HA_LITERATE_COMMENT);
+ style == SCE_HA_LITERATE_COMMENT ||
+ style == SCE_HA_LITERATE_CODEDELIM);
case SCLEX_FREEBASIC:
return (style == SCE_B_COMMENT);
@@ -1737,14 +1740,18 @@ gboolean highlighting_is_code_style(gint lexer, gint style)
switch (lexer)
{
case SCLEX_CPP:
+ {
if (style == SCE_C_PREPROCESSOR)
return FALSE;
break;
-
+ }
case SCLEX_HASKELL:
+ case SCLEX_LITERATEHASKELL:
+ {
if (style == SCE_HA_PREPROCESSOR)
return FALSE;
break;
+ }
}
return !(highlighting_is_comment_style(lexer, style) ||
highlighting_is_string_style(lexer, style));
Modified: src/highlightingmappings.h
4 files changed, 3 insertions(+), 1 deletions(-)
===================================================================
@@ -642,7 +642,9 @@
};
static const HLKeyword highlighting_keywords_HASKELL[] =
{
- { 0, "keywords", FALSE }
+ { 0, "keywords", FALSE },
+ { 1, "ffi", FALSE },
+ { 2, "reserved_operators", FALSE }
};
#define highlighting_properties_HASKELL EMPTY_PROPERTIES
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Commits
mailing list