Tracker: Feature Requests

5 D language: child templates should have parent - ID: 3582833
Last Update: Comment added ( ntrel )

D language: please add templates into symbols list

"template" is keyword like a class or struct in D

example file is attached


Denizzz ( denizzz ) - 2012-11-03 07:54:10 PDT

5

Closed

None

Nick Treleaven

None

None

Public


Comments ( 5 )

Date: 2012-11-27 05:56:08 PST
Sender: ntrelProject AdminAccepting Donations

I was aware D doesn't use <>. I've now made a small change to ignore them.


Date: 2012-11-05 09:22:15 PST
Sender: denizzz

Here the '<' symbol made the parser look for a closing '>' char (for C++).


In D < and > symbols not used as brackets (this was done deliberately).
So, for .d files parsing of <> can be disabled.


Date: 2012-11-05 08:21:57 PST
Sender: ntrelProject AdminAccepting Donations

Now implemented in Git.


Date: 2012-11-05 08:21:57 PST
Sender: ntrelProject AdminAccepting Donations

Nested template blocks should now appear under their parent.


Date: 2012-11-03 09:17:32 PDT
Sender: ntrelProject AdminAccepting Donations

Thanks for the sample file. The D parser already understands templates, but
it puts them under "Modules". There was a bug with 'static assert'
confusing the parser, the line:

static assert( num < TL.length, "Name '"~name~"' is not found");

Here the '<' symbol made the parser look for a closing '>' char (for C++).
I've just fixed this in Git by handling static assert like static if,
ignoring the () bracketed part. (Changing the C++ <> parsing would make the
parser diverge from ctags more so I wanted to avoid that if possible).

Of course, nested templates should be parsed as a child of any parent
symbol, so I'll rename this request to reflect that.


Attached File ( 1 )

Filename Description Download
fields.d example D file with templates Download

Changes ( 8 )

Field Old Value Date By
close_date 2012-11-05 08:21 2012-11-05 10:16:10 PST denizzz
status_id Open 2012-11-05 10:16:10 PST denizzz
status_id Closed 2012-11-05 09:22:17 PST denizzz
status_id Open 2012-11-05 08:21:57 PST ntrel
close_date - 2012-11-05 08:21:57 PST ntrel
summary D language: please add templates into symbols list 2012-11-03 09:20:14 PDT ntrel
assigned_to nobody 2012-11-03 09:17:32 PDT ntrel
File Added 455920: fields.d 2012-11-03 07:54:11 PDT denizzz