(group (1+ (in alnum ?_))) ; capture the class name
(0+ space) ?{)
"Regexp for the class declaration.")
-(defconst org-babel-java--main-re (rx line-start (0+ space) "public"
- (1+ space) "static"
- (1+ space) "void"
- (1+ space) "main"
- (0+ space) ?\(
- (0+ space) "String"
- (0+ space) (1+ (in alnum ?_ ?\[ ?\] space)) ; "[] args" or "args[]"
- (0+ space) ?\)
- (0+ space) (opt "throws" (1+ (in alnum ?_ ?, ?. space)))
- ?{)
+(defconst org-babel-java--main-re
+ (rx line-start (0+ space) "public"
+ (1+ space) "static"
+ (1+ space) "void"
+ (1+ space) "main"
+ (0+ space) ?\(
+ (0+ space) "String"
+ (1+ (in alnum ?_ ?\[ ?\] space)) ; "[] args" or "args[]"
+ ?\)
+ (0+ space) (opt "throws" (1+ (in alnum ?_ ?, ?. space)))
+ ?{)
"Regexp for the main method declaration.")
-(defconst org-babel-java--any-method-re (rx line-start
- (0+ space) (opt (seq (1+ alnum) (1+ space))) ; visibility
- (opt (seq "static" (1+ space))) ; binding
- (1+ (in alnum ?_ ?\[ ?\])) ; return type
- (1+ space) (1+ (in alnum ?_)) ; method name
- (0+ space) ?\(
- (0+ space) (0+ (in alnum ?_ ?\[ ?\] ?, space)) ; params
- (0+ space) ?\)
- (0+ space) (opt "throws" (1+ (in alnum ?_ ?, ?. space)))
- ?{)
+(defconst org-babel-java--any-method-re
+ (rx line-start
+ (0+ space) (opt (seq (1+ alnum) (1+ space))) ; visibility
+ (opt (seq "static" (1+ space))) ; binding
+ (1+ (in alnum ?_ ?\[ ?\])) ; return type
+ (1+ space) (1+ (in alnum ?_)) ; method name
+ (0+ space) ?\(
+ (0+ (in alnum ?_ ?\[ ?\] ?, space)) ; params
+ ?\)
+ (0+ space) (opt "throws" (1+ (in alnum ?_ ?, ?. space)))
+ ?{)
"Regexp for any method.")
(defconst org-babel-java--result-wrapper "\n public static String __toString(Object val) {
if (val instanceof String) {
;; the dir to write the source file
(packagedir (if (and (not run-from-temp) packagename)
(file-name-as-directory
- (concat basedir (replace-regexp-in-string "\\\." "/" packagename)))
+ (concat basedir (replace-regexp-in-string "\\." "/" packagename)))
basedir))
;; the filename of the source file
(src-file (concat packagedir classname ".java"))
CONTENTS is its contents, as a string or nil. INFO is ignored."
(let ((case-fold-search t))
(replace-regexp-in-string
- "^[ \t]*#\\+attr_[-_a-za-z0-9]+:\\(?: .*\\)?\n" ""
+ "^[ \t]*#\\+attr_[-_a-z0-9]+:\\(?: .*\\)?\n" ""
(org-export-expand blob contents t))))
(defun org-org-headline (headline contents info)