void (@NotNull CharSequence buffer, int initialState) { myState = initialState; myLastState = initialState; // the following could be parsing steps if we wanted this info as tokens final String prefix = PyStringLiteralCoreUtil.getPrefix(buffer, myStart); myIsRaw = PyStringLiteralUtil.isRawPrefix(prefix); final int quoteOffset = myStart + prefix.length(); // which quote char? char c = buffer.charAt(quoteOffset); assert (c == '"') || (c == '\'') : "String must be quoted by single or double quote. Found '" + c + "' in string " + buffer; myQuoteChar = c; myIsTriple = (buffer.length() > quoteOffset + 2) && (buffer.charAt(quoteOffset + 1) == c) && (buffer.charAt(quoteOffset + 2) == c); }