Skip to content

Commit

Permalink
Support Cangjie (仓颉), issue #803.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Jul 6, 2024
1 parent 31f085d commit 101416e
Show file tree
Hide file tree
Showing 20 changed files with 934 additions and 13 deletions.
2 changes: 2 additions & 0 deletions build/CodeLite/Notepad4.project
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<File Name="../../scintilla/lexers/LexAwk.cxx"/>
<File Name="../../scintilla/lexers/LexBash.cxx"/>
<File Name="../../scintilla/lexers/LexBatch.cxx"/>
<File Name="../../scintilla/lexers/LexCangjie.cxx"/>
<File Name="../../scintilla/lexers/LexCIL.cxx"/>
<File Name="../../scintilla/lexers/LexCMake.cxx"/>
<File Name="../../scintilla/lexers/LexCoffeeScript.cxx"/>
Expand Down Expand Up @@ -212,6 +213,7 @@
<File Name="../../src/EditLexers/stlBash.cpp"/>
<File Name="../../src/EditLexers/stlBatch.cpp"/>
<File Name="../../src/EditLexers/stlBlockdiag.cpp"/>
<File Name="../../src/EditLexers/stlCangjie.cpp"/>
<File Name="../../src/EditLexers/stlCIL.cpp"/>
<File Name="../../src/EditLexers/stlCMake.cpp"/>
<File Name="../../src/EditLexers/stlCoffeeScript.cpp"/>
Expand Down
2 changes: 2 additions & 0 deletions build/VS2017/Notepad4.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@
<ClCompile Include="..\..\scintilla\lexers\LexAwk.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexBash.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexBatch.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexCangjie.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexCIL.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexCMake.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexCoffeeScript.cxx" />
Expand Down Expand Up @@ -614,6 +615,7 @@
<ClCompile Include="..\..\src\EditLexers\stlBash.cpp" />
<ClCompile Include="..\..\src\EditLexers\stlBatch.cpp" />
<ClCompile Include="..\..\src\EditLexers\stlBlockdiag.cpp" />
<ClCompile Include="..\..\src\EditLexers\stlCangjie.cpp" />
<ClCompile Include="..\..\src\EditLexers\stlCIL.cpp" />
<ClCompile Include="..\..\src\EditLexers\stlCMake.cpp" />
<ClCompile Include="..\..\src\EditLexers\stlCoffeeScript.cpp" />
Expand Down
6 changes: 6 additions & 0 deletions build/VS2017/Notepad4.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
<ClCompile Include="..\..\scintilla\lexers\LexBatch.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
<ClCompile Include="..\..\scintilla\lexers\LexCangjie.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
<ClCompile Include="..\..\scintilla\lexers\LexCIL.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
Expand Down Expand Up @@ -450,6 +453,9 @@
<ClCompile Include="..\..\src\EditLexers\stlBlockdiag.cpp">
<Filter>Source Files\EditLexers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\EditLexers\stlCangjie.cpp">
<Filter>Source Files\EditLexers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\EditLexers\stlCIL.cpp">
<Filter>Source Files\EditLexers</Filter>
</ClCompile>
Expand Down
3 changes: 3 additions & 0 deletions doc/FileExt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ blockdiag
diag


Cangjie Source
cj

CIL Assembly
il

