lengthen / objectiveclipse

Automatically exported from code.google.com/p/objectiveclipse
0 stars 0 forks source link

Parser doesn't parse protocol-constrained types #37

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This gets marked as a syntax error, owing to the id <List> not being parsed as 
a type. I've 
added this in to testLink() in ParseTest, but left the lines commented out (so 
that the tests pass 
at the moment).

See for example 
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/oc
Properties
.html#//apple_ref/doc/uid/TP30001163-CH17-SW22 

and

http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/oc
Protocols.
html#//apple_ref/doc/uid/TP30001163-CH15-TPXREF151

[http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/o
cPropertie
s.html#//apple_ref/doc/uid/TP30001163-CH17-SW22 Properties documentation]

[http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/o
cProtocols.
html#//apple_ref/doc/uid/TP30001163-CH15-TPXREF151 Protocol documentation]
--- 8< ---
#import <Foundation/Foundation.h>
@protocol List @property id <List> next; @end
@interface LinkedList : NSObject <List> { id <List> nextLinkedList;} @end
@implementation LinkedList @synthesize next = nextLinkedList; @end

int main() {}

--- 8< ---

Original issue reported on code.google.com by alex.ble...@gmail.com on 19 Jul 2009 at 9:42

GoogleCodeExporter commented 8 years ago
Ok, I'll get a fix for this shortly.

Original comment by rrusaw@gmail.com on 19 Jul 2009 at 3:14

GoogleCodeExporter commented 8 years ago
I've tested this out, and it looks good.

One comment - the outline shows:

Linked List
 * nextLinkedList : id

Shouldn't the return type shown be id <List> ? A minor thing, but I was more 
interested whether we're 
reporting the type as id <List> or if it's just referring to id.

Original comment by alex.ble...@gmail.com on 21 Jul 2009 at 9:39

GoogleCodeExporter commented 8 years ago
That appears to be handled by 
org.eclipse.cdt.internal.core.model.CModelBuilder2. 

It looks like we can add a IContributedModelBuilder extension and then 
WorkingCopy
will use parseUsingContributedModelBuilder instead of parseUsingCModelBuilder. 
I can
create a new issue for that.

Original comment by rrusaw@gmail.com on 22 Jul 2009 at 5:30