private void tryCreateEmbeddedLexer() {
    IElementType token = myDelegate.getTokenType();
    if (token == null) {
      return;
    }
    HtmlEmbedment embedment = acquireHtmlEmbedmentInfo();
    if (embedment != null && !embedment.getRange().isEmpty()) {
      if (hasNoLayers) LayeredLexer.ourDisableLayersFlag.set(Boolean.TRUE);
      try {
        embeddedLexer = embedment.createHighlightingLexer();
      }
      finally {
        if (hasNoLayers) LayeredLexer.ourDisableLayersFlag.set(null);
      }
      if (embeddedLexer != null) {
        skipEmbedment(embedment);
        embeddedLexer.start(
          getBufferSequence(),
          embedment.getRange().getStartOffset(),
          embedment.getRange().getEndOffset(),
          embeddedLexer instanceof EmbedmentLexer ? ((EmbedmentLexer)embeddedLexer).getEmbeddedInitialState(myDelegate.getTokenType()) : 0
        );

        if (embeddedLexer.getTokenType() == null) {
          // no content for embedment
          embeddedLexer = null;
        }
      }
    }
  }
private void tryCreateEmbeddedLexer()