Class InequalityAsDiamond

java.lang.Object
org.ek9lang.compiler.support.operators.InequalityAsDiamond
All Implemented Interfaces:
Function<String,String>, UnaryOperator<String>

public final class InequalityAsDiamond extends Object implements UnaryOperator<String>
THE spelling of inequality the compiler resolves: a developer's != is the operator <> (method _neq); everything else is returned as written. Three places had re-spelled the mapping (MapOperatorText, TypeConstraintOrError, and the relational switches in NormalisedRelationalOperator). Hold one and apply it.
  • Constructor Details

    • InequalityAsDiamond

      public InequalityAsDiamond()
  • Method Details

    • apply

      public String apply(String glyph)
      The glyph with inequality as the diamond.
      Specified by:
      apply in interface Function<String,String>
      Parameters:
      glyph - the operator's source text
      Returns:
      "<>" for "!=", otherwise the glyph unchanged