Retain the original identifier during parse when quoted identifier is disabled by copybara-service[bot] · Pull Request #547 · cel-expr/cel-java · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions parser/src/main/java/dev/cel/parser/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,12 @@ public void parser_errors() {

CelParser parserWithoutQuotedFields =
CelParserImpl.newBuilder()
.setStandardMacros(CelStandardMacro.HAS)
.setOptions(CelOptions.current().enableQuotedIdentifierSyntax(false).build())
.build();
runTest(parserWithoutQuotedFields, "foo.`bar`");
runTest(parserWithoutQuotedFields, "Struct{`bar`: false}");
runTest(parserWithoutQuotedFields, "has(.`.`");
}

@Test
Expand Down
14 changes: 13 additions & 1 deletion parser/src/test/resources/parser_errors.baseline