#631 D language: child templates should have parent

closed
None
5
2012-11-05
2012-11-03
Denizzz
No

D language: please add templates into symbols list

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

example file is attached

Discussion

  • Denizzz
    Denizzz
    2012-11-03

    example D file with templates

     
    Attachments
  • Nick Treleaven
    Nick Treleaven
    2012-11-03

    • assigned_to: nobody --> ntrel
     
  • Nick Treleaven
    Nick Treleaven
    2012-11-03

    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.

     
  • Nick Treleaven
    Nick Treleaven
    2012-11-03

    • summary: D language: please add templates into symbols list --> D language: child templates should have parent
     
  • Nick Treleaven
    Nick Treleaven
    2012-11-05

    Nested template blocks should now appear under their parent.

     
  • Nick Treleaven
    Nick Treleaven
    2012-11-05

    • status: open --> closed
     
  • Nick Treleaven
    Nick Treleaven
    2012-11-05

    Now implemented in Git.

     
  • Denizzz
    Denizzz
    2012-11-05

    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.

     
  • Denizzz
    Denizzz
    2012-11-05

    • status: closed --> open
     
  • Denizzz
    Denizzz
    2012-11-05

    • status: open --> closed
     
  • Nick Treleaven
    Nick Treleaven
    2012-11-27

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