summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2021-12-21 02:52:34 +0100
committerJulien Lepiller <julien@lepiller.eu>2022-02-05 20:16:32 +0100
commitfb1a9c11e5ec928704c98dd633301bbdd7f3e8f4 (patch)
tree92ecd232342659345f16501cf309c779eb7ec242 /guix
parent76133fb764e4f01f4c1a0a344c59aeb7e0380580 (diff)
guix: maven: Fix java parser.
* guix/build/maven/java.scm (comment, comment-chr): Support more comment styles.
Diffstat (limited to 'guix')
-rw-r--r--guix/build/maven/java.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/guix/build/maven/java.scm b/guix/build/maven/java.scm
index daa4c88045..f8c8e5745d 100644
--- a/guix/build/maven/java.scm
+++ b/guix/build/maven/java.scm
@@ -31,11 +31,14 @@
(? (and (ignore "static") (* WS)))
package-name
(* WS) (ignore ";")))
-(define-peg-pattern comment all (and (? (and annotation-pat (* WS))) (ignore "/*")
- comment-part))
+(define-peg-pattern comment all (or
+ (and (? (and annotation-pat (* WS))) (ignore "/*")
+ comment-part)
+ (and (ignore "//") (* (or "\t" (range #\ #\xffff)))
+ (or (ignore "\n") (ignore "\r")) (* WS))))
(define-peg-pattern comment-part body (or (ignore (and (* "*") "/"))
(and (* "*") (+ comment-chr) comment-part)))
-(define-peg-pattern comment-chr body (or "\t" "\n" (range #\ #\)) (range #\+ #\xffff)))
+(define-peg-pattern comment-chr body (or "\t" "\n" "\r" (range #\ #\)) (range #\+ #\xffff)))
(define-peg-pattern inline-comment none (and (ignore "//") (* inline-comment-chr)
(ignore "\n")))
(define-peg-pattern inline-comment-chr body (range #\ #\xffff))