mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-29 10:31:14 -03:00
[muParser] Remove ecINTERNAL_ERROR
Internal errors should not be represented as exceptions, but instead as assertion failures.
This commit is contained in:
@@ -244,7 +244,7 @@ namespace mu
|
||||
void SetIdx(int a_iIdx)
|
||||
{
|
||||
if (m_iCode!=cmSTRING || a_iIdx<0)
|
||||
throw ParserError(ecINTERNAL_ERROR);
|
||||
assert(0 && "muParser internal error");
|
||||
|
||||
m_iIdx = a_iIdx;
|
||||
}
|
||||
@@ -260,7 +260,7 @@ namespace mu
|
||||
int GetIdx() const
|
||||
{
|
||||
if (m_iIdx<0 || m_iCode!=cmSTRING )
|
||||
throw ParserError(ecINTERNAL_ERROR);
|
||||
assert(0 && "muParser internal error");
|
||||
|
||||
return m_iIdx;
|
||||
}
|
||||
@@ -300,10 +300,10 @@ namespace mu
|
||||
int GetPri() const
|
||||
{
|
||||
if ( !m_pCallback.get())
|
||||
throw ParserError(ecINTERNAL_ERROR);
|
||||
assert(0 && "muParser internal error");
|
||||
|
||||
if ( m_pCallback->GetCode()!=cmOPRT_BIN && m_pCallback->GetCode()!=cmOPRT_INFIX)
|
||||
throw ParserError(ecINTERNAL_ERROR);
|
||||
assert(0 && "muParser internal error");
|
||||
|
||||
return m_pCallback->GetPri();
|
||||
}
|
||||
@@ -312,7 +312,7 @@ namespace mu
|
||||
EOprtAssociativity GetAssociativity() const
|
||||
{
|
||||
if (m_pCallback.get()==NULL || m_pCallback->GetCode()!=cmOPRT_BIN)
|
||||
throw ParserError(ecINTERNAL_ERROR);
|
||||
assert(0 && "muParser internal error");
|
||||
|
||||
return m_pCallback->GetAssociativity();
|
||||
}
|
||||
@@ -362,7 +362,7 @@ namespace mu
|
||||
TBase* GetVar() const
|
||||
{
|
||||
if (m_iCode!=cmVAR)
|
||||
throw ParserError(ecINTERNAL_ERROR);
|
||||
assert(0 && "muParser internal error");
|
||||
|
||||
return (TBase*)m_pTok;
|
||||
}
|
||||
@@ -377,7 +377,7 @@ namespace mu
|
||||
assert(m_pCallback.get());
|
||||
|
||||
if (!m_pCallback->GetAddr())
|
||||
throw ParserError(ecINTERNAL_ERROR);
|
||||
assert(0 && "muParser internal error");
|
||||
|
||||
return m_pCallback->GetArgc();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user