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

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

[elpa] externals/org f85bef2: ob-java: Allow import to end with asterisk


From: ELPA Syncer
Subject: [elpa] externals/org f85bef2: ob-java: Allow import to end with asterisk
Date: Sat, 30 Jan 2021 05:57:08 -0500 (EST)

branch: externals/org
commit f85bef28d9a73ec5787e4a8bc8509d95bfd66f41
Author: John Herrlin <jherrlin@gmail.com>
Commit: Ian Martins <ianxm@jhu.edu>

    ob-java: Allow import to end with asterisk
    
    * lisp/ob-java.el (org-babel-java--imports-re,
    org-babel-java--import-maybe): Allow import to end with asterisk.
    
    TINYCHANGE
---
 lisp/ob-java.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-java.el b/lisp/ob-java.el
index 07ff8e9..1f2b980 100644
--- a/lisp/ob-java.el
+++ b/lisp/ob-java.el
@@ -88,7 +88,7 @@ like javac -verbose."
   "Regexp for the package statement.")
 (defconst org-babel-java--imports-re (rx line-start (0+ space) "import"
                                          (opt (1+ space) "static")
-                                        (1+ space) (group (1+ (in alnum ?_ 
?.))) ; capture the fully qualified class name
+                                        (1+ space) (group (1+ (in alnum ?_ ?. 
?*))) ; capture the fully qualified class name
                                         (0+ space) ?\; line-end)
   "Regexp for import statements.")
 (defconst org-babel-java--class-re (rx line-start (0+ space) (opt (seq 
"public" (1+ space)))
@@ -311,7 +311,8 @@ RESULT-FILE is the temp file to write the result."
     (goto-char (point-min))
     (setq class-found (re-search-forward class nil t))
     (goto-char (point-min))
-    (setq import-found (re-search-forward (concat "^import .*" package ".*" 
class ";") nil t))
+    (setq import-found
+          (re-search-forward (concat "^import .*" package ".*\\(?:\\*\\|" 
class "\\);") nil t))
     (when (and class-found (not import-found))
       (org-babel-java--move-past org-babel-java--package-re)
       (insert (concat "import " package "." class ";\n")))))



reply via email to

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