View Revisions: Issue #35787

Summary 0035787: [Patch] XML node dump improvements on subroutines
Revision 2019-07-01 18:25 by J. Gareth Moreton
Description The attached patch "node_subs.patch" seeks to address some shortcomings with the current node dumps when it comes to procedure definitions:

- The tag "<procedure>" is now "<subroutine>" for reasons of clarity (it's not always a procedure).
- If the subroutine is a method, a 'struct' attribute will now be present, listing the relevant class name.
- A 'type' attribute is now present if the subroutine is not a regular procedure or function (appears for constructors, destructors, class constructors, class destructors, class methods, static class methods, unit initialization and finalization blocks and a few other miscellaneous cases that are converted to subroutines during compilation)
- Hidden parameters are now listed (e.g. 'Self').
- If the subroutine returns a value (e.g. because it's a function), an explicit "<returndef>" element now appears in the XML file dictating what it is (it is omitted if the subroutine is a procedure or the returndef is otherwise void).
- Additional options are printed for "reintroduce", "virtual", "final", "override" and "overload" directives.
- The <code> element is now printed as <code /> if the subroutine has no code (e.g. an empty unit inltialization block).

For example, the header "constructor TTestClass.Create(I: Integer)" is dumped as:

<subroutine struct="TTestClass" type="constructor" name="constructor Create(<TTestClass>;<Class Of TTestClass>;LongInt);">

(the angled brackets are written as "&lt;" and "&gt;" inside the string - currently there is no means to remove the word 'constructor' from the start of the method name without modifying the "tprocdef.customprocname" method, which is potentially possible)
Revision 2019-07-01 00:50 by J. Gareth Moreton
Description The attached patch "node_subs.patch" seeks to address some shortcomings with the current node dumps when it comes to procedure definitions:

- The tag "<procedure>" is now "<subroutine>" for reasons of clarity (it's not always a procedure).
- If the subroutine is a method, a 'struct' attribute will now be present, listing the relevant class name.
- A 'type' attribute is now present if the subroutine is not a regular procedure or function (appears for constructors, destructors, class constructors, class destructors, class methods, static class methods, unit initialization and finalization blocks and a few other miscellaneous cases that are converted to subroutines during compilation)
- Hidden parameters are now listed (e.g. 'Self').
- If the subroutine returns a value (e.g. because it's a function), an explicit "<returndef>" element now appears in the XML file dictating what it is (it is omitted if the subroutine is a procedure or the returndef is otherwise void).
- Additional options are printed for "reintroduce", "virtual", "final", "override" and "overload" directives.
- The <code> element is now printed as <code /> if the subroutine has no code (e.g. an empty unit inltialization block).

For example, the header "constructor TTestClass.Create(I: Integer)" is dumped as:

<subroutine struct="TTestClass" type="constructor" name="constructor Create(<TTestClass>;<Class Of TTestClass>;LongInt);"> (the angled brackets are written as "&lt;" and "&gt;" inside the string - currently there is no means to remove the word 'constructor' from the start of the method name without modifying the "tprocdef.customprocname" method)
Revision 2019-07-01 00:49 by J. Gareth Moreton
Description The attached patch "node_subs.patch" seeks to address some shortcomings with the current node dumps when it comes to procedure definitions:

- The tag "<procedure>" is now "<subroutine>" for reasons of clarity (it's not always a procedure).
- If the subroutine is a method, a 'struct' attribute will now be present, listing the relevant class name.
- A 'type' attribute is now present if the subroutine is not a regular procedure or function (appears for constructors, destructors, class constructors, class destructors, class methods, static class methods, unit initialization and finalization blocks and a few other miscellaneous cases that are converted to subroutines during compilation)
- Hidden parameters are now listed (e.g. 'Self').
- If the subroutine returns a value (e.g. because it's a function), an explicit "<returndef>" element now appears in the XML file dictating what it is (it is omitted if the subroutine is a procedure or the returndef is otherwise void).
- Additional options are printed for "reintroduce", "virtual", "final", "override" and "overload" directives.
- The <code> element is now printed as <code /> if the subroutine has no code (e.g. an empty unit inltialization block).

For example, the header "constructor TTestClass.Create(I: Integer)" is dumped as:

<subroutine struct="TTestClass" type="constructor" name="constructor Create(<TTestClass>;<Class Of TTestClass>;LongInt);"> (the angled brackets are written as "<" and ">" inside the string - currently there is no means to remove the word 'constructor' from the start of the method name without modifying the "tprocdef.customprocname" method)
Revision 2019-07-01 00:48 by J. Gareth Moreton
Description The attached patch "node_subs.patch" seeks to address some shortcomings with the current node dumps when it comes to procedure definitions:

- The tag "<procedure>" is now "<subroutine>" for reasons of clarity (it's not always a procedure).
- If the subroutine is a method, a 'struct' attribute will now be present, listing the relevant class name.
- A 'type' field is now present if the subroutine is not a regular procedure or function (appears for constructors, destructors, class constructors, class destructors, class methods, static class methods, unit initialization and finalization blocks and a few other miscellaneous cases that are converted to subroutines during compilation)
- Hidden parameters are now listed (this is usually 'Self').
- If the subroutine returns a value (e.g. because it's a function), an explicit "<returndef>" element now appears in the XML file dictating what it is (it is omitted if the subroutine is a procedure or the returndef is otherwise void).
- Additional options are printed for "reintroduce", "virtual", "final", "override" and "overload" directives.
- The <code> element is now printed as <code /> if the subroutine has no code (e.g. an empty unit inltialization block).

For example, the header "constructor TTestClass.Create(I: Integer)" is dumped as:

<subroutine struct="TTestClass" type="constructor" name="constructor Create(<TTestClass>;<Class Of TTestClass>;LongInt);"> (the angled brackets are written as "<" and ">" inside the string - currently there is no means to remove the word 'constructor' from the start of the method name without modifying the "tprocdef.customprocname" method)
Revision 2019-07-01 00:47 by J. Gareth Moreton
Description The attached patch "node_subs.patch" seeks to address some shortcomings with the current node dumps when it comes to procedure definitions:

- The tag "<procedure>" is now "<subroutine>" for reasons of clarity (it's not always a procedure).
- If the subroutine is a method, a 'struct' attribute will now be present, listing the relevant class name.
- A 'type' field is now present if the subroutine is not a regular procedure or function (appears for constructors, destructors, class constructors, class destructors, class methods, static class methods, unit initialization and finalization blocks and a few other miscellaneous cases that are converted to subroutines during compilation)
- Hidden parameters are now listed (this is usually 'Self').
- If the subroutine returns a value (e.g. because it's a function), an explicit "<returndef>" element now appears in the XML file dictating what it is (it is omitted if the subroutine is a procedure or the returndef is otherwise void).
- Additional options are printed for "reintroduce", "virtual", "final", "override" and "overload" directives.
- The <code> element is now printed as <code /> if the subroutine has no code (e.g. an empty unit inltialization block).

For example, the header "constructor TTestClass.Create(I: Integer)" is dumped as:

<subroutine struct="TTestClass" type="constructor" name="constructor Create(<TTestClass>;<Class Of TTestClass>;LongInt);"> (the angled brackets are written as "<" and ">" inside the string - currently there is no means to remove the word 'constructor' from the start of the method name without modifying the "tprocdef.customprocname" method)