Skip to content

Commit

Permalink
Merge pull request #1645 from gaurav8297/fix_escape_char
Browse files Browse the repository at this point in the history
Sanitize escape char in Transformer::transformSymbolicName
  • Loading branch information
gaurav8297 committed Jun 7, 2023
2 parents e733a17 + eeaef34 commit c6ce3fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/parser/transformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,10 @@ std::string Transformer::transformSymbolicName(CypherParser::OC_SymbolicNameCont
if (ctx.UnescapedSymbolicName()) {
return ctx.UnescapedSymbolicName()->getText();
} else if (ctx.EscapedSymbolicName()) {
return ctx.EscapedSymbolicName()->getText();
std::string escapedSymbolName = ctx.EscapedSymbolicName()->getText();
// escapedSymbolName symbol will be of form "`Some.Value`". Therefore, we need to sanitize
// it such that we don't store the symbol with escape character.
return escapedSymbolName.substr(1, escapedSymbolName.size() - 2);
} else {
assert(ctx.HexLetter());
return ctx.HexLetter()->getText();
Expand Down

0 comments on commit c6ce3fe

Please sign in to comment.