Skip to content

Commit 5580bc7

Browse files
committed
antlr: patch rule for external consumption
Signed-off-by: Kuat Yessenov <kuat@google.com>
1 parent 3953cb2 commit 5580bc7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

bazel/antlr.bzl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ def _antlr_library(ctx):
5151
antlr_args.add("-package", ctx.attr.package)
5252
antlr_args.add(ctx.file.src)
5353

54+
# Strip ".g4" extension.
5455
basename = ctx.file.src.basename[:-3]
56+
5557
suffixes = ["Lexer", "Parser", "BaseVisitor", "Visitor"]
5658

5759
ctx.actions.run(
@@ -66,7 +68,7 @@ def _antlr_library(ctx):
6668
for suffix in suffixes:
6769
header = ctx.actions.declare_file(basename + suffix + ".h")
6870
source = ctx.actions.declare_file(basename + suffix + ".cpp")
69-
generated = output.path + "/" + ctx.file.src.short_path[:-3] + suffix
71+
generated = output.path + "/" + ctx.file.src.path[:-3] + suffix
7072

7173
ctx.actions.run_shell(
7274
mnemonic = "CopyHeader" + suffix,

0 commit comments

Comments
 (0)