// Path: src/main/java/org/antlr/jetbrains/st4plugin/psi/STGroupTokenTypes.java
// public static TokenIElementType getTokenElementType(@MagicConstant(valuesFromClass = STGLexer.class) int ruleIndex) {
//     return TOKEN_ELEMENT_TYPES.get(ruleIndex);
// }


import com.intellij.openapi.util.TextRange;
import com.intellij.psi.LiteralTextEscaper;
import com.intellij.psi.PsiLanguageInjectionHost;
import org.antlr.jetbrains.st4plugin.parsing.STGLexer;
import org.jetbrains.annotations.NotNull;
import static org.antlr.jetbrains.st4plugin.psi.STGroupTokenTypes.getTokenElementType;
package org.antlr.jetbrains.st4plugin.psi;



/**
 * Removes escaped quotes from subtemplates when parsing them as {@link org.antlr.jetbrains.st4plugin.STLanguage}
 * files.
 */
class TemplateContentLiteralTextEscaper extends LiteralTextEscaper<PsiLanguageInjectionHost> {

    private int[] offsetsFromDecodedToHost = new int[0];

    public TemplateContentLiteralTextEscaper(TemplateContentElement templateContentElement) {
        super(templateContentElement);
    }

    @Override
    public boolean decode(@NotNull TextRange rangeInsideHost, @NotNull StringBuilder outChars) {
        String subTemplate = rangeInsideHost.substring(myHost.getText());

// Path: src/main/java/org/antlr/jetbrains/st4plugin/psi/STGroupTokenTypes.java
// public static TokenIElementType getTokenElementType(@MagicConstant(valuesFromClass = STGLexer.class) int ruleIndex) {
//     return TOKEN_ELEMENT_TYPES.get(ruleIndex);
// }


// Path: src/main/java/org/antlr/jetbrains/st4plugin/psi/TemplateContentLiteralTextEscaper.java
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.LiteralTextEscaper;
import com.intellij.psi.PsiLanguageInjectionHost;
import org.antlr.jetbrains.st4plugin.parsing.STGLexer;
import org.jetbrains.annotations.NotNull;
import static org.antlr.jetbrains.st4plugin.psi.STGroupTokenTypes.getTokenElementType;

package org.antlr.jetbrains.st4plugin.psi;



/**
 * Removes escaped quotes from subtemplates when parsing them as {@link org.antlr.jetbrains.st4plugin.STLanguage}
 * files.
 */
class TemplateContentLiteralTextEscaper extends LiteralTextEscaper<PsiLanguageInjectionHost> {

    private int[] offsetsFromDecodedToHost = new int[0];

    public TemplateContentLiteralTextEscaper(TemplateContentElement templateContentElement) {
        super(templateContentElement);
    }

    @Override
    public boolean decode(@NotNull TextRange rangeInsideHost, @NotNull StringBuilder outChars) {
        String subTemplate = rangeInsideHost.substring(myHost.getText());

        if (myHost.getNode().getFirstChildNode().getElementType() == getTokenElementType(STGLexer.STRING)