[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/beardbolt 68af010f02 064/323: Add support for haskell
From: |
ELPA Syncer |
Subject: |
[elpa] externals/beardbolt 68af010f02 064/323: Add support for haskell |
Date: |
Thu, 9 Mar 2023 10:58:17 -0500 (EST) |
branch: externals/beardbolt
commit 68af010f0230747ea53657d17cccc8be58c29475
Author: Jay Kamat <jaygkamat@gmail.com>
Commit: Jay Kamat <jaygkamat@gmail.com>
Add support for haskell
---
README.org | 7 +++++++
rmsbolt.el | 25 ++++++++++++++++++++++++-
starters/rmsbolt.hs | 31 +++++++++++++++++++++++++++++++
3 files changed, 62 insertions(+), 1 deletion(-)
diff --git a/README.org b/README.org
index 6ae9085b26..78a5768049 100644
--- a/README.org
+++ b/README.org
@@ -59,6 +59,13 @@ demangling is done with rustfilt if available
[[https://s25.postimg.cc/h7npjnnun/output-2018-08-01-19_30_52.gif][https://s25.postimg.cc/h7npjnnun/output-2018-08-01-19_30_52.gif]]
+** Haskell
+
+demangling is done with the compiler-explorer demangler, named
+to ~haskell-demangler~.
+
+[[https://s25.postimg.cc/4d5167yr3/output-2018-08-08-23_17_59.gif][https://s25.postimg.cc/4d5167yr3/output-2018-08-08-23_17_59.gif]]
+
** Python
Support for viewing bytecode only. Python
[[https://bugs.python.org/issue2506][dosen't have many options]], so most
diff --git a/rmsbolt.el b/rmsbolt.el
index 6de3344d13..2a3ce2e497 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -344,13 +344,27 @@ Outputs assembly file if ASM."
" ")))
cmd))
(cl-defun rmsbolt--py-compile-cmd (&key src-buffer)
- "Process a compile command for rustc."
+ "Process a compile command for python3."
(let* ((cmd (buffer-local-value 'rmsbolt-command src-buffer)))
(mapconcat 'identity
(list cmd "-m" "dis" (buffer-file-name)
">" (rmsbolt-output-filename src-buffer))
" ")))
+(cl-defun rmsbolt--hs-compile-cmd (&key src-buffer)
+ "Process a compile command for ghc."
+ (let* ((cmd (buffer-local-value 'rmsbolt-command src-buffer))
+ (cmd (mapconcat 'identity
+ (list cmd
+ "-g"
+ (if (buffer-local-value 'rmsbolt-disassemble
src-buffer)
+ ""
+ "-S")
+ (buffer-file-name)
+ "-o" (rmsbolt-output-filename src-buffer))
+ " ")))
+ cmd))
+
(defvar rmsbolt--hidden-func-c
(rx bol (or (and "__" (0+ any))
(and "_" (or "init" "start" "fini"))
@@ -435,6 +449,15 @@ Outputs assembly file if ASM."
:compile-cmd-function #'rmsbolt--py-compile-cmd
:disass-hidden-funcs nil
:process-asm-custom-fn
#'rmsbolt--process-python-bytecode))
+ (haskell-mode
+ . ,(make-rmsbolt-lang :mode 'haskell-mode
+ :compile-cmd "ghc"
+ :supports-asm t
+ :supports-disass nil
+ :demangler "haskell-demangler"
+ :starter-file-name "rmsbolt.hs"
+ :compile-cmd-function #'rmsbolt--hs-compile-cmd
+ :disass-hidden-funcs nil))
))
;;;; Macros
diff --git a/starters/rmsbolt.hs b/starters/rmsbolt.hs
new file mode 100644
index 0000000000..d21c7c2152
--- /dev/null
+++ b/starters/rmsbolt.hs
@@ -0,0 +1,31 @@
+-- Haskell rmsbolt starter file
+
+-- Haskell demangler support can be gained by placing the binary
+-- generated from this folder on your path under the name
+-- 'haskell-demangler'
+-- https://github.com/mattgodbolt/compiler-explorer/tree/master/haskell
+
+-- Local Variables:
+-- rmsbolt-command: "ghc -O0"
+-- End:
+
+module Rmsbolt where
+
+import Data.Char
+
+isRMS :: Char -> Bool
+isRMS letter
+ | letter == 'R' = True
+ | letter == 'M' = True
+ | letter == 'S' = True
+ | otherwise = False
+
+main :: IO()
+main =
+ let num = Data.Char.chr 2 in
+ let out = isRMS num in
+ let out_str =
+ if out then
+ "True" else
+ "False" in
+ putStrLn out_str
- [elpa] externals/beardbolt ff496660cc 205/323: Migrate irc channel to libera, (continued)
- [elpa] externals/beardbolt ff496660cc 205/323: Migrate irc channel to libera, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 42edd955ae 201/323: Move filename massaging out of hot loop, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 972e6f41a2 207/323: Merge branch 'faerryn-master-patch-16796' into 'master', ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt bc0652e56e 197/323: Add support for indirect buffers, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt df7451ee35 191/323: Avoid insert on new file creation, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 95130c1421 203/323: Update copyright and headers, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt f098a467c5 206/323: Add missing `:keymap' key to `define-minor-mode rmsbolt'., ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt c88196439f 211/323: Support Zig 0.9, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 0f3293c607 224/323: Early-exit `when-let` if output-buffer has no window, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt fffadc0b86 214/323: Allow configuring objdump binary in disassembly mode, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 68af010f02 064/323: Add support for haskell,
ELPA Syncer <=
- [elpa] externals/beardbolt f0be36f4b5 063/323: Update link, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 8213e24af3 070/323: Update README, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt e71061f509 075/323: Fix readme, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt c442960f16 076/323: Add an easy way to turn off automatic recompilation, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt a191eb9c73 071/323: Add basic Java support, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 77398fec4f 078/323: Clarify starter/ folder message, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 8cfb5b1968 086/323: Upgrade information and docs for melpa, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt cfe809f979 095/323: Revert regexp changes, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 644973d865 079/323: Fix improper building of rmsbolt-starter path, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 21b29cdb72 081/323: Satisfy package-lint, ELPA Syncer, 2023/03/09