0

how to do custom velocity directive with localized name. Such directives is ignored now. For example:

class MyDirective extends Directive {
  @Override
  public String getName() {
    return "Пример";
  }
  @Override
  public boolean render(InternalContextAdapter context, Writer writer, Node node) 
        throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException {
    writer.write("example");
    return true;
  }
}

Input text: #Пример()

Expected example, but got unmodified text #Пример()

haskell
  • 15
  • 5

1 Answers1

0

It's a velocity parser limitation according to this Identifier definition

<PRE_REFERENCE,REFMODIFIER,REFMOD2>
TOKEN :
{
    <#ALPHA_CHAR: ["a"-"z", "A"-"Z", "_"] >
|   <#IDENTIFIER_CHAR: [ "a"-"z", "A"-"Z", "0"-"9", "_" ] >
|   <IDENTIFIER:  ( <ALPHA_CHAR> ) (<IDENTIFIER_CHAR>)* >
    {
        if (curLexState == PRE_REFERENCE)
        {
            SwitchTo(REFERENCE);
        }
    }
}
haskell
  • 15
  • 5