guix: maven: Fix java parser.

* guix/build/maven/java.scm (comment, comment-chr): Support more comment
styles.
This commit is contained in:
Julien Lepiller 2021-12-21 02:52:34 +01:00
parent 76133fb764
commit fb1a9c11e5
No known key found for this signature in database
GPG Key ID: 53D457B2D636EE82
1 changed files with 6 additions and 3 deletions

View File

@ -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))