EsperProcessor.java: remove inline comments in epl
This commit is contained in:
@ -93,16 +93,24 @@ public class EsperProcessor implements TickProcessor {
|
|||||||
return str.matches("^\\s*$");
|
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.
|
* Remove comment lines from the string.
|
||||||
*/
|
*/
|
||||||
private static String filterComments(String str) {
|
private static String filterComments(String str) {
|
||||||
return Arrays.stream(splitLines(str))
|
return Arrays.stream(splitLines(str))
|
||||||
.filter(s -> !isComment(s))
|
.filter(s -> !isComment(s))
|
||||||
|
.map(s -> removeInlineComment(s))
|
||||||
.collect(Collectors.joining("\n"));
|
.collect(Collectors.joining("\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a string with (possibly) multiple statements, split and
|
* Given a string with (possibly) multiple statements, split and
|
||||||
* add individually.
|
* add individually.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user