Skip to content

Commit

Permalink
Add D syntax highlighting. (#1042)
Browse files Browse the repository at this point in the history
* Small Fix.
Fixed C#(Java, JavaScript) keyword highlighting.

* Add D syntax highlighting.

* Improved D syntax highlighting.
(Supports nested comments)

* Improved D syntax highlighting.
(Supports string literals)

* Fixed blank line handling.
  • Loading branch information
devmynote authored Nov 10, 2021
1 parent 3ea1708 commit f467537
Show file tree
Hide file tree
Showing 10 changed files with 586 additions and 33 deletions.
1 change: 1 addition & 0 deletions Externals/crystaledit/editlib/editlib.vcxitems
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<ClCompile Include="$(MSBuildThisFileDirectory)parsers\csharp.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)parsers\css.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)parsers\dcl.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)parsers\dlang.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)parsers\fortran.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)parsers\go.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)parsers\html.cpp" />
Expand Down
3 changes: 3 additions & 0 deletions Externals/crystaledit/editlib/editlib.vcxitems.filters
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@
<ClCompile Include="$(MSBuildThisFileDirectory)parsers\dcl.cpp">
<Filter>Parsers\Source Files</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)parsers\dlang.cpp">
<Filter>Parsers\Source Files</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)parsers\fortran.cpp">
<Filter>Parsers\Source Files</Filter>
</ClCompile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ TextDefinition m_SourceDefs[] =
SRC_CSHARP, _T ("C#"), _T ("cs"), &ParseLineCSharp, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
SRC_CSS, _T ("CSS"), _T ("css"), &ParseLineCss, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T (""), (DWORD)-1,
SRC_DCL, _T ("DCL"), _T ("dcl;dcc"), &ParseLineDcl, SRCOPT_AUTOINDENT|SRCOPT_BRACEGNU, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
SRC_DLANG, _T ("D"), _T ("d;di"), &ParseLineDlang, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
SRC_FORTRAN, _T ("Fortran"), _T ("f;f90;f9p;fpp;for;f77"), &ParseLineFortran, SRCOPT_INSERTTABS|SRCOPT_AUTOINDENT, /*8,*/ _T (""), _T (""), _T ("!"), (DWORD)-1,
SRC_GO, _T ("Go"), _T ("go"), &ParseLineGo, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
SRC_HTML, _T ("HTML"), _T ("html;htm;shtml;ihtml;ssi;stm;stml;jsp"), &ParseLineHtml, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("<!--"), _T ("-->"), _T (""), (DWORD)-1,
Expand Down
4 changes: 4 additions & 0 deletions Externals/crystaledit/editlib/parsers/crystallineparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ if (pBuf != nullptr)\
#define COOKIE_SET_EXT_COMMENT_DEPTH(cookie, depth) (cookie) = (((cookie) & 0xF0FFFFFF) | ((depth) << 24))
#define COOKIE_GET_RAWSTRING_NUMBER_COUNT(cookie) (((cookie) & 0xF0000000) >> 28)
#define COOKIE_SET_RAWSTRING_NUMBER_COUNT(cookie, count) (cookie) = (((cookie) & 0x0FFFFFFF) | ((count) << 28))
#define COOKIE_GET_RAWSTRING_DELIMITER(cookie) (((cookie) & 0xFF000000) >> 24)
#define COOKIE_SET_RAWSTRING_DELIMITER(cookie, delimiter) (cookie) = (((cookie) & 0x00FFFFFF) | ((delimiter) << 24))
#define COOKIE_GET_LUA_EQUALS_SIGN_COUNT(cookie) (((cookie) & 0xF0000000) >> 28)
#define COOKIE_SET_LUA_EQUALS_SIGN_COUNT(cookie, count) (cookie) = (((cookie) & 0x0FFFFFFF) | ((count) << 28))

Expand Down Expand Up @@ -77,6 +79,7 @@ typedef enum
SRC_CSHARP,
SRC_CSS,
SRC_DCL,
SRC_DLANG,
SRC_FORTRAN,
SRC_GO,
SRC_HTML,
Expand Down Expand Up @@ -152,6 +155,7 @@ unsigned ParseLineCJava(unsigned dwCookie, const TCHAR *pszChars, int nLength, T
unsigned ParseLineCSharp(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
unsigned ParseLineCss(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
unsigned ParseLineDcl(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
unsigned ParseLineDlang(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
unsigned ParseLineFortran(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
unsigned ParseLineGo(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
unsigned ParseLineHtml(unsigned dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);
Expand Down
Loading

0 comments on commit f467537

Please sign in to comment.