Skip to content

Commit

Permalink
Add standalone lexer for (GNU) AWK.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Feb 16, 2021
1 parent 9a1d6e8 commit ea41ff9
Show file tree
Hide file tree
Showing 18 changed files with 768 additions and 155 deletions.
1 change: 1 addition & 0 deletions build/CodeLite/Notepad2.project
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<File Name="../../scintilla/lexers/LexAsm.cxx"/>
<File Name="../../scintilla/lexers/LexAutoIt3.cxx"/>
<File Name="../../scintilla/lexers/LexAviSynth.cxx"/>
<File Name="../../scintilla/lexers/LexAwk.cxx"/>
<File Name="../../scintilla/lexers/LexBash.cxx"/>
<File Name="../../scintilla/lexers/LexBatch.cxx"/>
<File Name="../../scintilla/lexers/LexCIL.cxx"/>
Expand Down
1 change: 1 addition & 0 deletions build/VS2017/Notepad2.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,7 @@
<ClCompile Include="..\..\scintilla\lexers\LexAPDL.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexAutoIt3.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexAviSynth.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexAwk.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexBash.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexBatch.cxx" />
<ClCompile Include="..\..\scintilla\lexers\LexCIL.cxx" />
Expand Down
3 changes: 3 additions & 0 deletions build/VS2017/Notepad2.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
<ClCompile Include="..\..\scintilla\lexers\LexAviSynth.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
<ClCompile Include="..\..\scintilla\lexers\LexAwk.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
<ClCompile Include="..\..\scintilla\lexers\LexBash.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Latest development builds (artifacts in Release configuration for each compiler
* Asymptote Vector Graphics Language
* AutoIt Script
* [AviSynth Script](../master/tools/lang/AviSynth.avs), up to AviSynth 2.6, AviSynth+ 3.6, GScript 1.1.
* AWK, GNU AWK
* [AWK](../master/tools/lang/Awk.awk), up to GNU AWK 5.1.
* Batch Script, [Screenshots](https://github.com/zufuliu/notepad2/wiki/Screenshots#batch)
* C#, Vala, [Screenshots](https://github.com/zufuliu/notepad2/wiki/Screenshots#c)
* C/C++, [Screenshots](https://github.com/zufuliu/notepad2/wiki/Screenshots#cc)
Expand Down
18 changes: 18 additions & 0 deletions scintilla/include/SciLexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
#define SCLEX_HAXE 219
#define SCLEX_GROOVY 220
#define SCLEX_JAM 221
#define SCLEX_AWK 222
#define SCLEX_AUTOMATIC 1000
#define SCE_PY_DEFAULT 0
#define SCE_PY_COMMENTLINE 1
Expand Down Expand Up @@ -1324,4 +1325,21 @@
#define SCE_JAM_CLASS 12
#define SCE_JAM_RULE 13
#define SCE_JAM_CONSTANT 14
#define SCE_AWK_DEFAULT 0
#define SCE_AWK_COMMENTLINE 1
#define SCE_AWK_TASKMARKER 2
#define SCE_AWK_OPERATOR 3
#define SCE_AWK_OPERATOR_PF 4
#define SCE_AWK_NUMBER 5
#define SCE_AWK_STRING 6
#define SCE_AWK_ESCAPECHAR 7
#define SCE_AWK_FORMAT_SPECIFIER 8
#define SCE_AWK_REGEX 9
#define SCE_AWK_IDENTIFIER 10
#define SCE_AWK_VARIABLE 11
#define SCE_AWK_WORD 12
#define SCE_AWK_BUILTIN_VARIABLE 13
#define SCE_AWK_BUILTIN_FUNCTION 14
#define SCE_AWK_FUNCTION_DEFINE 15
#define SCE_AWK_FUNCTION 16
/* --Autogenerated -- end of section automatically generated from SciLexer.iface */
20 changes: 20 additions & 0 deletions scintilla/include/SciLexer.iface
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ val SCLEX_SWIFT=218
val SCLEX_HAXE=219
val SCLEX_GROOVY=220
val SCLEX_JAM=221
val SCLEX_AWK=222

# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
# value assigned in sequence from SCLEX_AUTOMATIC+1.
Expand Down Expand Up @@ -2855,3 +2856,22 @@ val SCE_JAM_MODULE=11
val SCE_JAM_CLASS=12
val SCE_JAM_RULE=13
val SCE_JAM_CONSTANT=14
# Lexical states for SCLEX_AWK
lex Awk=SCLEX_AWK SCE_AWK_
val SCE_AWK_DEFAULT=0
val SCE_AWK_COMMENTLINE=1
val SCE_AWK_TASKMARKER=2
val SCE_AWK_OPERATOR=3
val SCE_AWK_OPERATOR_PF=4
val SCE_AWK_NUMBER=5
val SCE_AWK_STRING=6
val SCE_AWK_ESCAPECHAR=7
val SCE_AWK_FORMAT_SPECIFIER=8
val SCE_AWK_REGEX=9
val SCE_AWK_IDENTIFIER=10
val SCE_AWK_VARIABLE=11
val SCE_AWK_WORD=12
val SCE_AWK_BUILTIN_VARIABLE=13
val SCE_AWK_BUILTIN_FUNCTION=14
val SCE_AWK_FUNCTION_DEFINE=15
val SCE_AWK_FUNCTION=16
Loading

0 comments on commit ea41ff9

Please sign in to comment.