diff options
author | hillj <hillj@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-07-22 14:13:37 +0000 |
---|---|---|
committer | hillj <hillj@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-07-22 14:13:37 +0000 |
commit | 90a7f26e868132bbd013aadf405c03e212396bcb (patch) | |
tree | 0f20a87a7a1c79fe37affc0bd0c9da60dc7e6233 /CIAO | |
parent | eae33eeab752f4f6b75253c100df12f98a01722e (diff) | |
download | ATCD-90a7f26e868132bbd013aadf405c03e212396bcb.tar.gz |
Tue Jul 22 07:50:38 UTC 2008 James H. Hill <hillj@isis.vanderbilt.edu>
Diffstat (limited to 'CIAO')
-rw-r--r-- | CIAO/CCF/CCF/CodeGenerationKit/IndentationCxx.hpp | 64 | ||||
-rw-r--r-- | CIAO/ChangeLog | 9 |
2 files changed, 46 insertions, 27 deletions
diff --git a/CIAO/CCF/CCF/CodeGenerationKit/IndentationCxx.hpp b/CIAO/CCF/CCF/CodeGenerationKit/IndentationCxx.hpp index 6c4c05db38c..d521fe4eca7 100644 --- a/CIAO/CCF/CCF/CodeGenerationKit/IndentationCxx.hpp +++ b/CIAO/CCF/CCF/CodeGenerationKit/IndentationCxx.hpp @@ -83,39 +83,48 @@ namespace Indentation } case '{': { - ensure_new_line (); - output_indentation (); - result = write (c); - ensure_new_line (); - - indentation_.push (indentation_.top () + spaces_); + if (!(construct_ == CXX_COMMENT || construct_ == STRING_LITERAL)) + { + ensure_new_line (); + output_indentation (); + result = write (c); + ensure_new_line (); + indentation_.push (indentation_.top () + spaces_); + } + else + defaulting = true; break; } case '}': { - if (indentation_.size () > 1) - indentation_.pop (); - - // Reduce multiple newlines to one. - while (hold_.size () > 1) + if (!(construct_ == CXX_COMMENT || construct_ == STRING_LITERAL)) { - typename Hold::reverse_iterator i = hold_.rbegin (); - if (*i == '\n' && *(i + 1) == '\n') hold_.pop_back (); - else break; - } + if (indentation_.size () > 1) + indentation_.pop (); - ensure_new_line (); - output_indentation (); + // Reduce multiple newlines to one. + while (hold_.size () > 1) + { + typename Hold::reverse_iterator i = hold_.rbegin (); + if (*i == '\n' && *(i + 1) == '\n') hold_.pop_back (); + else break; + } - hold_.push_back (c); + ensure_new_line (); + output_indentation (); + + hold_.push_back (c); - // Add double newline after '}'. - // - hold_.push_back ('\n'); - hold_.push_back ('\n'); - position_ = 0; + // Add double newline after '}'. + // + hold_.push_back ('\n'); + hold_.push_back ('\n'); + position_ = 0; + } + else + defaulting = true; break; } @@ -184,12 +193,13 @@ namespace Indentation } case '\"': { - if (construct_ != CXX_COMMENT && - (hold_.empty () || hold_.back () != '\\')) + if (construct_ != CXX_COMMENT && (hold_.empty () || hold_.back () != '\\')) { // not escape sequence - if (construct_ == STRING_LITERAL) construct_ = OTHER; - else construct_ = STRING_LITERAL; + if (construct_ == STRING_LITERAL) + construct_ = OTHER; + else + construct_ = STRING_LITERAL; } defaulting = true; diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 1835701aab3..a2898f7d2d4 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,12 @@ +Tue Jul 22 07:50:38 UTC 2008 James H. Hill <hillj@isis.vanderbilt.edu> + + * CCF/CCF/CodeGenerationKit/IndentationCxx.hpp: + + Bug fix where using a curly brace, i.e., '{' or '}', inside a + string or comment caused the code generator to treat it as a + regular curly brace. This meant the code generator inserted a + newline when it was not supposed to. + Fri Jul 04 10:43:00 UTC 2008 Simon Massey <sma at prismtech dot com> * tools/IDL3_to_IDL2/IDL3_to_IDL2.mpc: |