Need line directives ahead of the host blocks.
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Mon, 26 Jan 2009 17:00:26 +0000 (17:00 +0000)
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Mon, 26 Jan 2009 17:00:26 +0000 (17:00 +0000)
git-svn-id: http://svn.complang.org/ragel/trunk@669 052ea7fc-9027-0410-9066-f65837a77df0

ragel/gendata.cpp
ragel/gendata.h
ragel/inputdata.cpp

index e0189c6..86e3d0d 100644 (file)
@@ -722,7 +722,7 @@ void CodeGenData::writeStatement( InputLoc &loc, int nargs, char **args )
         * generators.
         *
         * Force a newline. */
-       out << "\n";
+       out << '\n';
        genLineDirective( out );
 
        if ( strcmp( args[0], "data" ) == 0 ) {
index bc052d9..e454b53 100644 (file)
@@ -72,6 +72,7 @@ void javaLineDirective( ostream &out, const char *fileName, int line );
 void rubyLineDirective( ostream &out, const char *fileName, int line );
 void csharpLineDirective( ostream &out, const char *fileName, int line );
 void genLineDirective( ostream &out );
+void lineDirective( ostream &out, const char *fileName, int line );
 
 /*********************************/
 
index 1d52f34..5922a53 100644 (file)
@@ -122,6 +122,8 @@ void InputData::writeOutput()
                        cgd->writeStatement( ii->loc, ii->writeArgs.length()-1, ii->writeArgs.data );
                }
                else {
+                       *outStream << '\n';
+                       lineDirective( *outStream, inputFileName, ii->loc.line );
                        *outStream << ii->data.str();
                }
        }