emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/beardbolt c009c2df44 130/323: Trim left side of strings


From: ELPA Syncer
Subject: [elpa] externals/beardbolt c009c2df44 130/323: Trim left side of strings to activate 'starting with period' opt
Date: Thu, 9 Mar 2023 10:58:24 -0500 (EST)

branch: externals/beardbolt
commit c009c2df443da3c463ad02e1893f353e4dd2202d
Author: Jay Kamat <jaygkamat@gmail.com>
Commit: Jay Kamat <jaygkamat@gmail.com>

    Trim left side of strings to activate 'starting with period' opt
    
    Issue #9
---
 rmsbolt.el | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 13fc1856ff..b0d3f10eea 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -675,9 +675,9 @@ Lifted from 
https://emacs.stackexchange.com/questions/35936/disassembly-of-a-byt
         (labels-used (make-hash-table :test #'equal))
         (weak-usages (make-hash-table :test #'equal)))
     (dolist (line asm-lines)
-      (setq match (and
-                   (string-match rmsbolt-label-def line)
-                   (match-string 1 line)))
+      (setq line (string-trim-left line)
+            match (and (string-match rmsbolt-label-def line)
+                       (match-string 1 line)))
       (when match
         (setq current-label match))
       (setq match (and (string-match rmsbolt-defines-global line)
@@ -685,8 +685,8 @@ Lifted from 
https://emacs.stackexchange.com/questions/35936/disassembly-of-a-byt
       (when match
         (puthash match t labels-used))
       ;; When we have no line or a period started line, skip
-      (unless (or (= 0 (length line))
-                  (string-prefix-p "." line)
+      (unless (or (string-empty-p line)
+                  (eq (elt line 0) ?.)
                   (not (string-match-p rmsbolt-label-find line)))
         (if (or (not (buffer-local-value 'rmsbolt-filter-directives 
src-buffer))
                 (rmsbolt--has-opcode-p line)
@@ -694,7 +694,6 @@ Lifted from 
https://emacs.stackexchange.com/questions/35936/disassembly-of-a-byt
             ;; Add labels indescriminantly
             (dolist (l (rmsbolt-re-seq rmsbolt-label-find line))
               (puthash l t labels-used))
-
           (when (and current-label
                      (or (string-match-p rmsbolt-data-defn line)
                          (rmsbolt--has-opcode-p line)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]