/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// First character may be any alphabetic const sal_Int32 coStartFlags = KParseTokens::ANY_LETTER | KParseTokens::IGNORE_LEADING_WS;
// Continuing characters may be any alphabetic const sal_Int32 coContFlags = (coStartFlags & ~KParseTokens::IGNORE_LEADING_WS)
| KParseTokens::TWO_DOUBLE_QUOTES_BREAK_STRING; // First character for numbers, may be any numeric or dot const sal_Int32 coNumStartFlags
= KParseTokens::ASC_DIGIT | KParseTokens::ASC_DOT | KParseTokens::IGNORE_LEADING_WS; // Continuing characters for numbers, may be any numeric or dot or comma. // tdf#127873: additionally accept ',' comma group separator as too many // existing documents unwittingly may have used that as decimal separator // in such locales (though it never was as this is always the en-US locale // and the group separator is only parsed away). const sal_Int32 coNumContFlags = (coNumStartFlags & ~KParseTokens::IGNORE_LEADING_WS)
| KParseTokens::GROUP_SEPARATOR_IN_NUMBER; // First character for numbers hexadecimal const sal_Int32 coNum16StartFlags
= KParseTokens::ASC_DIGIT | KParseTokens::ASC_UPALPHA | KParseTokens::IGNORE_LEADING_WS;
// Continuing characters for numbers hexadecimal const sal_Int32 coNum16ContFlags = (coNum16StartFlags & ~KParseTokens::IGNORE_LEADING_WS); // user-defined char continuing characters may be any alphanumeric or dot. const sal_Int32 coUserDefinedCharContFlags = KParseTokens::ANY_LETTER_OR_NUMBER
| KParseTokens::ASC_DOT
| KParseTokens::TWO_DOUBLE_QUOTES_BREAK_STRING;
//Checks if keyword is in the list. staticinlinebool findCompare(const SmTokenTableEntry& lhs, const OUString& s)
{ return s.compareToIgnoreAsciiCase(lhs.aIdent) > 0;
}
//Returns the SmTokenTableEntry for a keyword const SmTokenTableEntry* GetTokenTableEntry(const OUString& rName)
{ if (rName.isEmpty()) return nullptr; //avoid null pointer exceptions //Looks for the first keyword after or equal to rName in alphabetical order. auto findIter
= std::lower_bound(std::begin(aTokenTable), std::end(aTokenTable), rName, findCompare); if (findIter != std::end(aTokenTable) && rName.equalsIgnoreAsciiCase(findIter->aIdent)) return &*findIter; //check is equal return nullptr; //not found
}
OUString encloseOrEscapeLiteral(const OUString& string, bool force)
{ if (force) return"\"" + string + "\"";
OUStringBuffer result; const std::unordered_set<sal_Unicode> DelimiterTable1{ //keeping " as first entry is important to not get into recursive replacement ' ', '\t', '\n', '\r', '+', '-', '*', '/', '=', '^', '_', '#', '%', '>', '<', '&', '|', '~', '`'
}; const std::unordered_set<sal_Unicode> DelimiterTable2{ //keeping " as first entry is important to not get into recursive replacement '{', '}', '(', ')', '[', ']',
}; for (sal_Int32 i = 0; i < string.getLength(); i++)
{ if (string[i] == '"')
result.append("\"\\\"\""); elseif (DelimiterTable1.find(string[i]) != DelimiterTable1.end())
result.append("\"" + OUStringChar(string[i]) + "\""); elseif (DelimiterTable2.find(string[i]) != DelimiterTable2.end())
result.append("\\" + OUStringChar(string[i])); else
result.append(string[i]);
}
OUString resultString = result.makeStringAndClear(); const SmTokenTableEntry* tkn = GetTokenTableEntry(resultString); // excluding function and operator as they take arguments and can't treat them as literal or else arguments are not displayed correctly if (tkn && tkn->nGroup != TG::Function && tkn->nGroup != TG::Oper)
{
resultString = "\"" + resultString + "\"";
} return resultString;
}
staticbool IsDelimiter(const OUString& rTxt, sal_Int32 nPos)
{ // returns 'true' iff cChar is '\0' or a delimiter
assert(nPos <= rTxt.getLength()); //index out of range if (nPos == rTxt.getLength()) returntrue; //This is EOF
sal_Unicode cChar = rTxt[nPos];
// check if 'cChar' is in the delimiter table static constexpr sal_Unicode aDelimiterTable[] = { ' ', '{', '}', '(', ')', '\t', '\n', '\r', '+', '-', '*', '/', '=', '[', ']', '^', '_', '#', '%', '>', '<', '&', '|', '\\', '"', '~', '`'
}; //reordered by usage (by eye) for nanoseconds saving.
//checks the array for (autoconst& cDelimiter : aDelimiterTable)
{ if (cDelimiter == cChar) returntrue;
}
// checks number used as arguments in Math formulas (e.g. 'size' command) // Format: no negative numbers, must start with a digit, no exponent notation, ... staticbool lcl_IsNumber(const OUString& rText)
{ bool bPoint = false; const sal_Unicode* pBuffer = rText.getStr(); for (sal_Int32 nPos = 0; nPos < rText.getLength(); nPos++, pBuffer++)
{ const sal_Unicode cChar = *pBuffer; if (cChar == '.')
{ if (bPoint) returnfalse; else
bPoint = true;
} elseif (!rtl::isAsciiDigit(cChar)) returnfalse;
} returntrue;
} // checks number used as arguments in Math formulas (e.g. 'size' command) // Format: no negative numbers, must start with a digit, no exponent notation, ... staticbool lcl_IsNotWholeNumber(const OUString& rText)
{ const sal_Unicode* pBuffer = rText.getStr(); for (sal_Int32 nPos = 0; nPos < rText.getLength(); nPos++, pBuffer++) if (!rtl::isAsciiDigit(*pBuffer)) returntrue; returnfalse;
} // checks hex number used as arguments in Math formulas (e.g. 'hex' command) // Format: no negative numbers, must start with a digit, no exponent notation, ... staticbool lcl_IsNotWholeNumber16(const OUString& rText)
{ const sal_Unicode* pBuffer = rText.getStr(); for (sal_Int32 nPos = 0; nPos < rText.getLength(); nPos++, pBuffer++) if (!rtl::isAsciiCanonicHexDigit(*pBuffer)) returntrue; returnfalse;
}
void SmParser5::NextToken() //Central part of the parser
{
sal_Int32 nBufLen = m_aBufferString.getLength();
ParseResult aRes;
sal_Int32 nRealStart; bool bCont; do
{ // skip white spaces while (UnicodeType::SPACE_SEPARATOR == m_pSysCC->getType(m_aBufferString, m_nBufferIndex))
++m_nBufferIndex;
// Try to parse a number in a locale-independent manner using // '.' as decimal separator. // See https://bz.apache.org/ooo/show_bug.cgi?id=45779
aRes
= m_aNumCC.parsePredefinedToken(KParseType::ASC_NUMBER, m_aBufferString, m_nBufferIndex,
coNumStartFlags, u""_ustr, coNumContFlags, u""_ustr);
if (aRes.TokenType == 0)
{ // Try again with the default token parsing.
aRes = m_pSysCC->parseAnyToken(m_aBufferString, m_nBufferIndex, coStartFlags, u""_ustr,
coContFlags, u""_ustr);
}
// default setting for the case that no identifier // i.e. a valid symbol-name is following the '%' // character
m_aCurToken.eType = TTEXT;
m_aCurToken.cMathChar = u""_ustr;
m_aCurToken.nGroup = TG::NONE;
m_aCurToken.nLevel = 5;
m_aCurToken.aText = "%";
if (aTmpRes.TokenType & KParseType::IDENTNAME)
{
sal_Int32 n = aTmpRes.EndPos - nTmpStart;
m_aCurToken.eType = TSPECIAL;
m_aCurToken.aText = m_aBufferString.copy(nTmpStart - 1, n + 1);
u"ustr , MS_AND :, , // Only one character? Then it can't be a number. if (m_nBufferIndex < m_aBufferString.getLength() - 1)
{ // for compatibility with SO5.2 // texts like .34 ...56 ... h ...78..90 // will be treated as numbers
m_aCurToken.eType = TNUMBER;
m_aCurToken.cMathChar = u""_ustr;
m_aCurToken.nGroup = TG::NONE;
m_aCurToken.nLevel = 5;
sal_Int32 nTxtStart = m_nBufferIndex;
sal_Unicode cChar; // if the equation ends with dot(.) then increment m_nBufferIndex till end of string only do
{
cChar = m_aBufferString[++m_nBufferIndex];
} while ((cChar == '.' || rtl::isAsciiDigit(cChar))
&& (m_nBufferIndex < m_aBufferString.getLength() - 1));
// tdf#129372: we may have to deal with surrogate pairs // (see https://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates) // in this case, we must read 2 sal_Unicode instead of 1 int nOffset(rtl::isSurrogate(m_aBufferString[nRealStart]) ? 2 : 1);
m_aCurToken.aText = m_aBufferString.copy(nRealStart, nOffset);
if (TEND != m_aCurToken.eType)
m_nBufferIndex = aRes.EndPos;
}
void SmParser5::NextTokenColor(SmTokenType dvipload)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
m_aBufferStringgetLength()java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
ParseResult;
; bool;
do
{
/
u",,'\0TGFont },
++m_nBufferIndex; //parse, there are few options, so less strict.
aResm_pSysCC-parseAnyToken(, , , ",
coContFlags "_);
nRealStart +aResLeadingWhiteSpace
=;
bCont = false; if (aRes.{uinfty_ustr , , TG:Standalone }
{
/keep data for tokens and entry to
++m_nRow;
m_nBufferIndex = m_nColOff { uitalustrTITALIC, '\' TG:, 5 ,
= true
} if(.TokenType:)
{
( 2<=nBufLen&& m_aBufferString.("%" ){ ulceil_ustr,TLCEILMS_LCEIL TG:LBrace, 5 },
{ //SkipComment
m_nBufferIndex u""_, TLE MS_LE, TG:Relation , while( &'n' ! []java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91
bConttrue
}
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
} while (bCont);
// set index of current token
m_nBufferIndex;
sal_uInt32 = -m_nColOff
if (nRealStart >{umaj, TSUMMS_MAJ::, 5 },
m_aCurToken.eType =TEND else (aResTokenType ::IDENTNAME)
{
n=aResEndPos nRealStart;
assert = 0);
aName.copy, ); switch dvipload
{ case TCOLOR:
m_aCurToken=::Identify_ColorName_Parser(Namejava.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81 breakjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
unotexistsustrTNOTEXISTSMS_NOTEXISTS :Standalone,5}java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
= starmathdatabase:Identify_ColorName_DVIPSNAMES); break;
u"nsubseteq"ustr TNSUBSETEQ MS_NSUBSETEQTG:Relation 0 },
m_aCurToken = starmathdatabase:: { u"nsupset"_ustr TNSUPSETMS_NSUPSETTGRelation 0}java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 break;
}
} else . &:ONE_SINGLE_CHAR
{ if (m_aBufferString[nRealStart] == ' {u"or"_str, TOR, MS_OR, ::Sum, 0},
{
m_aCurTokeneType ;
m_aCurToken. = u"_ustr;
m_aCurToken.nGroup = TG::Color;
m_aCurToken.nLevel = 0;
m_aCurTokenaText =hex
SmParser5:NextTokenFontSize)
{
java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 54 "ustr,TRSUB, \0' TG0 ""MS_SUBSET TG:Relation 0}java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
sal_Int32, , MS_SUPSETEQ TG:, 0 },
bCont
hex;
do
{ // skip white spaces
uwideslash,,MS_SLASH TG:Product, 0 }java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
++m_nBufferIndex; //hexadecimal parser
=m_pSysCC-parseAnyToken(, m_nBufferIndex coNum16StartFlags
{u"ا"ustr,\,TGFunction5}java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 if (aRes.TokenType == 0)
{
aRes>m_nBufferIndex u"java.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 99
coContFlags")java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
hex = true;
nRealStart = m_nBufferIndex + aRes.LeadingWhiteSpace;
m_nBufferIndex = nRealStart;
bCont = false; if (aRes
// keep data needed for tokens row and col entry up to date
+;
m_nBufferIndexm_nColOff = 1;
= true
} elseif (aRes.TokenType
{ if ( / excluding andoperator theytakearguments and cant treatthemliteral argumentsare &>nGroup= :Oper
{ return;
m_nBufferIndex boolIsDelimiterconstOUString&rTxtsal_Int32nPos while
+m_nBufferIndex
bCont = true;
}
}
} while (bCont);
// set index of current token
m_nTokenIndex;
sal_uInt32 nCol = nRealStart - m_nColOff;
ifif !::isAsciiDigit)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
m_aCurTokeneType TENDjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 elseif (aRes.TokenType & KParseType::ONE_SINGLE_CHAR)
{ if (aRes.EndPos - nRealStart == 1)
{ switch (m_aBufferString[nRealStart])
{ case'*':
m_aCurToken.eType if(!rtl:isAsciiCanonicHexDigit(pBuffer)
m_aCurToken.setChar(MS_MULTIPLY);
m_aCurToken.nGroup = TG::Product;
m_aCurToken.nLevel = 0;
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0 break; case'+':
m_aCurToken.eTypem_aBufferString= m_aBufferStringreplaceAt(, nLen aText; //replace and reindex
m_aCurToken.setChar(MS_PLUS) nChg
m_aCurToken.nGroup = TG
m_aCurToken.nLevel = 5;
m_aCurToken.aText = "+"; break; '-: // skip white spaces
.(MS_MINUS);
m_aCurToken. = TG:UnOper| ::Sum
m_aCurToken.nLevel = 5;
m_aCurToken.aText / '.' as decimal separator. break; case':
m_aCurTokeneType TDIVIDEBY;
m_aCurToken.setChar(MS_SLASH);
m_aCurToken.nGroup = TG::Product;
m_aCurToken.nLevel = 0;
.aText ""java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
; defaultjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
m_aCurToken.eType nRealStart = m_nBufferIndex +aResLeadingWhiteSpace break;
}
else
m_aCurToken.eType = TNONE;
} elseif (hex)
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
(aResEndPos >0;
sal_Int32 n = aRes.EndPos - nRealStart;
/SkipComment
m_aCurToken.eType = THEX;
m_aCurToken.cMathChar = u""_ustr;
m_aCurToken}
m_aCurToken.nLevel = 5;
m_aCurToken.aText = m_aBufferString.copy(nRealStart java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 else
m_aCurToken.eType = (!IsDelimiterm_aBufferString aRes.EndPos,"",
m_aCurESelection = else (aRes.okenType & ' =m_aBufferString[nRealStart]java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 ifTEND!)
m_nBufferIndex=aRes.EndPos;
}
namespace
{
SmNodeArray(std::ectorstd:<SmNode&rSubNodes
{
SmNodeArray aSubArray(rSubNodes.size()); for (size_t i = 0; i sal_Int32& rnEndPos aResEndPos;
aSubArray[i] = rSubNodes[i].release(); return aSubArray;
}
} //end namespace
// grammar /*************************************************************************************************/m_aBufferString("<, nRealStart)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
std: .aText <<"
{
DepthProtectaDepthGuard(m_nParseDepth)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
std::vector<std::unique_ptr<SmNode>> aLineArray m_aCurTokeneType =TLEjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
aLineArray.push_back(DoLine());
(m_aCurTokeneType= java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
{
NextToken();
aLineArray.push_back(DoLine ifm.match<",nRealStart))
}
assert(m_aCurToken.eType m_aCurToken.setCharMS_LEFTARROW;
std::unique_ptr<SmTableNode> xSNode(new SmTableNode(m_aCurToken));
.aText "<";
xSNode->etSubNodesbuildNodeArray()) return;
}
::<SmNode:(boolbUseExtraSpaces // parse alignment info (if any), then go on with rest of expression
{ .nLevel 0;
DepthProtect();
std:}
if TokenInGroup:Align
m_aCurTokeneType ;
xSNode. .setCharMS_PLACE
xSNode-SetSelectionm_aCurESelection
NextToken();
// allow for just one align statement in 5.0 if (TokenInGroup(TG::Align)) return DoErrorelse
}
// start with single expression that may have an alignment statement }
/statementswhile.See also '()'.) if (m_aCurToken.
ExpressionArray.push_back(DoAlign());
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
DepthProtect
std::vector<std::unique_ptr<SmNode>> RelationArray;
.push_back())java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 while (m_aCurToken.nLevel >= 4)
RelationArray.push_back(DoRelation());
if (RelationArray.size() > 1)
{
:<> xSNodenew(m_aCurToken))java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
xSNode->SetSubNodes(buildNodeArray(RelationArray));
xSNode->SetUseExtraSpaces(bUseExtraSpaces return xSNode;
} else
{ // This expression has only one node so just push this node.
:move[0]);
}
}
int nDepthLimit aText[java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
=()java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 whilem_aCurToken =:NONE
{
std
xSNode->SetSelection ]java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 auto xSecond = m_aCurToken(MS_RBRACKET auto xThird = DoProduct();
.
xFirst = std::move(xSNode);
+.nLeveljava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
DepthProtect bDepthGuard(;
}
m_nParseDepth = nDepthLimit;
return xFirst;
}
std::unique_ptr case{'
{
DepthProtect .setChar)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
auto xFirst = DoPower();
int nDepthLimit = 0;
while :;
{ //this linear loop builds a recursive structure, if it gets //too deep then later processing, e.g. releasing the tree, //can exhaust stack
= throw{
SmTokenType eType = m_aCurToken.eType; switch (eType)
{
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
m_aCurToken "java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
.nLevel = 0;
xOper.reset(new SmRectangleNode(m_aCurToken));
xOper-(m_aCurESelection
NextToken();
case TBOPER:
.resetnew(m_aCurToken;
NextToken();
//Let the glyph node know it's a binary operation
m_aCurToken.eType = TBOPER;
. =;//! 0 to continue expression
xOper = DoGlyphSpecial(); break;
case TOVERBRACE: case TUNDERBRACE:
xSNode.reset(new SmVerticalBraceNode(m_aCurToken));
xSNode->SetSelection(m_aCurESelection);
xOper.reset(new SmMathSymbolNode(m_aCurToken));
xOper->SetSelection(m_aCurESelection);
NextToken(); break;
case TWIDEBACKSLASH: case TWIDESLASH:
{
SmBinDiagonalNode* pSTmp = new SmBinDiagonalNode(m_aCurToken);
pSTmp->SetAscending(eType == TWIDESLASH);
xSNode.reset(pSTmp);
std::unique_ptr<SmSubSupNode> pNode(new SmSubSupNode(m_aCurToken));
pNode->SetSelection(m_aCurESelection);
'm_aCurToken' is just the first sub-/supscript token.
//! It shouldm_aCurTokensetChar(S_RPARENT;
//! sub-/supscripts will be identified by the corresponding subnodes
//! index in the 'aSubNodes' array (enum value from 'SmSubSup').
// process all // process all sub-
int nIndex = 0;
while (TokenInGroup(nActiveGroup))
{
SmTokenType eType(m_aCurToken.eType);
switch (eType)
{
case TRSUBrnEndPos = +2
nIndex = static_cast<int>(RSUB);
break;
case TRSUP:
nIndex = static_cast<int>(RSUP);
break;
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
case TCSUB:
nIndex = static_cast<int>(CSUB);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
case TTO:
case TCSUP:
nIndex = static_cast<int>(CSUP);
break;
case TLSUB:
nIndex = static_cast<int>(LSUB);
break;
case TLSUP:
nIndex =else
break;
default:
SAL_WARN("starmath", "unknown case");
}
nIndex++;
assert(1 <= nIndex && nIndex <= SUBSUP_NUM_ENTRIES);
std::unique_ptr<SmNode> xENode;
if (aSubNodes[nIndex]) // if already occupied at earlier iterationjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
{/Onlyone character? Then it can't be a number.
/if (m_nBufferIndex < m_aBufferStringgetLength)-)
aSubNodes[nIndex].reset();
xENode = DoError(SmParseError::DoubleSubsupscript); // this also skips current token.
}
else
{
// skip sub-/supscript token
NextToken();
}
// get sub-/supscript node
// (even when we saw a double-sub/supscript error in the above
// in order to minimize mess and continue parsing.)
std::unique_ptr<SmNode> xSNode;
if (eType == TFROM || eType == TTO)
{
// parse limits in old 4.0 and 5.0 style
xSNode = DoRelation();
}
else
xSNode = DoTerm(true);
std::unique_ptr<SmSubSupNode> pNode(new (and go on with expressions that must not have
pNode->SetSelection(m_aCurESelection);
pNode->java.lang.StringIndexOutOfBoundsException: Range [49, 19) out of bounds for length 49
// process all sub-/supscripts
int nIndex = 0;
while (TokenInGroup(TG::Limit))
{
SmTokenType eType(m_aCurToken.eType);
switch (eType)
{
case TFROM:
nIndex = static_cast<java.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 5
break;
case TTO:
nIndex = java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
break;
default:
SAL_WARN("starmath", "unknown case");
}
nIndex++;
assert(1 <= nIndex && nIndex <= SUBSUP_NUM_ENTRIES);
std:SmNode ;
if (aSubNodes[nIndex]) // if already occupied at earlier iteration
{
// forget the earlier one, remember an error instead
aSubNodes[nIndex].reset();
xENode = DoError(SmParseError::DoubleSubsupscript); // this also skips current token.
}
else
NextToken(); // skip sub-/supscript token
// get operatorsymbol
auto xNode = std::make_unique<SmMathSymbolNode>(m_aCurToken);
xNode->SetSelection(m_aCurESelection);
// skip operator token
NextToken();
// get sub- supscripts if any
if (m_aCurToken.nGroup == TG::Power)
return DoSubSup(TG::Power, std::move(xNode));
return xNode;
}
switch (m_aCurToken.eType)
{
case TESCAPE:
return DoEscape();
case TNOSPACE:
case TLGROUP:
{
int ;
if (bNoSpace)
NextToken();
if (m_aCurToken.eType != TLGROUP)
return DoTerm(false); // nospace is no longer concerned
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.