Kaydet (Commit) 657a7913 authored tarafından Takeshi Abe's avatar Takeshi Abe

starmath: Return SmGlyphSpecialNode from DoGlyphSpecial()

instead of pushing it to the stack. This spares some pops.

Change-Id: I9fc987ebf851ff6387e347a2878ff01f482d8f7f
Reviewed-on: https://gerrit.libreoffice.org/35029Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTakeshi Abe <tabe@fixedpoint.jp>
üst 0ae45758
...@@ -89,7 +89,7 @@ class SmParser ...@@ -89,7 +89,7 @@ class SmParser
void DoStack(); void DoStack();
void DoMatrix(); void DoMatrix();
void DoSpecial(); void DoSpecial();
void DoGlyphSpecial(); SmGlyphSpecialNode *DoGlyphSpecial();
// end of grammar // end of grammar
void Error(SmParseError Error); void Error(SmParseError Error);
......
...@@ -1124,9 +1124,7 @@ void SmParser::DoProduct() ...@@ -1124,9 +1124,7 @@ void SmParser::DoProduct()
//Let the glyph node know it's a binary operation //Let the glyph node know it's a binary operation
m_aCurToken.eType = TBOPER; m_aCurToken.eType = TBOPER;
m_aCurToken.nGroup = TG::Product; m_aCurToken.nGroup = TG::Product;
pOper = DoGlyphSpecial();
DoGlyphSpecial();
pOper = popOrZero(m_aNodeStack);
break; break;
case TOVERBRACE : case TOVERBRACE :
...@@ -1660,8 +1658,7 @@ void SmParser::DoUnOper() ...@@ -1660,8 +1658,7 @@ void SmParser::DoUnOper()
//Let the glyph know what it is... //Let the glyph know what it is...
m_aCurToken.eType = TUOPER; m_aCurToken.eType = TUOPER;
m_aCurToken.nGroup = TG::UnOper; m_aCurToken.nGroup = TG::UnOper;
DoGlyphSpecial(); pOper = DoGlyphSpecial();
pOper = popOrZero(m_aNodeStack);
break; break;
case TPLUS : case TPLUS :
...@@ -2253,10 +2250,11 @@ void SmParser::DoSpecial() ...@@ -2253,10 +2250,11 @@ void SmParser::DoSpecial()
NextToken(); NextToken();
} }
void SmParser::DoGlyphSpecial() SmGlyphSpecialNode *SmParser::DoGlyphSpecial()
{ {
m_aNodeStack.push_front(o3tl::make_unique<SmGlyphSpecialNode>(m_aCurToken)); auto pNode = o3tl::make_unique<SmGlyphSpecialNode>(m_aCurToken);
NextToken(); NextToken();
return pNode.release();
} }
void SmParser::Error(SmParseError eError) void SmParser::Error(SmParseError eError)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment