~ubuntu-branches/ubuntu/maverick/aspectc++/maverick

« back to all changes in this revision

Viewing changes to Puma/src/manip/Manipulators.cc

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-04-10 17:40:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080410174052-xdnsm7oi8hauyyf1
Tags: 1.0pre4~svn.20080409+dfsg-3
Fix another missing include, this time in Ag++/StdSystem.cc

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
 
48
48
// I hope there is a first arg ...
49
49
Location ManipError::location () { 
50
 
  if (faulty ()->args ().length ())
 
50
  if (faulty () && faulty ()->args ().length ())
51
51
    if (faulty ()->args ()[0])
52
52
      return faulty ()->args ()[0]->location ();
53
53
  
60
60
void ManipError::print (ostream &os) const {
61
61
  switch (errorno ()) {
62
62
    case FATAL:
63
 
      os << "fatal error: Can't do `" << faulty ()->op ()
 
63
      os << "fatal error: Can't do `" << (faulty () ? faulty ()->op () : "<unknown>")
64
64
         << "' manipulation"; break;
65
65
    case MACRO_GEN:
66
 
      os << "error: Can't `" << faulty ()->op ()
 
66
      os << "error: Can't `" << (faulty () ? faulty ()->op () : "<unknown>")
67
67
         << "' if start/end token is macro generated"; break;
68
68
    case BAD_ARG:
69
69
      os << "error: Bad argument(s) for the `"
70
 
         << faulty ()->op () << "' manipulator"; break;
 
70
         << (faulty () ? faulty ()->op () : "<unknown>") 
 
71
         << "' manipulator"; break;
71
72
    case UNBALANCED:
72
73
      os << "error: Unbalanced preprocessor directive(s) "
73
 
         << "found. Can't do `" << faulty ()->op ()
 
74
         << "found. Can't do `" << (faulty () ? faulty ()->op () : "<unknown>")
74
75
         << "' manipulation"; break;
75
76
  }
76
77
 
77
 
  os << " (Args: ";
78
 
  for (int a = 0; a < faulty ()->args ().length (); a++) {
79
 
    Token *tok = faulty ()->args ().get (a);
80
 
    if (!tok) continue;
81
 
    if (a > 0) os << ", ";
82
 
    Unit *unit = (Unit*)tok->belonging_to ();
83
 
    if (unit->isMacroExp ()) {
84
 
      MacroUnit *munit = (MacroUnit*)unit;
85
 
      tok = munit->ExpansionBegin ((Token*)munit->first ());
86
 
      os << "macro at ";
 
78
  if (faulty ()) {
 
79
    os << " (Args: ";
 
80
    for (int a = 0; a < faulty ()->args ().length (); a++) {
 
81
      Token *tok = faulty ()->args ().get (a);
 
82
      if (!tok) continue;
 
83
      if (a > 0) os << ", ";
 
84
      Unit *unit = (Unit*)tok->belonging_to ();
 
85
      if (unit->isMacroExp ()) {
 
86
        MacroUnit *munit = (MacroUnit*)unit;
 
87
        tok = munit->ExpansionBegin ((Token*)munit->first ());
 
88
        os << "macro at ";
 
89
      }
 
90
      os << tok->location ();
87
91
    }
88
 
    os << tok->location ();
 
92
    os << ").";
89
93
  }
90
 
  os << ").";
91
94
}
92
95
 
93
96