mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[poincare/parser] Parser::IsReservedName
This commit is contained in:
@@ -13,6 +13,13 @@ Expression Parser::parse() {
|
||||
return Expression();
|
||||
}
|
||||
|
||||
bool Parser::IsReservedName(const char * name, size_t nameLength, const Expression::FunctionHelper * const * * functionHelper) {
|
||||
return IsReservedFunctionName(name, nameLength, functionHelper)
|
||||
|| IsSpecialIdentifierName(name, nameLength);
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
bool Parser::IsReservedFunctionName(const char * name, size_t nameLength, const Expression::FunctionHelper * const * * functionHelper) {
|
||||
const Expression::FunctionHelper * const * reservedFunction = &s_reservedFunctions[0];
|
||||
assert(reservedFunction < s_reservedFunctionsUpperBound);
|
||||
|
||||
@@ -30,10 +30,12 @@ public:
|
||||
Expression parse();
|
||||
Status getStatus() const { return m_status; }
|
||||
|
||||
static bool IsReservedName(const char * name, size_t nameLength, const Expression::FunctionHelper * const * * functionHelper = nullptr);
|
||||
|
||||
private:
|
||||
static bool IsReservedFunctionName(const char * name, size_t nameLength, const Expression::FunctionHelper * const * * functionHelper = nullptr);
|
||||
static bool IsSpecialIdentifierName(const char * name, size_t nameLength);
|
||||
|
||||
private:
|
||||
Expression parseUntil(Token::Type stoppingType);
|
||||
|
||||
// Methods on Tokens
|
||||
|
||||
Reference in New Issue
Block a user