2inline bool plExpressionParser::AcceptStatementTerminator()
5 plTokenParseUtils::Accept(m_TokenStream, m_uiCurrentToken,
";");
10 plUInt32 uiAcceptedToken = 0;
11 if (plTokenParseUtils::Accept(m_TokenStream, m_uiCurrentToken, sToken, &uiAcceptedToken) ==
false)
14 auto pToken = m_TokenStream[uiErrorToken];
15 ReportError(pToken, plFmt(
"Syntax error, expected {} but got {}", sToken, pToken->m_DataView));
19 if (pExpectedToken !=
nullptr)
21 *pExpectedToken = m_TokenStream[uiAcceptedToken];
29 plUInt32 uiAcceptedToken = 0;
30 if (plTokenParseUtils::Accept(m_TokenStream, m_uiCurrentToken, Type, &uiAcceptedToken) ==
false)
33 auto pToken = m_TokenStream[uiErrorToken];
34 ReportError(pToken, plFmt(
"Syntax error, expected token type {} but got {}", plTokenType::EnumNames[Type], plTokenType::EnumNames[pToken->m_iType]));
38 if (pExpectedToken !=
nullptr)
40 *pExpectedToken = m_TokenStream[uiAcceptedToken];
plUInt32 GetCount() const
Returns the number of active elements in the array.
Definition ArrayBase_inl.h:172
static void Error(plLogInterface *pInterface, const plFormatString &string)
An error that needs to be fixed as soon as possible.
Definition Log.cpp:375
plStringBuilder is a class that is meant for creating and modifying strings.
Definition StringBuilder.h:35
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
constexpr PL_ALWAYS_INLINE T Min(T f1, T f2)
Returns the smaller value, f1 or f2.
Definition Math_inl.h:27
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54
Represents one piece of tokenized text in a document.
Definition Tokenizer.h:37
plUInt32 m_uiLine
The line in which the token appeared.
Definition Tokenizer.h:50
plUInt32 m_uiColumn
The column in the line, at which the token string started.
Definition Tokenizer.h:53
plHashedString m_File
The file in which the token appeared.
Definition Tokenizer.h:63
Enum
Definition Tokenizer.h:13
@ Newline
Either ' ' or '\r '.
Definition Tokenizer.h:18