mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-23 17:28:54 +00:00
[Orc][Kaleidoscope] Remove fixed sized buffers from string conversion code and
further c++ify the Kaleidoscope/Orc tutorials. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228530 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -14,8 +14,10 @@
|
|||||||
#include "llvm/Support/TargetSelect.h"
|
#include "llvm/Support/TargetSelect.h"
|
||||||
#include "llvm/Transforms/Scalar.h"
|
#include "llvm/Transforms/Scalar.h"
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <cstdio>
|
#include <iomanip>
|
||||||
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
@@ -271,14 +273,14 @@ static int GetTokPrecedence() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
std::unique_ptr<T> ErrorU(const char *Str) {
|
std::unique_ptr<T> ErrorU(const std::string &Str) {
|
||||||
fprintf(stderr, "Error: %s\n", Str);
|
std::cerr << "Error: " << Str << "\n";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T* ErrorP(const char *Str) {
|
T* ErrorP(const std::string &Str) {
|
||||||
fprintf(stderr, "Error: %s\n", Str);
|
std::cerr << "Error: " << Str << "\n";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -644,13 +646,11 @@ static std::unique_ptr<PrototypeAST> ParseExtern() {
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// FIXME: Obviously we can do better than this
|
// FIXME: Obviously we can do better than this
|
||||||
std::string GenerateUniqueName(const char *root)
|
std::string GenerateUniqueName(const std::string &Root) {
|
||||||
{
|
|
||||||
static int i = 0;
|
static int i = 0;
|
||||||
char s[16];
|
std::ostringstream NameStream;
|
||||||
sprintf(s, "%s%d", root, i++);
|
NameStream << Root << ++i;
|
||||||
std::string S = s;
|
return NameStream.str();
|
||||||
return S;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string MakeLegalFunctionName(std::string Name)
|
std::string MakeLegalFunctionName(std::string Name)
|
||||||
@@ -670,10 +670,9 @@ std::string MakeLegalFunctionName(std::string Name)
|
|||||||
std::string legal_elements = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
std::string legal_elements = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||||
size_t pos;
|
size_t pos;
|
||||||
while ((pos = NewName.find_first_not_of(legal_elements)) != std::string::npos) {
|
while ((pos = NewName.find_first_not_of(legal_elements)) != std::string::npos) {
|
||||||
char old_c = NewName.at(pos);
|
std::ostringstream NumStream;
|
||||||
char new_str[16];
|
NumStream << (int)NewName.at(pos);
|
||||||
sprintf(new_str, "%d", (int)old_c);
|
NewName = NewName.replace(pos, 1, NumStream.str());
|
||||||
NewName = NewName.replace(pos, 1, new_str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NewName;
|
return NewName;
|
||||||
@@ -700,7 +699,7 @@ PrototypeAST* SessionContext::getPrototypeAST(const std::string &Name) {
|
|||||||
if (I != Prototypes.end())
|
if (I != Prototypes.end())
|
||||||
return I->second.get();
|
return I->second.get();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
class IRGenContext {
|
class IRGenContext {
|
||||||
public:
|
public:
|
||||||
@@ -751,11 +750,8 @@ Value *VariableExprAST::IRGen(IRGenContext &C) {
|
|||||||
// Look this variable up in the function.
|
// Look this variable up in the function.
|
||||||
Value *V = C.NamedValues[Name];
|
Value *V = C.NamedValues[Name];
|
||||||
|
|
||||||
if (V == 0) {
|
if (V == 0)
|
||||||
char ErrStr[256];
|
return ErrorP<Value>("Unknown variable name '" + Name + "'");
|
||||||
sprintf(ErrStr, "Unknown variable name %s", Name.c_str());
|
|
||||||
return ErrorP<Value>(ErrStr);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load the value.
|
// Load the value.
|
||||||
return C.getBuilder().CreateLoad(V, Name.c_str());
|
return C.getBuilder().CreateLoad(V, Name.c_str());
|
||||||
@@ -1189,7 +1185,7 @@ static void HandleDefinition(SessionContext &S, KaleidoscopeJIT &J) {
|
|||||||
IRGenContext C(S);
|
IRGenContext C(S);
|
||||||
if (auto LF = F->IRGen(C)) {
|
if (auto LF = F->IRGen(C)) {
|
||||||
#ifndef MINIMAL_STDERR_OUTPUT
|
#ifndef MINIMAL_STDERR_OUTPUT
|
||||||
fprintf(stderr, "Read function definition:");
|
std::cerr << "Read function definition:\n";
|
||||||
LF->dump();
|
LF->dump();
|
||||||
#endif
|
#endif
|
||||||
J.addModule(C.takeM());
|
J.addModule(C.takeM());
|
||||||
@@ -1216,7 +1212,7 @@ static void HandleTopLevelExpression(SessionContext &S, KaleidoscopeJIT &J) {
|
|||||||
IRGenContext C(S);
|
IRGenContext C(S);
|
||||||
if (auto ExprFunc = F->IRGen(C)) {
|
if (auto ExprFunc = F->IRGen(C)) {
|
||||||
#ifndef MINIMAL_STDERR_OUTPUT
|
#ifndef MINIMAL_STDERR_OUTPUT
|
||||||
fprintf(stderr, "Expression function:\n");
|
std::cerr << "Expression function:\n";
|
||||||
ExprFunc->dump();
|
ExprFunc->dump();
|
||||||
#endif
|
#endif
|
||||||
// Add the CodeGen'd module to the JIT. Keep a handle to it: We can remove
|
// Add the CodeGen'd module to the JIT. Keep a handle to it: We can remove
|
||||||
@@ -1232,7 +1228,7 @@ static void HandleTopLevelExpression(SessionContext &S, KaleidoscopeJIT &J) {
|
|||||||
#ifdef MINIMAL_STDERR_OUTPUT
|
#ifdef MINIMAL_STDERR_OUTPUT
|
||||||
FP();
|
FP();
|
||||||
#else
|
#else
|
||||||
fprintf(stderr, "Evaluated to %f\n", FP());
|
std::cerr << "Evaluated to " << FP() << "\n";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Remove the function.
|
// Remove the function.
|
||||||
@@ -1251,7 +1247,7 @@ static void MainLoop() {
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
#ifndef MINIMAL_STDERR_OUTPUT
|
#ifndef MINIMAL_STDERR_OUTPUT
|
||||||
fprintf(stderr, "ready> ");
|
std::cerr << "ready> ";
|
||||||
#endif
|
#endif
|
||||||
switch (CurTok) {
|
switch (CurTok) {
|
||||||
case tok_eof: return;
|
case tok_eof: return;
|
||||||
@@ -1307,10 +1303,12 @@ int main() {
|
|||||||
|
|
||||||
// Prime the first token.
|
// Prime the first token.
|
||||||
#ifndef MINIMAL_STDERR_OUTPUT
|
#ifndef MINIMAL_STDERR_OUTPUT
|
||||||
fprintf(stderr, "ready> ");
|
std::cerr << "ready> ";
|
||||||
#endif
|
#endif
|
||||||
getNextToken();
|
getNextToken();
|
||||||
|
|
||||||
|
std::cerr << std::fixed;
|
||||||
|
|
||||||
// Run the main "interpreter loop" now.
|
// Run the main "interpreter loop" now.
|
||||||
MainLoop();
|
MainLoop();
|
||||||
|
|
||||||
|
@@ -13,8 +13,10 @@
|
|||||||
#include "llvm/Support/TargetSelect.h"
|
#include "llvm/Support/TargetSelect.h"
|
||||||
#include "llvm/Transforms/Scalar.h"
|
#include "llvm/Transforms/Scalar.h"
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <cstdio>
|
#include <iomanip>
|
||||||
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
@@ -270,14 +272,14 @@ static int GetTokPrecedence() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
std::unique_ptr<T> ErrorU(const char *Str) {
|
std::unique_ptr<T> ErrorU(const std::string &Str) {
|
||||||
fprintf(stderr, "Error: %s\n", Str);
|
std::cerr << "Error: " << Str << "\n";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T* ErrorP(const char *Str) {
|
T* ErrorP(const std::string &Str) {
|
||||||
fprintf(stderr, "Error: %s\n", Str);
|
std::cerr << "Error: " << Str << "\n";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -643,13 +645,11 @@ static std::unique_ptr<PrototypeAST> ParseExtern() {
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// FIXME: Obviously we can do better than this
|
// FIXME: Obviously we can do better than this
|
||||||
std::string GenerateUniqueName(const char *root)
|
std::string GenerateUniqueName(const std::string &Root) {
|
||||||
{
|
|
||||||
static int i = 0;
|
static int i = 0;
|
||||||
char s[16];
|
std::ostringstream NameStream;
|
||||||
sprintf(s, "%s%d", root, i++);
|
NameStream << Root << ++i;
|
||||||
std::string S = s;
|
return NameStream.str();
|
||||||
return S;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string MakeLegalFunctionName(std::string Name)
|
std::string MakeLegalFunctionName(std::string Name)
|
||||||
@@ -669,10 +669,9 @@ std::string MakeLegalFunctionName(std::string Name)
|
|||||||
std::string legal_elements = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
std::string legal_elements = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||||
size_t pos;
|
size_t pos;
|
||||||
while ((pos = NewName.find_first_not_of(legal_elements)) != std::string::npos) {
|
while ((pos = NewName.find_first_not_of(legal_elements)) != std::string::npos) {
|
||||||
char old_c = NewName.at(pos);
|
std::ostringstream NumStream;
|
||||||
char new_str[16];
|
NumStream << (int)NewName.at(pos);
|
||||||
sprintf(new_str, "%d", (int)old_c);
|
NewName = NewName.replace(pos, 1, NumStream.str());
|
||||||
NewName = NewName.replace(pos, 1, new_str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NewName;
|
return NewName;
|
||||||
@@ -699,7 +698,7 @@ PrototypeAST* SessionContext::getPrototypeAST(const std::string &Name) {
|
|||||||
if (I != Prototypes.end())
|
if (I != Prototypes.end())
|
||||||
return I->second.get();
|
return I->second.get();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
class IRGenContext {
|
class IRGenContext {
|
||||||
public:
|
public:
|
||||||
@@ -750,11 +749,8 @@ Value *VariableExprAST::IRGen(IRGenContext &C) {
|
|||||||
// Look this variable up in the function.
|
// Look this variable up in the function.
|
||||||
Value *V = C.NamedValues[Name];
|
Value *V = C.NamedValues[Name];
|
||||||
|
|
||||||
if (V == 0) {
|
if (V == 0)
|
||||||
char ErrStr[256];
|
return ErrorP<Value>("Unknown variable name '" + Name + "'");
|
||||||
sprintf(ErrStr, "Unknown variable name %s", Name.c_str());
|
|
||||||
return ErrorP<Value>(ErrStr);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load the value.
|
// Load the value.
|
||||||
return C.getBuilder().CreateLoad(V, Name.c_str());
|
return C.getBuilder().CreateLoad(V, Name.c_str());
|
||||||
@@ -1191,7 +1187,7 @@ static void HandleDefinition(SessionContext &S, KaleidoscopeJIT &J) {
|
|||||||
IRGenContext C(S);
|
IRGenContext C(S);
|
||||||
if (auto LF = F->IRGen(C)) {
|
if (auto LF = F->IRGen(C)) {
|
||||||
#ifndef MINIMAL_STDERR_OUTPUT
|
#ifndef MINIMAL_STDERR_OUTPUT
|
||||||
fprintf(stderr, "Read function definition:");
|
std::cerr << "Read function definition:\n";
|
||||||
LF->dump();
|
LF->dump();
|
||||||
#endif
|
#endif
|
||||||
J.addModule(C.takeM());
|
J.addModule(C.takeM());
|
||||||
@@ -1218,7 +1214,7 @@ static void HandleTopLevelExpression(SessionContext &S, KaleidoscopeJIT &J) {
|
|||||||
IRGenContext C(S);
|
IRGenContext C(S);
|
||||||
if (auto ExprFunc = F->IRGen(C)) {
|
if (auto ExprFunc = F->IRGen(C)) {
|
||||||
#ifndef MINIMAL_STDERR_OUTPUT
|
#ifndef MINIMAL_STDERR_OUTPUT
|
||||||
fprintf(stderr, "Expression function:\n");
|
std::cerr << "Expression function:\n";
|
||||||
ExprFunc->dump();
|
ExprFunc->dump();
|
||||||
#endif
|
#endif
|
||||||
// Add the CodeGen'd module to the JIT. Keep a handle to it: We can remove
|
// Add the CodeGen'd module to the JIT. Keep a handle to it: We can remove
|
||||||
@@ -1234,7 +1230,7 @@ static void HandleTopLevelExpression(SessionContext &S, KaleidoscopeJIT &J) {
|
|||||||
#ifdef MINIMAL_STDERR_OUTPUT
|
#ifdef MINIMAL_STDERR_OUTPUT
|
||||||
FP();
|
FP();
|
||||||
#else
|
#else
|
||||||
fprintf(stderr, "Evaluated to %f\n", FP());
|
std::cerr << "Evaluated to " << FP() << "\n";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Remove the function.
|
// Remove the function.
|
||||||
@@ -1253,7 +1249,7 @@ static void MainLoop() {
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
#ifndef MINIMAL_STDERR_OUTPUT
|
#ifndef MINIMAL_STDERR_OUTPUT
|
||||||
fprintf(stderr, "ready> ");
|
std::cerr << "ready> ";
|
||||||
#endif
|
#endif
|
||||||
switch (CurTok) {
|
switch (CurTok) {
|
||||||
case tok_eof: return;
|
case tok_eof: return;
|
||||||
@@ -1309,10 +1305,12 @@ int main() {
|
|||||||
|
|
||||||
// Prime the first token.
|
// Prime the first token.
|
||||||
#ifndef MINIMAL_STDERR_OUTPUT
|
#ifndef MINIMAL_STDERR_OUTPUT
|
||||||
fprintf(stderr, "ready> ");
|
std::cerr << "ready> ";
|
||||||
#endif
|
#endif
|
||||||
getNextToken();
|
getNextToken();
|
||||||
|
|
||||||
|
std::cerr << std::fixed;
|
||||||
|
|
||||||
// Run the main "interpreter loop" now.
|
// Run the main "interpreter loop" now.
|
||||||
MainLoop();
|
MainLoop();
|
||||||
|
|
||||||
|
@@ -13,8 +13,10 @@
|
|||||||
#include "llvm/Support/TargetSelect.h"
|
#include "llvm/Support/TargetSelect.h"
|
||||||
#include "llvm/Transforms/Scalar.h"
|
#include "llvm/Transforms/Scalar.h"
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <cstdio>
|
#include <iomanip>
|
||||||
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
@@ -270,14 +272,14 @@ static int GetTokPrecedence() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
std::unique_ptr<T> ErrorU(const char *Str) {
|
std::unique_ptr<T> ErrorU(const std::string &Str) {
|
||||||
fprintf(stderr, "Error: %s\n", Str);
|
std::cerr << "Error: " << Str << "\n";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T* ErrorP(const char *Str) {
|
T* ErrorP(const std::string &Str) {
|
||||||
fprintf(stderr, "Error: %s\n", Str);
|
std::cerr << "Error: " << Str << "\n";
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -643,13 +645,11 @@ static std::unique_ptr<PrototypeAST> ParseExtern() {
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
// FIXME: Obviously we can do better than this
|
// FIXME: Obviously we can do better than this
|
||||||
std::string GenerateUniqueName(const char *root)
|
std::string GenerateUniqueName(const std::string &Root) {
|
||||||
{
|
|
||||||
static int i = 0;
|
static int i = 0;
|
||||||
char s[16];
|
std::ostringstream NameStream;
|
||||||
sprintf(s, "%s%d", root, i++);
|
NameStream << Root << ++i;
|
||||||
std::string S = s;
|
return NameStream.str();
|
||||||
return S;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string MakeLegalFunctionName(std::string Name)
|
std::string MakeLegalFunctionName(std::string Name)
|
||||||
@@ -669,10 +669,9 @@ std::string MakeLegalFunctionName(std::string Name)
|
|||||||
std::string legal_elements = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
std::string legal_elements = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||||
size_t pos;
|
size_t pos;
|
||||||
while ((pos = NewName.find_first_not_of(legal_elements)) != std::string::npos) {
|
while ((pos = NewName.find_first_not_of(legal_elements)) != std::string::npos) {
|
||||||
char old_c = NewName.at(pos);
|
std::ostringstream NumStream;
|
||||||
char new_str[16];
|
NumStream << (int)NewName.at(pos);
|
||||||
sprintf(new_str, "%d", (int)old_c);
|
NewName = NewName.replace(pos, 1, NumStream.str());
|
||||||
NewName = NewName.replace(pos, 1, new_str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NewName;
|
return NewName;
|
||||||
@@ -700,7 +699,7 @@ PrototypeAST* SessionContext::getPrototypeAST(const std::string &Name) {
|
|||||||
if (I != Prototypes.end())
|
if (I != Prototypes.end())
|
||||||
return I->second.get();
|
return I->second.get();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
class IRGenContext {
|
class IRGenContext {
|
||||||
public:
|
public:
|
||||||
@@ -751,11 +750,8 @@ Value *VariableExprAST::IRGen(IRGenContext &C) {
|
|||||||
// Look this variable up in the function.
|
// Look this variable up in the function.
|
||||||
Value *V = C.NamedValues[Name];
|
Value *V = C.NamedValues[Name];
|
||||||
|
|
||||||
if (V == 0) {
|
if (V == 0)
|
||||||
char ErrStr[256];
|
return ErrorP<Value>("Unknown variable name '" + Name + "'");
|
||||||
sprintf(ErrStr, "Unknown variable name %s", Name.c_str());
|
|
||||||
return ErrorP<Value>(ErrStr);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load the value.
|
// Load the value.
|
||||||
return C.getBuilder().CreateLoad(V, Name.c_str());
|
return C.getBuilder().CreateLoad(V, Name.c_str());
|
||||||
@@ -1237,7 +1233,7 @@ static void HandleTopLevelExpression(SessionContext &S, KaleidoscopeJIT &J) {
|
|||||||
IRGenContext C(S);
|
IRGenContext C(S);
|
||||||
if (auto ExprFunc = F->IRGen(C)) {
|
if (auto ExprFunc = F->IRGen(C)) {
|
||||||
#ifndef MINIMAL_STDERR_OUTPUT
|
#ifndef MINIMAL_STDERR_OUTPUT
|
||||||
fprintf(stderr, "Expression function:\n");
|
std::cerr << "Expression function:\n";
|
||||||
ExprFunc->dump();
|
ExprFunc->dump();
|
||||||
#endif
|
#endif
|
||||||
// Add the CodeGen'd module to the JIT. Keep a handle to it: We can remove
|
// Add the CodeGen'd module to the JIT. Keep a handle to it: We can remove
|
||||||
@@ -1253,7 +1249,7 @@ static void HandleTopLevelExpression(SessionContext &S, KaleidoscopeJIT &J) {
|
|||||||
#ifdef MINIMAL_STDERR_OUTPUT
|
#ifdef MINIMAL_STDERR_OUTPUT
|
||||||
FP();
|
FP();
|
||||||
#else
|
#else
|
||||||
fprintf(stderr, "Evaluated to %f\n", FP());
|
std::cerr << "Evaluated to " << FP() << "\n";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Remove the function.
|
// Remove the function.
|
||||||
@@ -1272,7 +1268,7 @@ static void MainLoop() {
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
#ifndef MINIMAL_STDERR_OUTPUT
|
#ifndef MINIMAL_STDERR_OUTPUT
|
||||||
fprintf(stderr, "ready> ");
|
std::cerr << "ready> ";
|
||||||
#endif
|
#endif
|
||||||
switch (CurTok) {
|
switch (CurTok) {
|
||||||
case tok_eof: return;
|
case tok_eof: return;
|
||||||
@@ -1328,10 +1324,12 @@ int main() {
|
|||||||
|
|
||||||
// Prime the first token.
|
// Prime the first token.
|
||||||
#ifndef MINIMAL_STDERR_OUTPUT
|
#ifndef MINIMAL_STDERR_OUTPUT
|
||||||
fprintf(stderr, "ready> ");
|
std::cerr << "ready> ";
|
||||||
#endif
|
#endif
|
||||||
getNextToken();
|
getNextToken();
|
||||||
|
|
||||||
|
std::cerr << std::fixed;
|
||||||
|
|
||||||
// Run the main "interpreter loop" now.
|
// Run the main "interpreter loop" now.
|
||||||
MainLoop();
|
MainLoop();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user