diff options
author | Adrian Thurston <thurston@complang.org> | 2013-04-10 20:16:33 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2013-04-10 20:16:33 -0400 |
commit | 029beab25cf91e4dcb191140ec7fd169f0b2dbce (patch) | |
tree | 2fc4e222c4817fc124eeb7a6397b8a2eb3a39deb | |
parent | 0fde3215a3ebb15fbc67fd921fe95418055cae6f (diff) | |
download | colm-029beab25cf91e4dcb191140ec7fd169f0b2dbce.tar.gz |
eliminated the second colm location struct
-rw-r--r-- | colm/colm.h | 1 | ||||
-rw-r--r-- | colm/exports.cc | 10 | ||||
-rw-r--r-- | colm/global.h | 3 | ||||
-rw-r--r-- | colm/input.h | 3 | ||||
-rw-r--r-- | colm/tree.c | 2 | ||||
-rw-r--r-- | colm/tree.h | 2 |
6 files changed, 7 insertions, 14 deletions
diff --git a/colm/colm.h b/colm/colm.h index 79202aa2..a4d6e9fa 100644 --- a/colm/colm.h +++ b/colm/colm.h @@ -10,6 +10,7 @@ struct ColmKid; struct ColmProgram; struct ColmRuntimeData; struct ColmTree; +struct ColmLocation; struct ColmProgram *colmNewProgram( struct ColmRuntimeData *rtd, long debugRealm ); void colmRunProgram( struct ColmProgram *prg, int argc, const char **argv ); diff --git a/colm/exports.cc b/colm/exports.cc index d7d8640c..edcc7ca4 100644 --- a/colm/exports.cc +++ b/colm/exports.cc @@ -64,16 +64,6 @@ void Compiler::generateExports() "\n"; out << - "struct ColmLocation\n" - "{\n" - " const char *name;\n" - " long line;\n" - " long column;\n" - " long byte;\n" - "};\n" - "\n"; - - out << "inline void appendString( ColmPrintArgs *args, const char *data, int length )\n" "{\n" " std::string *str = (std::string*)args->arg;\n" diff --git a/colm/global.h b/colm/global.h index bfee95bd..1f7a0b90 100644 --- a/colm/global.h +++ b/colm/global.h @@ -65,7 +65,8 @@ extern int gblErrorCount; extern char machineMain[]; extern bool gblLibrary; extern const char *gblExportTo; -extern "C" struct ColmLocation; + +struct ColmLocation; /* Location in an input file. */ struct InputLoc diff --git a/colm/input.h b/colm/input.h index 9cbd5f38..6a65385c 100644 --- a/colm/input.h +++ b/colm/input.h @@ -64,6 +64,7 @@ struct Constructor; struct ConsItem; struct _FsmRun; struct ColmTree; +struct ColmLocation; struct ColmProgram; enum RunBufType { @@ -86,7 +87,7 @@ typedef struct _RunBuf RunBuf *newRunBuf(); typedef struct _StreamImpl StreamImpl; -typedef struct _Location Location; +typedef struct ColmLocation Location; struct StreamFuncs { diff --git a/colm/tree.c b/colm/tree.c index 81ba92a0..fe103a7b 100644 --- a/colm/tree.c +++ b/colm/tree.c @@ -2014,7 +2014,7 @@ Location *locSearch( Program *prg, Tree *tree ) struct ColmLocation *findLocation( Program *prg, Tree *tree ) { - return (struct ColmLocation*)locSearch( prg, tree ); + return locSearch( prg, tree ); } void xmlEscapeData( struct ColmPrintArgs *printArgs, const char *data, long len ) diff --git a/colm/tree.h b/colm/tree.h index edfb60f9..8496918c 100644 --- a/colm/tree.h +++ b/colm/tree.h @@ -33,7 +33,7 @@ typedef unsigned long Word; typedef unsigned long Half; struct Bindings; -typedef struct _Location +typedef struct ColmLocation { const char *name; long line; |