diff --git a/clojure-ts-mode.el b/clojure-ts-mode.el index ee0293e..4d96499 100644 --- a/clojure-ts-mode.el +++ b/clojure-ts-mode.el @@ -890,6 +890,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) @@ -985,9 +990,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 0000000..bf07596 --- /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 })));"))