Skip to content

Commit

Permalink
Support Haskell, issue #29.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Jul 15, 2023
1 parent a18ee09 commit ae3af1b
Show file tree
Hide file tree
Showing 17 changed files with 479 additions and 29 deletions.
2 changes: 2 additions & 0 deletions build/CodeLite/Notepad2.project
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<File Name="../../scintilla/lexers/LexGo.cxx"/>
<File Name="../../scintilla/lexers/LexGraphViz.cxx"/>
<File Name="../../scintilla/lexers/LexGroovy.cxx"/>
<File Name="../../scintilla/lexers/LexHaskell.cxx"/>
<File Name="../../scintilla/lexers/LexHaxe.cxx"/>
<File Name="../../scintilla/lexers/LexHTML.cxx"/>
<File Name="../../scintilla/lexers/LexInno.cxx"/>
Expand Down Expand Up @@ -223,6 +224,7 @@
<File Name="../../src/EditLexers/stlGradle.c"/>
<File Name="../../src/EditLexers/stlGraphViz.c"/>
<File Name="../../src/EditLexers/stlGroovy.c"/>
<File Name="../../src/EditLexers/stlHaskell.c"/>
<File Name="../../src/EditLexers/stlHaxe.c"/>
<File Name="../../src/EditLexers/stlHTML.c"/>
<File Name="../../src/EditLexers/stlInno.c"/>
Expand Down
2 changes: 2 additions & 0 deletions build/VS2017/Notepad2.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@
<ClCompile Include="..\..\scintilla\lexers\LexGo.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexGraphViz.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexGroovy.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexHaskell.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexHaxe.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexHTML.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexInno.cxx" />
Expand Down Expand Up @@ -626,6 +627,7 @@
<ClCompile Include="..\..\src\EditLexers\stlGradle.c" />
<ClCompile Include="..\..\src\EditLexers\stlGraphViz.c" />
<ClCompile Include="..\..\src\EditLexers\stlGroovy.c" />
<ClCompile Include="..\..\src\EditLexers\stlHaskell.c" />
<ClCompile Include="..\..\src\EditLexers\stlHaxe.c" />
<ClCompile Include="..\..\src\EditLexers\stlHTML.c" />
<ClCompile Include="..\..\src\EditLexers\stlInno.c" />
Expand Down
6 changes: 6 additions & 0 deletions build/VS2017/Notepad2.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
<ClCompile Include="..\..\scintilla\lexers\LexGroovy.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
<ClCompile Include="..\..\scintilla\lexers\LexHaskell.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
<ClCompile Include="..\..\scintilla\lexers\LexHaxe.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
Expand Down Expand Up @@ -486,6 +489,9 @@
<ClCompile Include="..\..\src\EditLexers\stlGroovy.c">
<Filter>Source Files\EditLexers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\EditLexers\stlHaskell.c">
<Filter>Source Files\EditLexers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\EditLexers\stlHaxe.c">
<Filter>Source Files\EditLexers</Filter>
</ClCompile>
Expand Down
4 changes: 4 additions & 0 deletions doc/FileExt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ Groovy Script
grunit GrUnit


Haskell Source
hs
lhs Literate Haskell

Haxe Script
hx

