Skip to content

Commit

Permalink
Support CoffeeScript, issue #19.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Jul 25, 2021
1 parent c5e1416 commit b941007
Show file tree
Hide file tree
Showing 20 changed files with 695 additions and 46 deletions.
2 changes: 2 additions & 0 deletions build/CodeLite/Notepad2.project
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<File Name="../../scintilla/lexers/LexBatch.cxx"/>
<File Name="../../scintilla/lexers/LexCIL.cxx"/>
<File Name="../../scintilla/lexers/LexCMake.cxx"/>
<File Name="../../scintilla/lexers/LexCoffeeScript.cxx"/>
<File Name="../../scintilla/lexers/LexConfig.cxx"/>
<File Name="../../scintilla/lexers/LexCPP.cxx"/>
<File Name="../../scintilla/lexers/LexCSS.cxx"/>
Expand Down Expand Up @@ -192,6 +193,7 @@
<File Name="../../src/EditLexers/stlBatch.c"/>
<File Name="../../src/EditLexers/stlCIL.c"/>
<File Name="../../src/EditLexers/stlCMake.c"/>
<File Name="../../src/EditLexers/stlCoffeeScript.c"/>
<File Name="../../src/EditLexers/stlCPP.c"/>
<File Name="../../src/EditLexers/stlCSharp.c"/>
<File Name="../../src/EditLexers/stlCSS.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 @@ -984,6 +984,7 @@
<ClCompile Include="..\..\scintilla\lexers\LexBatch.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexCIL.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexCMake.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexCoffeeScript.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexConfig.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexCPP.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexCSS.cxx" />
Expand Down Expand Up @@ -1096,6 +1097,7 @@
<ClCompile Include="..\..\src\EditLexers\stlBatch.c" />
<ClCompile Include="..\..\src\EditLexers\stlCIL.c" />
<ClCompile Include="..\..\src\EditLexers\stlCMake.c" />
<ClCompile Include="..\..\src\EditLexers\stlCoffeeScript.c" />
<ClCompile Include="..\..\src\EditLexers\stlCPP.c" />
<ClCompile Include="..\..\src\EditLexers\stlCSharp.c" />
<ClCompile Include="..\..\src\EditLexers\stlCSS.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 @@ -63,6 +63,9 @@
<ClCompile Include="..\..\scintilla\lexers\LexCMake.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
<ClCompile Include="..\..\scintilla\lexers\LexCoffeeScript.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
<ClCompile Include="..\..\scintilla\lexers\LexConfig.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
Expand Down Expand Up @@ -399,6 +402,9 @@
<ClCompile Include="..\..\src\EditLexers\stlCMake.c">
<Filter>Source Files\EditLexers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\EditLexers\stlCoffeeScript.c">
<Filter>Source Files\EditLexers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\EditLexers\stlCPP.c">
<Filter>Source Files\EditLexers</Filter>
</ClCompile>
Expand Down
7 changes: 7 additions & 0 deletions doc/FileExt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ CMake Script
*.cmake.in
*.ctest.in

CoffeeScript
coffee
cjsx CoffeeScript with JSX
cson https://github.com/bevry/cson

Cakefile

