Skip to content

Commit feb4499

Browse files
CEL Dev Teamcopybara-github
authored andcommitted
Update CelUnparser and open up visibility so that inheriting class can use it
PiperOrigin-RevId: 721648879
1 parent b428483 commit feb4499

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

parser/BUILD.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ java_library(
2424
exports = ["//parser/src/main/java/dev/cel/parser:parser_builder"],
2525
)
2626

27+
java_library(
28+
name = "unparser_visitor",
29+
exports = ["//parser/src/main/java/dev/cel/parser:unparser_visitor"],
30+
)
31+
2732
java_library(
2833
name = "macro",
2934
exports = ["//parser/src/main/java/dev/cel/parser:macro"],

parser/src/main/java/dev/cel/parser/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,12 @@ java_library(
9494
deps = [
9595
":operator",
9696
"//:auto_value",
97-
"//common",
9897
"//common:compiler_common",
9998
"//common:source_location",
10099
"//common/ast",
101100
"//common/ast:expr_factory",
102101
"@maven//:com_google_errorprone_error_prone_annotations",
103102
"@maven//:com_google_guava_guava",
104-
"@maven//:org_jspecify_jspecify",
105103
],
106104
)
107105

parser/src/main/java/dev/cel/parser/CelUnparserVisitor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ private void visitIndex(CelCall expr, String op) {
319319
stringBuilder.append(RIGHT_BRACKET);
320320
}
321321

322-
private void visitMaybeNested(CelExpr expr, boolean nested) {
322+
protected void visitMaybeNested(CelExpr expr, boolean nested) {
323323
if (nested) {
324324
stringBuilder.append(LEFT_PAREN);
325325
}
@@ -329,7 +329,7 @@ private void visitMaybeNested(CelExpr expr, boolean nested) {
329329
}
330330
}
331331

332-
private boolean isBinaryOrTernaryOperator(CelExpr expr) {
332+
protected boolean isBinaryOrTernaryOperator(CelExpr expr) {
333333
if (!isComplexOperator(expr)) {
334334
return false;
335335
}

0 commit comments

Comments
 (0)