Update StackFrame for ObjC 2.
authorRobert Sesek <rsesek@bluestatic.org>
Sat, 10 Oct 2015 21:30:07 +0000 (17:30 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sat, 10 Oct 2015 21:30:07 +0000 (17:30 -0400)
Source/StackFrame.h
Source/StackFrame.m

index 01964b551e1090f92e3811de0c13df83e417e1dd..f51a145f3bd8056f1685651478c22fbe85af54ed 100644 (file)
 
 #import <Cocoa/Cocoa.h>
 
+@class VariableNode;
+
 @interface StackFrame : NSObject
-{
-  /**
-   * Whether or not the stack frame has been fully loaded.
-   */
-  BOOL loaded_;
 
-  /**
-   * The position in the stack
-   */
-  NSUInteger index_;
-  
-  /**
-   * File the current frame is in
-   */
-  NSString* filename_;
-  
-  /**
-   * Cached, highlighted version of the source
-   */
-  NSString* source_;
-  
-  /**
-   * Line number of the source the frame points to
-   */
-  NSUInteger lineNumber_;
-  
-  /**
-   * Current-executing function
-   */
-  NSString* function_;
-  
-  /**
-   * Variable list
-   */
-  NSArray* variables_;
-}
+/**
+ * Whether or not the stack frame has been fully loaded.
+ */
+@property(nonatomic) BOOL loaded;
+
+/**
+ * The position in the stack
+ */
+@property(readwrite, nonatomic) NSUInteger index;
+
+/**
+ * File the current frame is in
+ */
+@property(copy, nonatomic) NSString* filename;
+
+/**
+ * Cached, highlighted version of the source
+ */
+@property(copy, nonatomic) NSString* source;
+
+/**
+ * Line number of the source the frame points to
+ */
+@property(readwrite, nonatomic) NSUInteger lineNumber;
 
-@property BOOL loaded;
-@property (readwrite) NSUInteger index;
-@property (copy) NSString* filename;
-@property (copy) NSString* source;
-@property (readwrite) NSUInteger lineNumber;
-@property (copy) NSString* function;
-@property (retain) NSArray* variables;
+/**
+ * Current-executing function
+ */
+@property(copy, nonatomic) NSString* function;
 
+/**
+ * Variable list
+ */
+@property(retain, nonatomic) NSArray<VariableNode*>* variables;
+
+/**
+ * Whether or not this is the same stack scope as |frame|.
+ */
 - (BOOL)isShiftedFrame:(StackFrame*)frame;
 
 @end
index 8c01f27e0d0488296d9fea68c1a0b91c6bd3a760..e516d9052a2b10e078e21d389f8e970e52b8074e 100644 (file)
 
 @implementation StackFrame
 
-@synthesize loaded = loaded_;
-@synthesize index = index_;
-@synthesize filename = filename_;
-@synthesize source = source_;
-@synthesize lineNumber = lineNumber_;
-@synthesize function = function_;
-@synthesize variables = variables_;
+@synthesize loaded;
+@synthesize index;
+@synthesize filename;
+@synthesize source;
+@synthesize lineNumber;
+@synthesize function;
+@synthesize variables;
 
-- (void)dealloc
-{
+- (void)dealloc {
   self.filename = nil;
   self.source = nil;
   self.function = nil;
   [super dealloc];
 }
 
-/**
- * Determines whether or not the given frame was shifted, rather than jumped. Essentially,
- * this checks if it's in the same file/function.
- */
-- (BOOL)isShiftedFrame:(StackFrame*)frame
-{
+- (BOOL)isShiftedFrame:(StackFrame*)frame {
   return ([self.filename isEqualToString:frame.filename] && [self.function isEqualToString:frame.function]);
 }
 
-/**
- * Returns a human-readable representation
- */
-- (NSString*)description
-{
+- (NSString*)description {
   return [NSString stringWithFormat:@"#%d %@ [%@:%d]", self.index, self.function, self.filename, self.lineNumber];
 }