Expand Down
3 changes: 3 additions & 0 deletions doc/Notepad2 DarkTheme.ini
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ Regex=fore:#006633; back:#0F405D; eolfilled
Label=back:#404030
Number=fore:#F84C4C
Operator=fore:#A349A4
[Haskell Source]
Number=fore:#F84C4C
Operator=fore:#A349A4
[Haxe Script]
Keyword=fore:#00B050
Constant=fore:#A349A4
Expand Down
15 changes: 15 additions & 0 deletions scintilla/include/SciLexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#define SCLEX_BASH 62
#define SCLEX_VHDL 64
#define SCLEX_OCAML 65
#define SCLEX_HASKELL 68
#define SCLEX_PHPSCRIPT 69
#define SCLEX_REBOL 71
#define SCLEX_INNOSETUP 76
Expand Down Expand Up @@ -818,6 +819,20 @@
#define SCE_OCAML_FORMAT_SPECIFIER 12
#define SCE_OCAML_KEYWORD 13
#define SCE_OCAML_TYPE 14
#define SCE_HA_DEFAULT 0
#define SCE_HA_COMMENTLINE 1
#define SCE_HA_COMMENTBLOCK 2
#define SCE_HA_NUMBER 3
#define SCE_HA_OPERATOR 4
#define SCE_HA_PRAGMA 5
#define SCE_HA_CHARACTER 6
#define SCE_HA_STRING 7
#define SCE_HA_ESCAPECHAR 8
#define SCE_HA_PREPROCESSOR 9
#define SCE_HA_IDENTIFIER 10
#define SCE_HA_KEYWORD 11
#define SCE_HA_MODULE 12
#define SCE_HA_CLASS 13
#define SCE_REBOL_DEFAULT 0
#define SCE_REBOL_COMMENTLINE 1
#define SCE_REBOL_COMMENTBLOCK 2
Expand Down
41 changes: 16 additions & 25 deletions scintilla/include/SciLexer.iface
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ val SCLEX_VHDL=64
val SCLEX_OCAML=65
#val SCLEX_BLITZBASIC=66
#val SCLEX_PUREBASIC=67
#val SCLEX_HASKELL=68
val SCLEX_HASKELL=68
val SCLEX_PHPSCRIPT=69
#val SCLEX_TADS3=70
val SCLEX_REBOL=71
Expand Down Expand Up @@ -1444,30 +1444,21 @@ val SCE_OCAML_FORMAT_SPECIFIER=
val SCE_OCAML_KEYWORD=
val SCE_OCAML_TYPE=
# Lexical states for SCLEX_HASKELL
#lex Haskell=SCLEX_HASKELL SCE_HA_
#val SCE_HA_DEFAULT=0
#val SCE_HA_IDENTIFIER=1
#val SCE_HA_KEYWORD=2
#val SCE_HA_NUMBER=3
#val SCE_HA_STRING=4
#val SCE_HA_CHARACTER=5
#val SCE_HA_CLASS=6
#val SCE_HA_MODULE=7
#val SCE_HA_CAPITAL=8
#val SCE_HA_DATA=9
#val SCE_HA_IMPORT=10
#val SCE_HA_OPERATOR=11
#val SCE_HA_INSTANCE=12
#val SCE_HA_COMMENTLINE=13
#val SCE_HA_COMMENTBLOCK=14
#val SCE_HA_COMMENTBLOCK2=15
#val SCE_HA_COMMENTBLOCK3=16
#val SCE_HA_PRAGMA=17
#val SCE_HA_PREPROCESSOR=18
#val SCE_HA_STRINGEOL=19
#val SCE_HA_RESERVED_OPERATOR=20
#val SCE_HA_LITERATE_COMMENT=21
#val SCE_HA_LITERATE_CODEDELIM=22
lex Haskell=SCLEX_HASKELL SCE_HA_
val SCE_HA_DEFAULT=
val SCE_HA_COMMENTLINE=
val SCE_HA_COMMENTBLOCK=
val SCE_HA_NUMBER=
val SCE_HA_OPERATOR=
val SCE_HA_PRAGMA=
val SCE_HA_CHARACTER=
val SCE_HA_STRING=
val SCE_HA_ESCAPECHAR=
val SCE_HA_PREPROCESSOR=
val SCE_HA_IDENTIFIER=
val SCE_HA_KEYWORD=
val SCE_HA_MODULE=
val SCE_HA_CLASS=
# Lexical states of SCLEX_TADS3
#lex TADS3=SCLEX_TADS3 SCE_T3_
#val SCE_T3_DEFAULT=0
Expand Down
Loading

0 comments on commit ae3af1b

Please sign in to comment.