Skip to content

Commit 1adb613

Browse files
authored
Merge pull request #154 from google/antlr_update
antlr: patch rule for external consumption
2 parents 3953cb2 + 5580bc7 commit 1adb613

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)