Permalink
Browse files

Changed description and toString so that description is implemented a…

…nd toString just calls it.

Plus a small formatting change for my old tired eyes.
  • Loading branch information...
1 parent 4c25af3 commit 8fc7130e932aa6f46d94c5634deb4230c13f23fa Alan Condit committed Apr 24, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 runtime/ObjC/Framework/CommonTree.m
@@ -279,7 +279,7 @@ - (NSString *) treeDescription
- (void) setUnknownTokenBoundaries
{
if ( children == nil ) {
- if ( startIndex<0 || stopIndex<0 ) {
+ if ( startIndex < 0 || stopIndex < 0 ) {
startIndex = stopIndex = [token getTokenIndex];
}
return;
@@ -319,11 +319,6 @@ - (void) setChildIndex:(NSInteger) anIndex
- (NSString *) description
{
- return [self toString];
-}
-
-- (NSString *) toString
-{
if ( [self isNil] ) {
return @"nil";
}
@@ -336,6 +331,11 @@ - (NSString *) toString
return token.text;
}
+- (NSString *) toString
+{
+ return [self description];
+}
+
@synthesize token;
@synthesize startIndex;
@synthesize stopIndex;

0 comments on commit 8fc7130

Please sign in to comment.