Line directives need to use the fileName stored in the InputLoc stuctures from
[external/ragel.git] / ragel / rlscan.rl
index 6a99cc7..3c325c3 100644 (file)
@@ -338,7 +338,7 @@ void Scanner::handleInclude()
                                parser->includeHistory.append( IncludeHistoryItem( 
                                                includeChecks[found], inclSectionName ) );
 
-                               Scanner scanner( includeChecks[found], *inFile, parser,
+                               Scanner scanner( id, includeChecks[found], *inFile, parser,
                                                inclSectionName, includeDepth+1, false );
                                scanner.do_scan( );
                                delete inFile;
@@ -363,7 +363,7 @@ void Scanner::handleImport()
                                scan_error() << "import: attempted: \"" << *tried++ << '\"' << endl;
                }
 
-               Scanner scanner( importChecks[found], *inFile, parser,
+               Scanner scanner( id, importChecks[found], *inFile, parser,
                                0, includeDepth+1, true );
                scanner.do_scan( );
                scanner.importToken( 0, 0, 0 );
@@ -485,7 +485,6 @@ void Scanner::token( int type, char *start, char *end )
 void Scanner::processToken( int type, char *tokdata, int toklen )
 {
        int *p, *pe, *eof;
-       
 
        if ( type < 0 )
                p = pe = eof = 0;
@@ -934,6 +933,7 @@ ifstream *Scanner::tryOpenInclude( char **pathChecks, long &found )
 
        # Parser definitions. 
        parser_def := |*
+               'length_cond' => { token( KW_Length ); };
                'machine' => { token( KW_Machine ); };
                'include' => { token( KW_Include ); };
                'import' => { token( KW_Import ); };