[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/beardbolt 15aa590bcf 106/323: Add ability to specify mo
From: |
ELPA Syncer |
Subject: |
[elpa] externals/beardbolt 15aa590bcf 106/323: Add ability to specify moved initial src file |
Date: |
Thu, 9 Mar 2023 10:58:22 -0500 (EST) |
branch: externals/beardbolt
commit 15aa590bcfcc36df91eb20ac6c5a2865e7c68fba
Author: Jay Kamat <jaygkamat@gmail.com>
Commit: Jay Kamat <jaygkamat@gmail.com>
Add ability to specify moved initial src file
---
rmsbolt.el | 34 ++++++++++++++++++++++------------
starters/rmsbolt.pony | 30 ++++++++++++++++--------------
2 files changed, 38 insertions(+), 26 deletions(-)
diff --git a/rmsbolt.el b/rmsbolt.el
index 4f38a86709..eab2e3bd13 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -177,6 +177,9 @@ Please DO NOT modify this blindly, as this directory will
get deleted on Emacs e
(defvar-local rmsbolt-src-buffer nil)
+(defvar-local rmsbolt--real-src-file nil
+ "If set, the real filename that we compiled from, probably due to a copy
from this file.")
+
;;;; Variable-like funcs
(defun rmsbolt-output-filename (src-buffer &optional asm)
"Function for generating an output filename for SRC-BUFFER.
@@ -409,6 +412,11 @@ Outputs assembly file if ASM."
(if dis object-filename asm-filename)
(rmsbolt-output-filename src-buffer))
" ")))
+ (with-current-buffer src-buffer
+ (setq-local rmsbolt--real-src-file
+ (expand-file-name (file-name-nondirectory
+ (buffer-file-name))
+ dir)))
cmd))
(cl-defun rmsbolt--py-compile-cmd (&key src-buffer)
"Process a compile command for python3."
@@ -664,7 +672,10 @@ Argument SRC-BUFFER source buffer."
;; TODO godbolt does not handle disassembly with filter=off, but we should.
(cl-defun rmsbolt--process-disassembled-lines (src-buffer asm-lines)
"Process and filter disassembled ASM-LINES from SRC-BUFFER."
- (let* ((result nil)
+ (let* ((src-file-name
+ (or (buffer-local-value 'rmsbolt--real-src-file src-buffer)
+ (buffer-file-name src-buffer)))
+ (result nil)
(func nil)
(source-linum nil))
(dolist (line asm-lines)
@@ -675,7 +686,7 @@ Argument SRC-BUFFER source buffer."
'("Aborting processing due to exceeding the binary limit.")))
(when (string-match rmsbolt-disass-line line)
;; Don't add linums from files which we aren't inspecting
- (if (file-equal-p (buffer-file-name src-buffer)
+ (if (file-equal-p src-file-name
(match-string 1 line))
(setq source-linum (string-to-number (match-string 2 line)))
(setq source-linum nil))
@@ -702,14 +713,13 @@ Argument SRC-BUFFER source buffer."
(nreverse result)))
(cl-defun rmsbolt--process-src-asm-lines (src-buffer asm-lines)
- (let ((used-labels (rmsbolt--find-used-labels src-buffer asm-lines))
- (result nil)
- (prev-label nil)
- (source-linum nil)
- (source-file nil)
- (skip-file-match
- ;; Skip file match if we don't have a current filename
- (not (buffer-file-name src-buffer))))
+ (let* ((used-labels (rmsbolt--find-used-labels src-buffer asm-lines))
+ (src-file-name (or (buffer-local-value 'rmsbolt--real-src-file
src-buffer)
+ (buffer-file-name src-buffer)))
+ (result nil)
+ (prev-label nil)
+ (source-linum nil)
+ (source-file nil))
(dolist (line asm-lines)
(let* ((raw-match (or (string-match rmsbolt-label-def line)
(string-match rmsbolt-assignment-def line)))
@@ -727,8 +737,8 @@ Argument SRC-BUFFER source buffer."
(setq source-file (match-string 2 line))))
;; Process any line number hints
(when (string-match rmsbolt-source-tag line)
- (if (or skip-file-match
- (file-equal-p (buffer-file-name src-buffer) source-file))
+ (if (or (not src-file-name) ;; Skip file match if we don't have a
current filename
+ (file-equal-p src-file-name source-file))
(setq source-linum (string-to-number
(match-string 2 line)))
(setq source-linum nil)))
diff --git a/starters/rmsbolt.pony b/starters/rmsbolt.pony
index 167f427333..088921f9cb 100644
--- a/starters/rmsbolt.pony
+++ b/starters/rmsbolt.pony
@@ -1,21 +1,23 @@
// pony rmsbolt starter file
+// Passing '--debug' is reccomended to pony because without it LOC hints are
optimized out
+
// Local Variables:
-// rmsbolt-command: "ponyc"
-// rmsbolt-disassemble: t
+// rmsbolt-command: "ponyc --debug"
+// rmsbolt-disassemble: nil
// End:
actor Main
- new create(env: Env) =>
- var a: U8 = 1 + 1
- if is_rms(a) != 0 then
- env.out.print(a.string())
- end
+ new create(env: Env) =>
+ var a: U8 = 1 + 1
+ if is_rms(a) != 0 then
+ env.out.print(a.string())
+ end
-fun ref is_rms(a: U8): I32 =>
- match a
- | 'R' => 1
- | 'M' => 2
- | 'S' => 3
- else 0
- end
+ fun ref is_rms(a: U8): I32 =>
+ match a
+ | 'R' => 1
+ | 'M' => 2
+ | 'S' => 3
+ else 0
+ end
- [elpa] externals/beardbolt 8d992d1da7 103/323: Add links to README, (continued)
- [elpa] externals/beardbolt 8d992d1da7 103/323: Add links to README, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt a74d54e764 109/323: Fix tests, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 859722f7e0 084/323: Add back support for Emacs 25, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 2eca2d59dd 100/323: Merge branch 'patch-2' into 'master', ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt a85b457e81 108/323: Fix typo, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt fb0e8c85a3 110/323: Use https links to avoid mixed content warnings, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 9129f1f13c 116/323: Add documentation and README for elisp, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt c95ba9c0c4 097/323: More consistent punctuation in README bullet list, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 74fc122c39 101/323: Fix typo in supports-{disass, asm}, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 36bfe74010 102/323: Force using bash whenever available, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 15aa590bcf 106/323: Add ability to specify moved initial src file,
ELPA Syncer <=
- [elpa] externals/beardbolt b60a9e3a84 117/323: Fix errors with emacs <25 with elisp disass, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt a5855171f8 120/323: Fix byte-compilation warnings, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 0d5774397b 124/323: Update README, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt be3f92821e 140/323: Clean up PHP exporter slightly, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt a4e0b8a805 134/323: Optimize disassembly function, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 3527f2fa3a 123/323: Fix source code highlighting when multiple files are provided, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt d564f9def8 131/323: Update README.org, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt ebc56d81b0 127/323: Disable automatic recompile for buffers larger than 500 lines, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 5f998f34d7 137/323: Update README, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 4679974da1 141/323: Add documentation and starter file for PHP support, ELPA Syncer, 2023/03/09