diff --git a/src/main/java/EsperProcessor.java b/src/main/java/EsperProcessor.java index a80b067..755ae71 100644 --- a/src/main/java/EsperProcessor.java +++ b/src/main/java/EsperProcessor.java @@ -93,16 +93,24 @@ 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")); } - /** + /** * Given a string with (possibly) multiple statements, split and * add individually. */