code: private KeyToken key(Token prev) {
  
      // Store keys as normal Strings; we don't want keys to contain spans.
      StringBuilder sb = new StringBuilder();
  
      // Consume the opening '{'.
      consume();
      while ((curChar >= 'a' && curChar <= 'z') || curChar == '_') {
        sb.append(curChar);
        consume();
      }
  
      // Consume the closing '}'.
      if (curChar != '}') {
        throw new IllegalArgumentException("Unexpected character '" + curChar
            + "'; expecting lower case a-z, '_', or '}'");
      }
      consume();
  
      // Disallow empty keys: {}.
      if (sb.length() == 0) {
        throw new IllegalArgumentException("Empty key: {}");
      }
  
      String key = sb.toString();
      keys.add(key);
      return new KeyToken(prev, key);
    }
docs: Parses a key: "{some_key}".