Ignore:
Timestamp:
Aug 14, 2024, 11:55:20 AM (15 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
960665c
Parents:
26d40a1 (diff), 2870cb6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/CodeLocation.hpp

    r26d40a1 rd1f5054  
    1717
    1818#include <iostream>
    19 #include <string>
     19#include "Symbol.hpp"
    2020
    2121struct CodeLocation {
    2222        int first_line = -1, first_column = -1, last_line = -1, last_column = -1;
    23         std::string filename = "";
     23        Symbol filename = "";
    2424
    2525        /// Create a new unset CodeLocation.
     
    4646
    4747        bool startsBefore( CodeLocation const & other ) const {
    48                 if( filename < other.filename ) return true;
    49                 if( filename > other.filename ) return false;
     48                if( filename.str() < other.filename.str() ) return true;
     49                if( filename.str() > other.filename.str() ) return false;
    5050
    5151                if( first_line < other.first_line ) return true;
     
    7272inline std::ostream & operator<<( std::ostream & out, const CodeLocation & location ) {
    7373        // Column number ":1" allows IDEs to parse the error message and position the cursor in the source text.
    74         return location.isSet() ? out << location.filename << ":" << location.first_line << ":1 " : out;
     74        return location.isSet() ? out << location.filename.str() << ":" << location.first_line << ":1 " : out;
    7575}
Note: See TracChangeset for help on using the changeset viewer.