EsperProcessor.java: remove inline comments in epl

This commit is contained in:
2018-10-30 17:48:40 -07:00
parent c9c10da4bc
commit 52bcf97c8f

View File

@ -93,12 +93,20 @@ public class EsperProcessor implements TickProcessor {
return str.matches("^\\s*$");
}
/**
* Remove any inline epl comment from a given line.
*/
private static String removeInlineComment(String s) {
return s.replaceAll("--.*$", "");
}
/**
* Remove comment lines from the string.
*/
private static String filterComments(String str) {
return Arrays.stream(splitLines(str))
.filter(s -> !isComment(s))
.map(s -> removeInlineComment(s))
.collect(Collectors.joining("\n"));
}