Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Haskell filetype fixes #155

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

exbb2 commented Jul 21, 2013

I suppose (hope) that my previous pull requests were ignored simply due to lack of description and clarification on the changes. I'll comment in the diff.

@exbb2 exbb2 commented on the diff Jul 21, 2013

data/filetype_extensions.conf
@@ -29,7 +29,7 @@ FreeBasic=*.bas;*.bi;
Genie=*.gs;
GLSL=*.glsl;*.frag;*.vert;
Go=*.go;
-Haskell=*.hs;*.lhs;
+Haskell=*.hs;*.lhs;*.hs-boot;*.lhs-boot;

@exbb2 exbb2 commented on the diff Jul 21, 2013

data/filetypes.haskell
@@ -6,8 +6,11 @@ commentline=comment_line
commentblock=comment
commentblock2=comment
commentblock3=comment
+literate_comment=comment
+literate_codedelim=preprocessor
@exbb2

exbb2 Jul 21, 2013

Contributor

literate_codedelim is a style for delimiters between literate comments and code blocks in Literate Haskell source code. Since unlit is just a preprocessor, it makes sense to highlight its syntax as such. Compare to #if/#endif.

@exbb2 exbb2 commented on the diff Jul 21, 2013

data/filetypes.haskell
number=number_1
keyword=keyword_1
+reserved_operator=keyword_1
@exbb2

exbb2 Jul 21, 2013

Contributor

Reserved operators are (symbolic) keywords and should be highlighted as such.

@exbb2 exbb2 commented on the diff Jul 21, 2013

data/filetypes.haskell
@@ -15,20 +18,27 @@ class=class
operator=operator
identifier=identifier_1
instance=type
-capital=string_2
+capital=type
@exbb2

exbb2 Jul 21, 2013

Contributor

capital style DOES NOT refer to any kind of literal, for some reason, originally haskell lexer colors all identifiers starting with capital letter (types, kinds, constructors), and now operators starting with a colon, in this style. data, class, type and instance styles are completely unused (and instance style doesn't even make sense since instances are anonymous).

@exbb2 exbb2 commented on the diff Jul 21, 2013

data/filetypes.haskell
[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
@exbb2

exbb2 Jul 21, 2013

Contributor

http://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-180002.4
http://www.haskell.org/haskellwiki/Keywords
proc, rec and mdo are not included, they are a part of rather obscure extensions.

@exbb2

exbb2 Jul 22, 2013

Contributor

qualified, as, hiding and family are not included, since they are not reserved words and lexer highlights them by itself.

@exbb2 exbb2 commented on the diff Jul 21, 2013

data/filetypes.haskell
[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

@exbb2 exbb2 commented on the diff Jul 21, 2013

data/filetypes.haskell
[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=-> .. :: <- = => @ \ | ~ ← → ∀ ∷ ★
@exbb2

exbb2 Jul 22, 2013

Contributor

← → ∀ ∷ ★

Haskell lexer highlights Unicode operators and identifiers since 3.3.4.

@exbb2 exbb2 commented on the diff Jul 21, 2013

data/filetypes.haskell
+[lexer_properties]
@exbb2

exbb2 Jul 21, 2013

Contributor

Default lexer configuration listed in the config for accessibility.
https://sourceforge.net/p/scintilla/code/ci/default/tree/lexers/LexHaskell.cxx#l207

Owner

codebrainz commented Jul 21, 2013

Does this supersede PR #139? It looks not to have some highlighting.c stuff like this. Which one of the pull requests should get merged (and could you close the other one)?

Contributor

exbb2 commented Jul 21, 2013

@codebrainz
Yes it does. The other one added Literate Haskell filetype, though it was implemented as an alias for haskell filetype which led to new literate haskell files being saved with an .hs extension.
This one mostly fixes plain haskell's filetype, though it adds some stuff for literate haskell lexer where makes sense.

Owner

codebrainz commented Aug 15, 2013

I really have no clue about Haskell so I'll leave it to the contributor and the Haskell users to point out any issues. The C source code changes look ok and built and ran fine on Xubuntu 13.04.

@exbb2 Thanks a lot, sorry it took so long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment