aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm.cpp14
-rw-r--r--tuplr.cpp8
-rw-r--r--tuplr.hpp10
-rw-r--r--typing.cpp2
4 files changed, 11 insertions, 23 deletions
diff --git a/llvm.cpp b/llvm.cpp
index daaf4f9..e94a806 100644
--- a/llvm.cpp
+++ b/llvm.cpp
@@ -45,11 +45,6 @@ struct CEngine {
IRBuilder<> builder;
};
-
-/***************************************************************************
- * Typing *
- ***************************************************************************/
-
const Type*
lltype(AType* t)
{
@@ -72,13 +67,6 @@ lltype(AType* t)
return NULL; // not reached
}
-
-/***************************************************************************
- * Code Generation *
- ***************************************************************************/
-
-// Compile-Time Environment
-
CEngine::CEngine()
: module(new Module("tuplr"))
, engine(ExecutionEngine::create(module))
@@ -185,7 +173,7 @@ compileFunction(CEnv& cenv, const std::string& name, const Type* retT, const AST
/***************************************************************************
- * AST Code Generation *
+ * Code Generation *
***************************************************************************/
void
diff --git a/tuplr.cpp b/tuplr.cpp
index 49a3607..5837715 100644
--- a/tuplr.cpp
+++ b/tuplr.cpp
@@ -33,7 +33,7 @@ std::ostream& out = std::cout;
/***************************************************************************
- * S-Expression Lexer :: text -> S-Expressions (SExp) *
+ * Lexer *
***************************************************************************/
inline int
@@ -157,7 +157,7 @@ initLang(PEnv& penv, TEnv& tenv)
int
print_usage(char* name, bool error)
{
- std::ostream& os = error ? std::cerr : std::cout;
+ ostream& os = error ? cerr : cout;
os << "Usage: " << name << " [OPTION]... [FILE]..." << endl;
os << "Evaluate and/or compile Tuplr code" << endl;
os << endl;
@@ -206,7 +206,7 @@ main(int argc, char** argv)
if (is.good()) {
ret = ret | eval(*cenv, *f, is);
} else {
- std::cerr << argv[0] << ": " << *f << ": " << strerror(errno) << endl;
+ cerr << argv[0] << ": " << *f << ": " << strerror(errno) << endl;
++ret;
}
is.close();
@@ -217,7 +217,7 @@ main(int argc, char** argv)
a = args.find("-o");
if (a != args.end()) {
- std::ofstream os(a->second.c_str());
+ ofstream os(a->second.c_str());
if (os.good()) {
cenv->write(os);
} else {
diff --git a/tuplr.hpp b/tuplr.hpp
index 14be70d..e7a2329 100644
--- a/tuplr.hpp
+++ b/tuplr.hpp
@@ -68,7 +68,7 @@ struct Exp {
/***************************************************************************
- * S-Expression Lexer :: text -> S-Expressions (SExp) *
+ * Lexer: Text (istream) -> S-Expressions (SExp) (Prefix S for Syntactic) *
***************************************************************************/
typedef Exp<string> SExp; ///< Textual S-Expression
@@ -77,7 +77,7 @@ SExp readExpression(Cursor& cur, std::istream& in);
/***************************************************************************
- * Backend *
+ * Backend (Prefix C for Compiled) *
***************************************************************************/
typedef void* CValue; ///< Compiled value (opaque)
@@ -86,7 +86,7 @@ struct CEngine; ///< Backend data (opaque)
/***************************************************************************
- * Abstract Syntax Tree *
+ * Abstract Syntax Tree (Prefix A for Abstract) *
***************************************************************************/
struct TEnv; ///< Type-Time Environment
@@ -306,7 +306,7 @@ struct ASTCdrCall : public ASTCall {
/***************************************************************************
- * Parser - S-Expressions (SExp) -> AST Nodes (AST) *
+ * Parser: S-Expressions (SExp) -> AST Nodes (AST) (Prefix P for Parsing) *
***************************************************************************/
/// Parse Time Environment (symbol table)
@@ -420,7 +420,7 @@ struct Env : public list< map<K,V> > {
/***************************************************************************
- * Typing *
+ * Typing (Prefix T for Type) *
***************************************************************************/
struct TSubst : public map<AType*, AType*> {
diff --git a/typing.cpp b/typing.cpp
index b4a365a..837b1c3 100644
--- a/typing.cpp
+++ b/typing.cpp
@@ -18,7 +18,7 @@
#include "tuplr.hpp"
/***************************************************************************
- * AST Type Contraints *
+ * AST Type Constraints *
***************************************************************************/
void