Expand Down
5 changes: 5 additions & 0 deletions doc/Notepad4 DarkTheme.ini
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ Operator=fore:#A349A4
Keyword=fore:#00B050
Number=fore:#F84C4C
Operator=fore:#A349A4
[Cangjie Source]
Keyword=fore:#00B050
Type Keyword=fore:#00B050
Number=fore:#F84C4C
Operator=fore:#A349A4
[CIL Assembly]
Keyword=fore:#00B050
Type Keyword=fore:#00B050
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Latest development builds (artifacts in Release configuration for each compiler
* Objective-C/C++, [Screenshots](https://github.com/zufuliu/notepad4/wiki/Screenshots#objective-cc)
* [C Standard Library](tools/lang/C.c), up to C2x.
* [C++ STL](tools/lang/CPP.cpp), up to C++20.
* [Cangjie (仓颉)](tools/lang/Cangjie.cj), up to June 2024.
* [CSS Style Sheet](tools/lang/CSS.css), up to December 2023 snapshot.
* [SCSS Style Sheet](tools/lang/SCSS.scss), up to Dart Sass 1.50.
* [Less Style Sheet](tools/lang/Less.less), up to Less 4.1.
Expand Down
33 changes: 33 additions & 0 deletions scintilla/include/SciLexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
#define SCLEX_ZIG 224
#define SCLEX_MATHEMATICA 225
#define SCLEX_WINHEX 226
#define SCLEX_CANGJIE 227
#define SCLEX_AUTOMATIC 1000
#define SCE_PY_DEFAULT 0
#define SCE_PY_COMMENTLINE 1
Expand Down Expand Up @@ -1864,4 +1865,36 @@
#define SCE_WINHEX_KEYWORD 7
#define SCE_WINHEX_TYPE 8
#define SCE_WINHEX_COMMAND 9
#define SCE_CANGJIE_DEFAULT 0
#define SCE_CANGJIE_COMMENTLINE 1
#define SCE_CANGJIE_COMMENTLINEDOC 2
#define SCE_CANGJIE_COMMENTBLOCK 3
#define SCE_CANGJIE_COMMENTBLOCKDOC 4
#define SCE_CANGJIE_TASKMARKER 5
#define SCE_CANGJIE_NUMBER 6
#define SCE_CANGJIE_IDENTIFIER 7
#define SCE_CANGJIE_IDENTIFIER_BT 8
#define SCE_CANGJIE_MACRO 9
#define SCE_CANGJIE_VARIABLE 10
#define SCE_CANGJIE_STRING_SQ 11
#define SCE_CANGJIE_STRING_DQ 12
#define SCE_CANGJIE_TRIPLE_STRING_SQ 13
#define SCE_CANGJIE_TRIPLE_STRING_DQ 14
#define SCE_CANGJIE_RUNE_SQ 15
#define SCE_CANGJIE_RUNE_DQ 16
#define SCE_CANGJIE_RAWSTRING_SQ 17
#define SCE_CANGJIE_RAWSTRING_DQ 18
#define SCE_CANGJIE_ESCAPECHAR 19
#define SCE_CANGJIE_OPERATOR 20
#define SCE_CANGJIE_OPERATOR2 21
#define SCE_CANGJIE_WORD 22
#define SCE_CANGJIE_WORD2 23
#define SCE_CANGJIE_TYPE 24
#define SCE_CANGJIE_ANNOTATION 25
#define SCE_CANGJIE_CLASS 26
#define SCE_CANGJIE_STRUCT 27
#define SCE_CANGJIE_INTERFACE 28
#define SCE_CANGJIE_ENUM 29
#define SCE_CANGJIE_FUNCTION_DEFINITION 30
#define SCE_CANGJIE_FUNCTION 31
/* --Autogenerated -- end of section automatically generated from SciLexer.iface */
35 changes: 35 additions & 0 deletions scintilla/include/SciLexer.iface
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ val SCLEX_CSV=223
val SCLEX_ZIG=224
val SCLEX_MATHEMATICA=225
val SCLEX_WINHEX=226
val SCLEX_CANGJIE=227

# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
# value assigned in sequence from SCLEX_AUTOMATIC+1.
Expand Down Expand Up @@ -3173,3 +3174,37 @@ val SCE_WINHEX_IDENTIFIER=
val SCE_WINHEX_KEYWORD=
val SCE_WINHEX_TYPE=
val SCE_WINHEX_COMMAND=
# Lexical states for SCLEX_CANGJIE
lex Cangjie=SCLEX_CANGJIE SCE_CANGJIE_
val SCE_CANGJIE_DEFAULT=
val SCE_CANGJIE_COMMENTLINE=
val SCE_CANGJIE_COMMENTLINEDOC=
val SCE_CANGJIE_COMMENTBLOCK=
val SCE_CANGJIE_COMMENTBLOCKDOC=
val SCE_CANGJIE_TASKMARKER=
val SCE_CANGJIE_NUMBER=
val SCE_CANGJIE_IDENTIFIER=
val SCE_CANGJIE_IDENTIFIER_BT=
val SCE_CANGJIE_MACRO=
val SCE_CANGJIE_VARIABLE=
val SCE_CANGJIE_STRING_SQ=11
val SCE_CANGJIE_STRING_DQ=12
val SCE_CANGJIE_TRIPLE_STRING_SQ=13
val SCE_CANGJIE_TRIPLE_STRING_DQ=14
val SCE_CANGJIE_RUNE_SQ=
val SCE_CANGJIE_RUNE_DQ=
val SCE_CANGJIE_RAWSTRING_SQ=
val SCE_CANGJIE_RAWSTRING_DQ=
val SCE_CANGJIE_ESCAPECHAR=
val SCE_CANGJIE_OPERATOR=
val SCE_CANGJIE_OPERATOR2=
val SCE_CANGJIE_WORD=
val SCE_CANGJIE_WORD2=
val SCE_CANGJIE_TYPE=
val SCE_CANGJIE_ANNOTATION=
val SCE_CANGJIE_CLASS=
val SCE_CANGJIE_STRUCT=
val SCE_CANGJIE_INTERFACE=
val SCE_CANGJIE_ENUM=
val SCE_CANGJIE_FUNCTION_DEFINITION=
val SCE_CANGJIE_FUNCTION=
Loading

0 comments on commit 101416e

Please sign in to comment.