[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/clojure-ts-mode a7b9654488: Add preliminary support for ja
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/clojure-ts-mode a7b9654488: Add preliminary support for jank |
Date: |
Sun, 24 Sep 2023 09:59:45 -0400 (EDT) |
branch: elpa/clojure-ts-mode
commit a7b9654488693cdc9057a91410f74de42a397d1b
Author: Danny Freeman <danny@dfreeman.email>
Commit: Danny Freeman <danny@dfreeman.email>
Add preliminary support for jank
This creates a new derived mode for the clojure dialect jank
https://jank-lang.org/
See issue #23 for future work and
https://github.com/jank-lang/jank/issues/24 for the expressed desire to
support nested c++
---
clojure-ts-mode.el | 14 +++++++++++++-
test/native.jank | 10 ++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/clojure-ts-mode.el b/clojure-ts-mode.el
index d4111d56f6..8d40c75219 100644
--- a/clojure-ts-mode.el
+++ b/clojure-ts-mode.el
@@ -870,6 +870,11 @@ forms like deftype, defrecord, reify, proxy, etc."
(set-keymap-parent map clojure-ts-mode-map)
map))
+(defvar clojure-jank-ts-mode-map
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map clojure-ts-mode-map)
+ map))
+
(defun clojure-ts-mode-display-version ()
"Display the current `clojure-mode-version' in the minibuffer."
(interactive)
@@ -965,9 +970,16 @@ See `clojure-ts--font-lock-settings' for usage of
MARKDOWN-AVAILABLE."
\\{clojure-dart-ts-mode-map}")
+;;;###autoload
+(define-derived-mode clojure-jank-ts-mode clojure-ts-mode "Jank[TS]"
+ "Major mode for editing Jank code.
+
+\\{clojure-jank-ts-mode-map}")
+
(defun clojure-ts--register-novel-modes ()
"Set up Clojure modes not present in progenitor clojure-mode.el."
- (add-to-list 'auto-mode-alist '("\\.cljd\\'" . clojure-dart-ts-mode)))
+ (add-to-list 'auto-mode-alist '("\\.cljd\\'" . clojure-dart-ts-mode))
+ (add-to-list 'auto-mode-alist '("\\.jank\\'" . clojure-jank-ts-mode)))
;; Redirect clojure-mode to clojure-ts-mode if clojure-mode is present
(if (require 'clojure-mode nil 'noerror)
diff --git a/test/native.jank b/test/native.jank
new file mode 100644
index 0000000000..bf075964bf
--- /dev/null
+++ b/test/native.jank
@@ -0,0 +1,10 @@
+(defn create-vertex-shader! []
+ (native/raw "__value = make_box(glCreateShader(GL_VERTEX_SHADER));"))
+
+(defn set-shader-source! [shader source]
+ (native/raw "auto const shader(detail::to_int(~{ shader }));
+ auto const &source(detail::to_string(~{ source }));
+ __value = make_box(glShaderSource(shader, 1, &source.data,
nullptr));"))
+
+(defn compile-shader! [shader]
+ (native/raw "__value = make_box(glCompileShader(detail::to_int(~{ shader
})));"))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [nongnu] elpa/clojure-ts-mode a7b9654488: Add preliminary support for jank,
ELPA Syncer <=