Enabled the location printing in the warning function.
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Wed, 24 Jan 2007 05:57:31 +0000 (05:57 +0000)
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Wed, 24 Jan 2007 05:57:31 +0000 (05:57 +0000)
git-svn-id: http://svn.complang.org/ragel/trunk@10 052ea7fc-9027-0410-9066-f65837a77df0

ragel/main.cpp
ragel/parsetree.h
ragel/ragel.h

index 41d6e6a..419ce83 100644 (file)
@@ -93,36 +93,23 @@ void version()
                        "Copyright (c) 2001-2006 by Adrian Thurston" << endl;
 }
 
-/* Global parse data pointer. */
-//extern InputData *id;
-
 /* Total error count. */
 int gblErrorCount = 0;
 
 /* Print the opening to a program error, then return the error stream. */
 ostream &error()
 {
-       /* Keep the error count. */
-//     if ( id != 0 && id->pd != 0 )
-//             id->pd->errorCount += 1;
        gblErrorCount += 1;
-       
        cerr << PROGNAME ": ";
        return cerr;
 }
 
-/* Print the opening to a warning, then return the error ostream. */
-ostream &warning( )
-{
-//     cerr << id->fileName << ": warning: ";
-       return cerr;
-}
 
 /* Print the opening to a warning in the input, then return the error ostream. */
 ostream &warning( const InputLoc &loc )
 {
-//     cerr << id->fileName << ":" << loc.line << ":" << 
-//                     loc.col << ": warning: ";
+       cerr << loc.fileName << ":" << loc.line << ":" << 
+                       loc.col << ": warning: ";
        return cerr;
 }
 
index c340171..a9bcf5c 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef _PARSETREE_H
 #define _PARSETREE_H
 
+#include "ragel.h"
 #include "avlmap.h"
 #include "bstmap.h"
 #include "vector.h"
@@ -50,13 +51,6 @@ enum BuiltinMachine
        BT_Empty
 };
 
-/* Location in an input file. */
-struct InputLoc
-{
-       char *fileName;
-       int line;
-       int col;
-};
 
 struct ParseData;
 
index 58f8a88..8f539af 100644 (file)
@@ -60,11 +60,17 @@ extern bool printStatistics;
 extern int gblErrorCount;
 extern char machineMain[];
 
+/* Location in an input file. */
+struct InputLoc
+{
+       char *fileName;
+       int line;
+       int col;
+};
+
 /* Error reporting. */
-struct InputLoc;
 std::ostream &error();
 std::ostream &error( const InputLoc &loc ); 
-std::ostream &warning( ); 
 std::ostream &warning( const InputLoc &loc ); 
 
 void scan( char *fileName, std::istream &input );