m_index for Parser
This commit is contained in:
parent
6eb401d04d
commit
6672a10c08
@ -31,3 +31,18 @@ Parser::ErrorOr<ExprNode> Parser::walk_expr()
|
|||||||
{
|
{
|
||||||
return ErrorOr<ExprNode>(new ExprNode()); // constructor does not want to accept a shared_ptr<T> in the argument list, thats why im not using make_shared here
|
return ErrorOr<ExprNode>(new ExprNode()); // constructor does not want to accept a shared_ptr<T> in the argument list, thats why im not using make_shared here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Parser::ErrorOr<NumberNode> Parser::walk_number()
|
||||||
|
{
|
||||||
|
return ErrorOr<NumberNode>(new NumberNode());
|
||||||
|
}
|
||||||
|
|
||||||
|
void Parser::save_current_position()
|
||||||
|
{
|
||||||
|
saved_m_index = m_index;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Parser::restore_current_position()
|
||||||
|
{
|
||||||
|
m_index = saved_m_index;
|
||||||
|
}
|
||||||
|
@ -38,6 +38,12 @@ private:
|
|||||||
|
|
||||||
ErrorOr<ExprNode> walk_expr();
|
ErrorOr<ExprNode> walk_expr();
|
||||||
ErrorOr<NumberNode> walk_number();
|
ErrorOr<NumberNode> walk_number();
|
||||||
|
|
||||||
|
int m_index;
|
||||||
|
int saved_m_index;
|
||||||
|
|
||||||
|
void save_current_position();
|
||||||
|
void restore_current_position();
|
||||||
public:
|
public:
|
||||||
~Parser();
|
~Parser();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user