Include the root in the include history.
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Fri, 18 Jul 2008 22:59:38 +0000 (22:59 +0000)
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Fri, 18 Jul 2008 22:59:38 +0000 (22:59 +0000)
git-svn-id: http://svn.complang.org/ragel/trunk@459 052ea7fc-9027-0410-9066-f65837a77df0

ragel/rlparse.kh
ragel/rlscan.rl

index a829d78..0359c50 100644 (file)
@@ -111,6 +111,8 @@ struct Parser
        {
                pd = new ParseData( fileName, sectionName, sectionLoc );
                exportContext.append( false );
+               includeHistory.append( IncludeHistoryItem( 
+                               fileName, sectionName ) );
        }
 
        int token( InputLoc &loc, int tokId, char *tokstart, int toklen );
index d2d93a4..5a02105 100644 (file)
@@ -246,6 +246,8 @@ ostream &Scanner::scan_error()
        return cerr;
 }
 
+/* An approximate check for duplicate includes. Due to aliasing of files it's
+ * possible for duplicates to creep in. */
 bool Scanner::duplicateInclude( char *inclFileName, char *inclSectionName )
 {
        for ( IncludeHistory::Iter hi = parser->includeHistory; hi.lte(); hi++ ) {