Skip to content

Commit

Permalink
#41 Add GDScript support
Browse files Browse the repository at this point in the history
Heavily borrowed from the python lexer because GDScript is heavily inspired by python.
  • Loading branch information
Davidy22 authored and nyamatongwe committed Nov 27, 2021
1 parent c1b7057 commit a77d85a
Show file tree
Hide file tree
Showing 14 changed files with 946 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cppcheck.suppress
Expand Up @@ -41,6 +41,7 @@ knownConditionTrueFalse:lexilla/lexers/LexEScript.cxx
constParameter:lexilla/lexers/LexFortran.cxx
redundantCondition:lexilla/lexers/LexFSharp.cxx
knownConditionTrueFalse:lexilla/lexers/LexFSharp.cxx
constParameter:lexilla/lexers/LexGDScript.cxx
variableScope:lexilla/lexers/LexGui4Cli.cxx
constParameter:lexilla/lexers/LexHaskell.cxx
constParameter:lexilla/lexers/LexHex.cxx
Expand Down Expand Up @@ -105,6 +106,7 @@ knownConditionTrueFalse:lexilla/lexers/LexYAML.cxx
// These are due to Accessor::IndentAmount not declaring the callback as taking a const.
// Changing this could cause problems for downstream projects.
constParameterCallback:lexilla/lexers/LexEiffel.cxx
constParameterCallback:lexilla/lexers/LexGDScript.cxx
constParameterCallback:lexilla/lexers/LexPython.cxx
constParameterCallback:lexilla/lexers/LexScriptol.cxx
constParameterCallback:lexilla/lexers/LexVB.cxx
Expand Down
6 changes: 6 additions & 0 deletions doc/LexillaHistory.html
Expand Up @@ -573,6 +573,7 @@ <h2>Contributors</h2>
</tr><tr>
<td>Michael Heath</td>
<td>Antonio Cebrián</td>
<td>David Yu Yang</td>
</tr>
</table>
<h2>Releases</h2>
Expand All @@ -588,6 +589,11 @@ <h3>
<a href="https://github.com/ScintillaOrg/lexilla/pull/39">Pull request #39</a>.
</li>
<li>
Add provisional GDScript lexer.
Some behaviour and lexical states may change before this lexer is stable.
<a href="https://github.com/ScintillaOrg/lexilla/pull/41">Pull request #41</a>.
</li>
<li>
Fix strings ending in escaped '\' in F#.
<a href="https://github.com/ScintillaOrg/lexilla/issues/38">Issue #38</a>,
</li>
Expand Down
3 changes: 2 additions & 1 deletion include/LexicalStyles.iface
Expand Up @@ -143,13 +143,15 @@ val SCLEX_RAKU=131
val SCLEX_FSHARP=132
val SCLEX_JULIA=133
val SCLEX_ASCIIDOC=134
val SCLEX_GDSCRIPT=135

# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
# value assigned in sequence from SCLEX_AUTOMATIC+1.
val SCLEX_AUTOMATIC=1000
# Lexical states for SCLEX_PYTHON
lex Python=SCLEX_PYTHON SCE_P_
lex Nimrod=SCLEX_NIMROD SCE_P_
lex GDScript=SCLEX_GDSCRIPT SCE_P_
val SCE_P_DEFAULT=0
val SCE_P_COMMENTLINE=1
val SCE_P_NUMBER=2
Expand Down Expand Up @@ -2277,4 +2279,3 @@ val SCE_ASCIIDOC_LITERALBK=20
val SCE_ASCIIDOC_ATTRIB=21
val SCE_ASCIIDOC_ATTRIBVAL=22
val SCE_ASCIIDOC_MACRO=23

1 change: 1 addition & 0 deletions include/SciLexer.h
Expand Up @@ -147,6 +147,7 @@
#define SCLEX_FSHARP 132
#define SCLEX_JULIA 133
#define SCLEX_ASCIIDOC 134
#define SCLEX_GDSCRIPT 135
#define SCLEX_AUTOMATIC 1000
#define SCE_P_DEFAULT 0
#define SCE_P_COMMENTLINE 1
Expand Down

0 comments on commit a77d85a

Please sign in to comment.