mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[apps/reader] Support de \pi & \theta (compile mais n'affiche pas dans reader)
This commit is contained in:
@@ -113,8 +113,21 @@ Layout TexParser::popCommand() {
|
||||
return popSqrtCommand();
|
||||
}
|
||||
}
|
||||
else if (strncmp(k_thetaCommand, m_text, strlen(k_thetaCommand)) == 0) {
|
||||
m_text += strlen(k_thetaCommand);
|
||||
if (*m_text == ' ') {
|
||||
return popThetaCommand();
|
||||
}
|
||||
}
|
||||
else if (strncmp(k_piCommand, m_text, strlen(k_piCommand)) == 0) {
|
||||
m_text += strlen(k_piCommand);
|
||||
if (*m_text == ' ') {
|
||||
return popPiCommand();
|
||||
}
|
||||
}
|
||||
|
||||
m_hasError = true;
|
||||
return popFracCommand();
|
||||
return LayoutHelper::String(m_text, strlen(m_text));
|
||||
}
|
||||
|
||||
Layout TexParser::popFracCommand() {
|
||||
@@ -127,12 +140,19 @@ Layout TexParser::popSqrtCommand() {
|
||||
}
|
||||
m_text++;
|
||||
if (*m_text == '[') {
|
||||
return NthRootLayout::Builder(popText(']'),popBlock());
|
||||
return NthRootLayout::Builder(popText(']'), popBlock());
|
||||
}
|
||||
else {
|
||||
return NthRootLayout::Builder(popBlock());
|
||||
}
|
||||
}
|
||||
|
||||
Layout TexParser::popThetaCommand() {
|
||||
return CodePointLayout::Builder(UCodePointGreekSmallLetterTheta);
|
||||
}
|
||||
|
||||
Layout TexParser::popPiCommand() {
|
||||
return CodePointLayout::Builder(UCodePointGreekSmallLetterPi);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,12 +20,16 @@ private:
|
||||
Layout popCommand();
|
||||
Layout popFracCommand();
|
||||
Layout popSqrtCommand();
|
||||
Layout popPiCommand();
|
||||
Layout popThetaCommand();
|
||||
const char * m_text;
|
||||
const char * m_endOfText;
|
||||
bool m_hasError;
|
||||
|
||||
static constexpr char const * k_fracCommand = "frac";
|
||||
static constexpr char const * k_sqrtCommand = "sqrt";
|
||||
static constexpr char const * k_thetaCommand = "theta";
|
||||
static constexpr char const * k_piCommand = "pi";
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user