diff --git a/llamafile/highlight.cpp b/llamafile/highlight.cpp index 574adaa197..12fa085009 100644 --- a/llamafile/highlight.cpp +++ b/llamafile/highlight.cpp @@ -163,7 +163,7 @@ Highlight *Highlight::create(const std::string_view &lang) { return new HighlightSwift; if (lang == "d") - return new HighlightC(is_keyword_d); + return new HighlightC(is_keyword_d, nullptr, nullptr, is_keyword_d_constant); if (lang == "r") return new HighlightR; diff --git a/llamafile/highlight.h b/llamafile/highlight.h index a2fadd579e..4e0c02fa26 100644 --- a/llamafile/highlight.h +++ b/llamafile/highlight.h @@ -105,6 +105,7 @@ is_keyword_f is_keyword_swift_type; is_keyword_f is_keyword_swift_builtin; is_keyword_f is_keyword_swift_constant; is_keyword_f is_keyword_d; +is_keyword_f is_keyword_d_constant; is_keyword_f is_keyword_zig; is_keyword_f is_keyword_zig_type; is_keyword_f is_keyword_zig_builtin; diff --git a/llamafile/is_keyword_d.gperf b/llamafile/is_keyword_d.gperf index eecd161993..f4e0d06f1c 100644 --- a/llamafile/is_keyword_d.gperf +++ b/llamafile/is_keyword_d.gperf @@ -50,7 +50,6 @@ else enum export extern -false final finally float @@ -78,7 +77,6 @@ mixin module new nothrow -null out override package @@ -101,7 +99,6 @@ synchronized template this throw -true try typeid typeof diff --git a/llamafile/is_keyword_d_constant.gperf b/llamafile/is_keyword_d_constant.gperf new file mode 100644 index 0000000000..3a710c94c4 --- /dev/null +++ b/llamafile/is_keyword_d_constant.gperf @@ -0,0 +1,18 @@ +%{ +#include +%} +%pic +%compare-strncmp +%language=ANSI-C +%readonly-tables +%define lookup-function-name is_keyword_d_constant +%% +__FILE_FULL_PATH__ +__FILE__ +__FUNCTION__ +__LINE__ +__MODULE__ +__PRETTY_FUNCTION__ +false +null +true