Distribute and run LLMs with a single file.
C++ cross-platformggufllama-cpplocal-ailocal-inferencelocal-llmopen-source-aisingle-file-executablespeech-to-text
Make D syntax highlighting better
Justine Tunney0068a3711d79
diff --git a/llamafile/highlight.cpp b/llamafile/highlight.cppindex 574adaa1..12fa0850 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.hindex a2fadd57..4e0c02fa 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.gperfindex eecd1619..f4e0d06f 100644--- a/llamafile/is_keyword_d.gperf+++ b/llamafile/is_keyword_d.gperf@@ -50,7 +50,6 @@ elseenumexportextern-falsefinalfinallyfloat@@ -78,7 +77,6 @@ mixinmodulenewnothrow-nulloutoverridepackage@@ -101,7 +99,6 @@ synchronizedtemplatethisthrow-truetrytypeidtypeofdiff --git a/llamafile/is_keyword_d_constant.gperf b/llamafile/is_keyword_d_constant.gperfnew file mode 100644index 00000000..3a710c94--- /dev/null+++ b/llamafile/is_keyword_d_constant.gperf@@ -0,0 +1,18 @@+%{+#include <string.h>+%}+%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