diff options
author | Claude Brisson <cbrisson@apache.org> | 2019-06-01 11:21:20 +0000 |
---|---|---|
committer | Claude Brisson <cbrisson@apache.org> | 2019-06-01 11:21:20 +0000 |
commit | f1dae6f6d34a46fbf2ac570e11c989fca7328dd3 (patch) | |
tree | b0a696f1beda65228d63649362f5186cf09c35d2 /velocity-engine-core/src/main/java/org/apache/velocity/runtime | |
parent | 73e49c6ed96c2404ff29d98dedbee66e94b99eae (diff) | |
download | apache-velocity-engine-f1dae6f6d34a46fbf2ac570e11c989fca7328dd3.tar.gz |
[engine][VELOCITY-917] Fix character names
git-svn-id: https://svn.apache.org/repos/asf/velocity/engine/branches/parser_experiments@1860476 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'velocity-engine-core/src/main/java/org/apache/velocity/runtime')
5 files changed, 22 insertions, 23 deletions
diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeConstants.java b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeConstants.java index 545e8f08..b68631b9 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeConstants.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeConstants.java @@ -392,25 +392,25 @@ public interface RuntimeConstants extends DeprecatedRuntimeConstants * Set the character (onlysingle byte UTF-8 supported at present) to use instead of '$' for references. * @since 2.2 */ - String PARSER_DOLLAR = "parser.character.dollar"; + String PARSER_CHAR_DOLLAR = "parser.character.dollar"; /** * Set the character (onlysingle byte UTF-8 supported at present) to use instead of '#' for directives, macros and comments. * @since 2.2 */ - String PARSER_HASH = "parser.character.hash"; + String PARSER_CHAR_HASH = "parser.character.hash"; /** * Set the character (onlysingle byte UTF-8 supported at present) to use instead of '@' for '#@' block macros. * @since 2.2 */ - String PARSER_AROBASE = "parser.character.arobase"; + String PARSER_CHAR_AT = "parser.character.at"; /** * Set the character (onlysingle byte UTF-8 supported at present) to use instead of '*' for '#* *#' block comments. * @since 2.2 */ - String PARSER_STAR = "parser.character.star"; + String PARSER_CHAR_ASTERISK = "parser.character.asterisk"; /* * ---------------------------------------------------------------------- diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java index 420529c5..929962b9 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeInstance.java @@ -243,13 +243,13 @@ public class RuntimeInstance implements RuntimeConstants, RuntimeServices * Configured '@' character * @since 2.2 */ - private char arobase = '$'; + private char at = '@'; /** * Configured '*' character * @since 2.2 */ - private char star = '$'; + private char asterisk = '*'; /** @@ -349,8 +349,8 @@ public class RuntimeInstance implements RuntimeConstants, RuntimeServices this.stringInterning = false; this.dollar = '$'; this.hash = '#'; - this.arobase = '@'; - this.star = '*'; + this.at = '@'; + this.asterisk = '*'; /* * create a VM factory, introspector, and application attributes @@ -413,10 +413,10 @@ public class RuntimeInstance implements RuntimeConstants, RuntimeServices /* init parser behavior */ hyphenAllowedInIdentifiers = getBoolean(PARSER_HYPHEN_ALLOWED, false); - dollar = getConfiguredCharacter(PARSER_DOLLAR, '$'); - hash = getConfiguredCharacter(PARSER_HASH, '#'); - arobase = getConfiguredCharacter(PARSER_AROBASE, '@'); - star = getConfiguredCharacter(PARSER_STAR, '*'); + dollar = getConfiguredCharacter(PARSER_CHAR_DOLLAR, '$'); + hash = getConfiguredCharacter(PARSER_CHAR_HASH, '#'); + at = getConfiguredCharacter(PARSER_CHAR_AT, '@'); + asterisk = getConfiguredCharacter(PARSER_CHAR_ASTERISK, '*'); } private char getConfiguredCharacter(String configKey, char defaultChar) @@ -1967,14 +1967,14 @@ public class RuntimeInstance implements RuntimeConstants, RuntimeServices } @Override - public char arobase() + public char at() { - return arobase; + return at; } @Override - public char star() + public char asterisk() { - return star; + return asterisk; } } diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeServices.java b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeServices.java index 588580c5..951b15e6 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeServices.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeServices.java @@ -509,12 +509,12 @@ public interface RuntimeServices * @return configured character for '@', or '@' * @since 2.2 */ - char arobase(); + char at(); /** * Get the character configured for '*' * @return configured character for '*', or '*' * @since 2.2 */ - char star(); + char asterisk(); } diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/Parser.java b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/Parser.java index 14deca2c..73bc0e9b 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/Parser.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/Parser.java @@ -39,8 +39,8 @@ public interface Parser char dollar(); char hash(); - char arobase(); - char star(); + char at(); + char asterisk(); default String lineComment() { @@ -49,6 +49,6 @@ public interface Parser default String blockComment() { - return String.valueOf(hash()) + star(); + return String.valueOf(hash()) + asterisk(); } } diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/node/ASTDirective.java b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/node/ASTDirective.java index 3cb2f865..25bcd62a 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/node/ASTDirective.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/parser/node/ASTDirective.java @@ -29,7 +29,6 @@ import org.apache.velocity.runtime.RuntimeConstants.SpaceGobbling; import org.apache.velocity.runtime.directive.BlockMacro; import org.apache.velocity.runtime.directive.Directive; import org.apache.velocity.runtime.directive.RuntimeMacro; -import org.apache.velocity.runtime.parser.LogContext; import org.apache.velocity.runtime.parser.ParseException; import org.apache.velocity.runtime.parser.Parser; import org.apache.velocity.runtime.parser.ParserConstants; @@ -148,7 +147,7 @@ public class ASTDirective extends SimpleNode directive.setLocation(t.beginLine, t.beginColumn, getTemplate()); directive.init(rsvc, context, this); } - else if( directiveName.startsWith(String.valueOf(rsvc.arobase())) ) + else if( directiveName.startsWith(String.valueOf(rsvc.at())) ) { if( this.jjtGetNumChildren() > 0 ) { |