| 711 | } |
| 712 | |
| 713 | void CompilerInputStream::ChangeLocation( const FileLocation& location ) |
| 714 | { |
| 715 | if( m_location.lineNumber != location.lineNumber || |
| 716 | m_location.fileName != location.fileName ) |
| 717 | { |
| 718 | if( m_location.fileName == location.fileName && |
| 719 | m_location.lineNumber + 1 == location.lineNumber ) |
| 720 | { |
| 721 | *this << "\n"; |
| 722 | } |
| 723 | else |
| 724 | { |
| 725 | std::string fileName = ToString( location.fileName ); |
| 726 | for( size_t i = 0; i < fileName.length(); ++i ) |
| 727 | { |
| 728 | if( fileName[i] == '\\' ) |
| 729 | { |
| 730 | fileName[i] = '/'; |
| 731 | } |
| 732 | } |
| 733 | |
| 734 | *this << "\n#line " << location.lineNumber << " \"" << fileName << "\"\n"; |
| 735 | } |
| 736 | flush(); |
| 737 | m_location = location; |
| 738 | InlineString pragma; |
| 739 | while( m_state.GetPragma( m_location, pragma ) ) |
| 740 | { |
| 741 | *this << "#pragma " << pragma << "\n"; |
| 742 | m_location.lineNumber++; |
| 743 | } |
| 744 | } |
| 745 | } |
| 746 | |
| 747 | void CompilerInputStream::Indent() |
| 748 | { |
no test coverage detected