java.lang.Object
org.kink_lang.kink.internal.compile.javaclassir.KeyStrSupplier

public class KeyStrSupplier extends Object
Generates unique key strings.
  • Constructor Details

    • KeyStrSupplier

      public KeyStrSupplier()
  • Method Details

    • newKeyStr

      public String newKeyStr(String base)
      Returns a key str unique in this supplier.

      For the first invocation with base=Foo, this method returns "#Foo".

      For the second invocation with base=Foo, this method returns "#Foo#1", for the third, returns "#Foo#2" ...

      Why it does not add the count for the first invocation? → Answer: to make it easy to write tests of codegen.

      Parameters:
      base - the base of the key str. It must not contain "#".
      Returns:
      a uniuqe key str within this supplier.