[
https://issues.apache.org/jira/browse/METRON-873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15983975#comment-15983975
]
ASF GitHub Bot commented on METRON-873:
---------------------------------------
Github user cestella commented on a diff in the pull request:
https://github.com/apache/incubator-metron/pull/542#discussion_r113348853
--- Diff:
metron-platform/metron-common/src/main/java/org/apache/metron/common/stellar/StellarCompiler.java
---
@@ -263,7 +263,56 @@ public void exitVariable(StellarParser.VariableContext
ctx) {
@Override
public void exitStringLiteral(StellarParser.StringLiteralContext ctx) {
- expression.tokenDeque.push(new Token<>(ctx.getText().substring(1,
ctx.getText().length() - 1), String.class));
+ String rawToken = ctx.getText();
+ String literal = unquoteLiteral(rawToken);
+
+ expression.tokenDeque.push(new Token<>(literal, String.class));
+ }
+
--- End diff --
Dude! Great catch! We're actually closer to JSON escaping because our
strings can start with either `'` or `"`, so I used that escaping strategy and
it worked just fine. Thanks!
> Stellar string literals do not support quote escaping
> -----------------------------------------------------
>
> Key: METRON-873
> URL: https://issues.apache.org/jira/browse/METRON-873
> Project: Metron
> Issue Type: Improvement
> Reporter: Casey Stella
>
> Right now, in stellar, we cannot represent a string literal that contains
> 'foo' if the string is quoted with ' or "foo" if the string is quoted with ".
> This is unfortunate and should be corrected.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)