Config File
conf
cfg
Expand Down
Binary file modified doc/Notepad2 DarkTheme.ini
Binary file not shown.
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Latest development builds (artifacts in Release configuration for each compiler
* Less CSS
* HSS
* [CMake](../master/tools/lang/CMake.cmake), up to CMake 3.20. [Screenshots](https://github.com/zufuliu/notepad2/wiki/Screenshots#cmake)
* [CoffeeScript](../master/tools/lang/CoffeeScript.coffee), CoffeeScript 2.5.
* Common Intermediate Language
* Configuration / Properties File
* Apache Configuration File
Expand Down
30 changes: 30 additions & 0 deletions scintilla/include/SciLexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,36 @@
#define SCE_PAS_TYPE 15
#define SCE_PAS_FUNCTION1 16
#define SCE_PAS_FUNCTION 17
#define SCE_COFFEESCRIPT_DEFAULT 0
#define SCE_COFFEESCRIPT_COMMENTLINE 1
#define SCE_COFFEESCRIPT_COMMENTBLOCK 2
#define SCE_COFFEESCRIPT_TASKMARKER 3
#define SCE_COFFEESCRIPT_NUMBER 4
#define SCE_COFFEESCRIPT_IDENTIFIER 5
#define SCE_COFFEESCRIPT_PROPERTY_AT 6
#define SCE_COFFEESCRIPT_XML_TAG 7
#define SCE_COFFEESCRIPT_XML_ATTRIBUTE 8
#define SCE_COFFEESCRIPT_OPERATOR 9
#define SCE_COFFEESCRIPT_OPERATOR2 10
#define SCE_COFFEESCRIPT_OPERATOR_PF 11
#define SCE_COFFEESCRIPT_STRING_SQ 12
#define SCE_COFFEESCRIPT_XML_STRING_SQ 13
#define SCE_COFFEESCRIPT_TRIPLE_STRING_SQ 14
#define SCE_COFFEESCRIPT_STRING_DQ 15
#define SCE_COFFEESCRIPT_XML_STRING_DQ 16
#define SCE_COFFEESCRIPT_TRIPLE_STRING_DQ 17
#define SCE_COFFEESCRIPT_BACKTICKS 18
#define SCE_COFFEESCRIPT_TRIPLE_BACKTICKS 19
#define SCE_COFFEESCRIPT_ESCAPECHAR 20
#define SCE_COFFEESCRIPT_REGEX 21
#define SCE_COFFEESCRIPT_TRIPLE_REGEX 22
#define SCE_COFFEESCRIPT_REGEX_COMMENT 23
#define SCE_COFFEESCRIPT_XML_TEXT 24
#define SCE_COFFEESCRIPT_WORD 25
#define SCE_COFFEESCRIPT_WORD2 26
#define SCE_COFFEESCRIPT_DIRECTIVE 27
#define SCE_COFFEESCRIPT_CLASS 28
#define SCE_COFFEESCRIPT_PROPERTY 29
#define SCE_AVS_DEFAULT 0
#define SCE_AVS_COMMENTBLOCK 1
#define SCE_AVS_COMMENTBLOCKN 2
Expand Down
58 changes: 31 additions & 27 deletions scintilla/include/SciLexer.iface
Original file line number Diff line number Diff line change
Expand Up @@ -2031,33 +2031,37 @@ val SCE_PAS_FUNCTION=17
#val SCE_MODULA_OPERATOR=16
#val SCE_MODULA_BADSTR=17
# Lexical states for SCLEX_COFFEESCRIPT
#lex CoffeeScript=SCLEX_COFFEESCRIPT SCE_COFFEESCRIPT_
#val SCE_COFFEESCRIPT_DEFAULT=0
#val SCE_COFFEESCRIPT_COMMENT=1
#val SCE_COFFEESCRIPT_COMMENTLINE=2
#val SCE_COFFEESCRIPT_COMMENTDOC=3
#val SCE_COFFEESCRIPT_NUMBER=4
#val SCE_COFFEESCRIPT_WORD=5
#val SCE_COFFEESCRIPT_STRING=6
#val SCE_COFFEESCRIPT_CHARACTER=7
#val SCE_COFFEESCRIPT_UUID=8
#val SCE_COFFEESCRIPT_PREPROCESSOR=9
#val SCE_COFFEESCRIPT_OPERATOR=10
#val SCE_COFFEESCRIPT_IDENTIFIER=11
#val SCE_COFFEESCRIPT_STRINGEOL=12
#val SCE_COFFEESCRIPT_VERBATIM=13
#val SCE_COFFEESCRIPT_REGEX=14
#val SCE_COFFEESCRIPT_COMMENTLINEDOC=15
#val SCE_COFFEESCRIPT_WORD2=16
#val SCE_COFFEESCRIPT_COMMENTDOCKEYWORD=17
#val SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR=18
#val SCE_COFFEESCRIPT_GLOBALCLASS=19
#val SCE_COFFEESCRIPT_STRINGRAW=20
#val SCE_COFFEESCRIPT_TRIPLEVERBATIM=21
#val SCE_COFFEESCRIPT_COMMENTBLOCK=22
#val SCE_COFFEESCRIPT_VERBOSE_REGEX=23
#val SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT=24
#val SCE_COFFEESCRIPT_INSTANCEPROPERTY=25
lex CoffeeScript=SCLEX_COFFEESCRIPT SCE_COFFEESCRIPT_
val SCE_COFFEESCRIPT_DEFAULT=0
val SCE_COFFEESCRIPT_COMMENTLINE=1
val SCE_COFFEESCRIPT_COMMENTBLOCK=2
val SCE_COFFEESCRIPT_TASKMARKER=3
val SCE_COFFEESCRIPT_NUMBER=4
val SCE_COFFEESCRIPT_IDENTIFIER=5
val SCE_COFFEESCRIPT_PROPERTY_AT=6
val SCE_COFFEESCRIPT_XML_TAG=7
val SCE_COFFEESCRIPT_XML_ATTRIBUTE=8
val SCE_COFFEESCRIPT_OPERATOR=9
val SCE_COFFEESCRIPT_OPERATOR2=10
val SCE_COFFEESCRIPT_OPERATOR_PF=11
val SCE_COFFEESCRIPT_STRING_SQ=12
val SCE_COFFEESCRIPT_XML_STRING_SQ=13
val SCE_COFFEESCRIPT_TRIPLE_STRING_SQ=14
val SCE_COFFEESCRIPT_STRING_DQ=15
val SCE_COFFEESCRIPT_XML_STRING_DQ=16
val SCE_COFFEESCRIPT_TRIPLE_STRING_DQ=17
val SCE_COFFEESCRIPT_BACKTICKS=18
val SCE_COFFEESCRIPT_TRIPLE_BACKTICKS=19
val SCE_COFFEESCRIPT_ESCAPECHAR=20
val SCE_COFFEESCRIPT_REGEX=21
val SCE_COFFEESCRIPT_TRIPLE_REGEX=22
val SCE_COFFEESCRIPT_REGEX_COMMENT=23
val SCE_COFFEESCRIPT_XML_TEXT=24
val SCE_COFFEESCRIPT_WORD=25
val SCE_COFFEESCRIPT_WORD2=26
val SCE_COFFEESCRIPT_DIRECTIVE=27
val SCE_COFFEESCRIPT_CLASS=28
val SCE_COFFEESCRIPT_PROPERTY=29
# Lexical states for SCLEX_AVS
lex AVS=SCLEX_AVS SCE_AVS_
val SCE_AVS_DEFAULT=0
Expand Down
Loading

0 comments on commit b941007

Please sign in to comment.