/[bison]/bison/data/lalr1.cc
ViewVC logotype

Diff of /bison/data/lalr1.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by akim, Thu Feb 20 13:36:08 2003 UTC revision 1.27 by akim, Thu Feb 20 14:42:43 2003 UTC
# Line 923  namespace yy Line 923  namespace yy
923      /** \brief (column related) Advance to the COLUMNS next columns. */      /** \brief (column related) Advance to the COLUMNS next columns. */
924      inline void columns (int columns = 1)      inline void columns (int columns = 1)
925      {      {
926        column += columns;        if (int (initial_column) < columns + int (column))
927            column += columns;
928          else
929            column = initial_column;
930      }      }
931      /** \} */      /** \} */
932    
# Line 1068  namespace yy Line 1071  namespace yy
1071    
1072    /** \brief Intercept output stream redirection.    /** \brief Intercept output stream redirection.
1073     ** \param ostr the destination output stream     ** \param ostr the destination output stream
1074     ** \param pos a reference to the Position to redirect     ** \param loc a reference to the Location to redirect
1075     **     **
1076     ** Don't issue twice the line number when the location is on a single line.     ** Avoid duplicate information.
1077     */     */
1078    inline std::ostream& operator<< (std::ostream& ostr, const Location& pos)    inline std::ostream& operator<< (std::ostream& ostr, const Location& loc)
1079    {    {
1080      ostr << pos.begin;      Position last = loc.end - 1;
1081      if (pos.begin.filename != pos.end.filename)      ostr << loc.begin;
1082        ostr << '-' << pos.end - 1;      if (loc.begin.filename != last.filename)
1083      else if (pos.begin.line != pos.end.line)        ostr << '-' << last;
1084        ostr << '-' << pos.end.line  << '.' << pos.end.column - 1;      else if (loc.begin.line != last.line)
1085      else if (pos.begin.column != pos.end.column - 1)        ostr << '-' << last.line  << '.' << last.column;
1086        ostr << '-' << pos.end.column - 1;      else if (loc.begin.column != last.column)
1087          ostr << '-' << last.column;
1088      return ostr;      return ostr;
1089    }    }
1090    

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26