aboutsummaryrefslogtreecommitdiffstats
path: root/examples/Kaleidoscope/Chapter2/toy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/Kaleidoscope/Chapter2/toy.cpp')
-rw-r--r--examples/Kaleidoscope/Chapter2/toy.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/Kaleidoscope/Chapter2/toy.cpp b/examples/Kaleidoscope/Chapter2/toy.cpp
index 23d45ae..cd90139 100644
--- a/examples/Kaleidoscope/Chapter2/toy.cpp
+++ b/examples/Kaleidoscope/Chapter2/toy.cpp
@@ -1,3 +1,4 @@
+#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <map>
@@ -74,7 +75,7 @@ static int gettok() {
//===----------------------------------------------------------------------===//
// Abstract Syntax Tree (aka Parse Tree)
//===----------------------------------------------------------------------===//
-
+namespace {
/// ExprAST - Base class for all expression nodes.
class ExprAST {
public:
@@ -126,6 +127,7 @@ class FunctionAST {
public:
FunctionAST(PrototypeAST *proto, ExprAST *body) {}
};
+} // end anonymous namespace
//===----------------------------------------------------------------------===//
// Parser
@@ -157,7 +159,6 @@ static int GetTokPrecedence() {
/// Error* - These are little helper functions for error handling.
ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
PrototypeAST *ErrorP(const char *Str) { Error(Str); return 0; }
-FunctionAST *ErrorF(const char *Str) { Error(Str); return 0; }
static ExprAST *ParseExpression();