|
@@ -41,7 +41,7 @@ static std::unique_ptr<ExprAST> ParseExpression();
|
|
|
|
|
|
/// numberexpr ::= number
|
|
|
static std::unique_ptr<ExprAST> ParseNumberExpr() {
|
|
|
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
|
|
|
+ auto Result = llvm::make_unique<NumberExprAST>(LexerObjects::NumVal);
|
|
|
getNextToken(); // consume the number
|
|
|
return std::move(Result);
|
|
|
}
|
|
@@ -63,7 +63,7 @@ static std::unique_ptr<ExprAST> ParseParenExpr() {
|
|
|
/// ::= identifier
|
|
|
/// ::= identifier '(' expression* ')'
|
|
|
static std::unique_ptr<ExprAST> ParseIdentifierExpr() {
|
|
|
- std::string IdName = IdentifierStr;
|
|
|
+ std::string IdName = LexerObjects::IdentifierStr;
|
|
|
|
|
|
getNextToken(); // eat identifier.
|
|
|
|
|
@@ -166,7 +166,7 @@ static std::unique_ptr<PrototypeAST> ParsePrototype() {
|
|
|
if (CurTok != tok_identifier)
|
|
|
return ErrorP("Expected function name in prototype");
|
|
|
|
|
|
- std::string FnName = IdentifierStr;
|
|
|
+ std::string FnName = LexerObjects::IdentifierStr;
|
|
|
getNextToken();
|
|
|
|
|
|
if (CurTok != '(')
|
|
@@ -174,7 +174,7 @@ static std::unique_ptr<PrototypeAST> ParsePrototype() {
|
|
|
|
|
|
std::vector<std::string> ArgNames;
|
|
|
while (getNextToken() == tok_identifier)
|
|
|
- ArgNames.push_back(IdentifierStr);
|
|
|
+ ArgNames.push_back(LexerObjects::IdentifierStr);
|
|
|
if (CurTok != ')')
|
|
|
return ErrorP("Expected ')' in prototype");
|
|
|
|
|
@@ -200,8 +200,7 @@ static std::unique_ptr<FunctionAST> ParseDefinition() {
|
|
|
static std::unique_ptr<FunctionAST> ParseTopLevelExpr() {
|
|
|
if (auto E = ParseExpression()) {
|
|
|
// Make an anonymous proto.
|
|
|
- auto Proto = llvm::make_unique<PrototypeAST>("__anon_expr",
|
|
|
- std::vector<std::string>());
|
|
|
+ auto Proto = llvm::make_unique<PrototypeAST>("__anon_expr", std::vector<std::string>());
|
|
|
return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
|
|
|
}
|
|
|
return nullptr;
|