EsperProcessor.java: remove inline comments in epl
This commit is contained in:
@ -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"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user