diff options
author | Claude Brisson <cbrisson@apache.org> | 2019-11-30 13:47:07 +0000 |
---|---|---|
committer | Claude Brisson <cbrisson@apache.org> | 2019-11-30 13:47:07 +0000 |
commit | 9771388936aade4d3269acd97eae87266572e7b6 (patch) | |
tree | fd0380b6bc9765430bcd99d5a90bb8b50890dea3 /velocity-engine-core/src/main/java/org/apache/velocity/runtime | |
parent | be3465c9d382be4e61acaacea47e210b676b1ec0 (diff) | |
download | apache-velocity-engine-9771388936aade4d3269acd97eae87266572e7b6.tar.gz |
[core] Use devoted File Separator control character for parser end of template processing
git-svn-id: https://svn.apache.org/repos/asf/velocity/engine/trunk@1870626 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'velocity-engine-core/src/main/java/org/apache/velocity/runtime')
-rw-r--r-- | velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/VelocityCharStream.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/VelocityCharStream.java b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/VelocityCharStream.java index f6a93c08..e6a06151 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/VelocityCharStream.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/VelocityCharStream.java @@ -61,9 +61,11 @@ implements CharStream private int inBuf = 0; /* CB - to properly handle EOF *inside* javacc lexer, - * we send a 'zero-width whitespace' *just before* EOF + * we send a 'file separator' ascii char *just before* EOF + * (see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text) */ private boolean beforeEOF = false; + private static char END_OF_FILE = '\u001C'; private void ExpandBuff(boolean wrapAround) { @@ -161,7 +163,7 @@ implements CharStream inputStream.close(); throw new java.io.IOException(); } - buffer[maxNextCharInd++] = '\u200B'; + buffer[maxNextCharInd++] = END_OF_FILE; beforeEOF = true; } else |