diff mbox series

[bug#52723,22/26] guix: maven: Fix java parser.

Message ID ae98a6e03a90a78eb720a95d9f8e5e040526116a.1640126679.git.julien@lepiller.eu
State Accepted
Headers show
Series [bug#52723,01/26] gnu: Add apache-parent-pom-23. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Julien Lepiller Dec. 21, 2021, 10:45 p.m. UTC
* guix/build/maven/java.scm (comment, comment-chr): Support more comment
styles.
---
 guix/build/maven/java.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

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 @@  (define-peg-pattern import-pat all (and (ignore "import") (* WS)
                                         (? (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))