unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: Julien Lepiller <julien@lepiller.eu>
Cc: 43525@debbugs.gnu.org
Subject: [bug#43525] [PATCH] gnu: Add antlr4.
Date: Sun, 20 Sep 2020 08:59:18 +0200	[thread overview]
Message-ID: <87eemxszll.fsf@elephly.net> (raw)
In-Reply-To: <20200920031817.1ff59225@tachikoma.lepiller.eu>


Hi Julien,

> +         (add-before 'check 'remove-graphemes
> +           (lambda _
> +             ;; When running antlr on grahemes.g4, we get a runtime exception:
> +             ;; set is empty. So delete the file that depends on it.
> +             (delete-file "runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/perf/TimeLexerSpeed.java")))

Please let the phase end on #t.  Please also use double spacing in
comments.

> +         (add-before 'build 'generate-unicode
> +           (lambda _
> +             ;; First: build the generator
> +             (invoke "javac" "-cp" (getenv "CLASSPATH")
> +                     "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java"
> +                     "tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java")
> +             ;; Then use it
> +             (invoke "java" "-cp" (string-append (getenv "CLASSPATH")
> +                                                 ":tool/src:runtime/Java")
> +                     "org.antlr.v4.unicode.UnicodeRenderer"
> +                     "tool/resources/org/antlr/v4/tool/templates"
> +                     "unicodedata"
> +                     "tool/src/org/antlr/v4/unicode/UnicodeData.java")
> +             (begin
> +               ;; It seems there is a bug with our ST4
> +               (substitute* "tool/src/org/antlr/v4/unicode/UnicodeData.java"
> +                 (("\\\\>") ">"))
> +               ;; Remove the additional file
> +               (delete-file "tool/src/org/antlr/v4/unicode/UnicodeRenderer.java")
> +               #t)))

Why have a BEGIN here?

> +         (add-before 'build 'generate-grammar
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (with-directory-excursion "tool/src/org/antlr/v4/parse"
> +               (for-each (lambda (file)
> +                           (format #t "~a\n" file)

I’m not sure this actually outputs anything.  Does it?  I’m not a fan of
using FORMAT when DISPLAY would work just fine.

> +                           (system* "antlr3" file))

Why not INVOKE?

> +                         '("ANTLRLexer.g" "ANTLRParser.g" "BlockSetTransformer.g"
> +                           "GrammarTreeVisitor.g" "ATNBuilder.g"
> +                           "ActionSplitter.g" "LeftRecursiveRuleWalker.g")))
> +             (with-directory-excursion "tool/src/org/antlr/v4/codegen"
> +               (copy-file "../parse/ANTLRParser.tokens" "ANTLRParser.tokens")

You can use INSTALL-FILE to avoid having to restate the target file name.

> +               (format #t "SourceGenTriggers.g\n")

How about DISPLAY here?

-- 
Ricardo




  reply	other threads:[~2020-09-20  6:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-20  1:18 [bug#43525] [PATCH] gnu: Add antlr4 Julien Lepiller
2020-09-20  6:59 ` Ricardo Wurmus [this message]
2020-09-20 12:00   ` bug#43525: " Julien Lepiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eemxszll.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=43525@debbugs.gnu.org \
    --cc=julien@lepiller.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).