From a79040fbd00a80a3d1424e75063eef0491315cad Mon Sep 17 00:00:00 2001 From: Darren Bane Date: Fri, 7 Nov 2025 23:42:31 +0000 Subject: [PATCH] Add snippets for Ada following the old MIL-HDBK-1804 ( https://portal.mozz.us/gemini/republic.circumlunar.space/users/dbane/ada_doc/pmh1804.txt ) --- snippets/ada-ts-mode/fctbody | 27 +++++++++++++++++++++++++++ snippets/ada-ts-mode/fctspec | 36 ++++++++++++++++++++++++++++++++++++ snippets/ada-ts-mode/pacbody | 25 +++++++++++++++++++++++++ snippets/ada-ts-mode/pacspec | 34 ++++++++++++++++++++++++++++++++++ snippets/ada-ts-mode/probody | 26 ++++++++++++++++++++++++++ snippets/ada-ts-mode/prospec | 35 +++++++++++++++++++++++++++++++++++ snippets/ada-ts-mode/tskbody | 24 ++++++++++++++++++++++++ snippets/ada-ts-mode/tskspec | 28 ++++++++++++++++++++++++++++ 8 files changed, 235 insertions(+) create mode 100644 snippets/ada-ts-mode/fctbody create mode 100644 snippets/ada-ts-mode/fctspec create mode 100644 snippets/ada-ts-mode/pacbody create mode 100644 snippets/ada-ts-mode/pacspec create mode 100644 snippets/ada-ts-mode/probody create mode 100644 snippets/ada-ts-mode/prospec create mode 100644 snippets/ada-ts-mode/tskbody create mode 100644 snippets/ada-ts-mode/tskspec diff --git a/snippets/ada-ts-mode/fctbody b/snippets/ada-ts-mode/fctbody new file mode 100644 index 00000000..eaada344 --- /dev/null +++ b/snippets/ada-ts-mode/fctbody @@ -0,0 +1,27 @@ +# -*- mode: snippet -*- +# name: function_body +# key: fctbody +# -- +-- .................................. +-- . . +-- . ${1:Subprogram_name} . BODY +-- . . +-- .................................. +function ${2:} + ( ${3:; + } ) + return ${4:} is + +--| Notes (none) +--| ${5:[Additional comments on the use of the subprogram.]} +--| +--| Modifications +--| ${6:[A list of modifications made to the subprogram BODY. +--| Each entry in the list should include the date of the change, +--| the name of the person who made the change, and a description +--| of the modification. The first entry in the list should +--| always be the initial coding of the subprogram body. +--| The "Modifications" section is required only when the +--| subprogram body is a stand-alone compilation unit +--| in a file of its own.]} +$0 diff --git a/snippets/ada-ts-mode/fctspec b/snippets/ada-ts-mode/fctspec new file mode 100644 index 00000000..a90a6443 --- /dev/null +++ b/snippets/ada-ts-mode/fctspec @@ -0,0 +1,36 @@ +# -*- mode: snippet -*- +# name: function_specification +# key: fctspec +# -- +--X1804: CSU +-- .................................. +-- . . +-- . ${1:Subprogram_name} . SPEC +-- . . +-- .................................. +function ${2:} + ( ${3:; + } ) + return ${4:}; + +--| Purpose +--| ${5:[This section is a description of all purposes and functions +--| of the subprogram.]} +--| +--| Exceptions (none) +--| ${6:[A list of all exceptions which may propagate out of the +--| subprogram, and a description of when each would be raised.]} +--| +--| Notes (none) +--| ${7:[Additional comments on the use of the subprogram.]} +--| +--| Modifications +--| ${8:[A list of modifications made to the subprogram DECLARATION. +--| Each entry in the list should include the date of the change, +--| the name of the person who made the change, and a description +--| of the modification. The first entry in the list should +--| always be the initial coding of the subprogram declaration. +--| The "Modifications" section is required only when the +--| subprogram declaration is a stand-alone compilation unit +--| in a file of its own.]} +$0 diff --git a/snippets/ada-ts-mode/pacbody b/snippets/ada-ts-mode/pacbody new file mode 100644 index 00000000..49937f22 --- /dev/null +++ b/snippets/ada-ts-mode/pacbody @@ -0,0 +1,25 @@ +# -*- mode: snippet -*- +# name: package_body +# key: pacbody +# -- +-- ********************************** +-- * * +-- * ${1:Package_name} * BODY +-- * * +-- ********************************** +package body ${2:} is + +--| Notes (none) +--| ${3:[Additional comments on the design, implementation, and +--| use of the package.]} +--| +--| Modifications +--| ${4:[A list of modifications made to the package BODY. +--| Each entry in the list should include the date of the change, +--| the name of the person who made the change, and a description +--| of the modification. The first entry in the list should +--| always be the initial coding of the package BODY. +--| The "Modifications" section is required only when the +--| package BODY is a stand-alone compilation unit +--| in a file of its own.]} +$0 diff --git a/snippets/ada-ts-mode/pacspec b/snippets/ada-ts-mode/pacspec new file mode 100644 index 00000000..43d9edc3 --- /dev/null +++ b/snippets/ada-ts-mode/pacspec @@ -0,0 +1,34 @@ +# -*- mode: snippet -*- +# name: package_specification +# key: pacspec +# -- +--X1804: CSC +-- ********************************** +-- * * +-- * ${1:Package_name} * SPEC +-- * * +-- ********************************** +package ${2:} is + +--| Purpose +--| ${3:[This section is a description of the purpose and function +--| of the package.]} +--| +--| Initialization Exceptions (none) +--| ${4:[A list of all exceptions which may propagate out of the +--| package INITIALIZATION PART and a description of when each +--| would be raised.]} +--| +--| Notes (none) +--| ${5:[Additional comments on the use of the package.]} +--| +--| Modifications +--| ${6:[A list of modifications made to the package SPECIFICATION. +--| Each entry in the list should include the date of the change, +--| the name of the person who made the change, and a description +--| of the modification. The first entry in the list should +--| always be the initial coding of the package specification. +--| The "Modifications" section is required only when the +--| package specification is a stand-alone compilation unit +--| in a file of its own.]} +$0 \ No newline at end of file diff --git a/snippets/ada-ts-mode/probody b/snippets/ada-ts-mode/probody new file mode 100644 index 00000000..2064faf4 --- /dev/null +++ b/snippets/ada-ts-mode/probody @@ -0,0 +1,26 @@ +# -*- mode: snippet -*- +# name: procedure_body +# key: probody +# -- +-- .................................. +-- . . +-- . ${1:Subprogram_name} . BODY +-- . . +-- .................................. +procedure ${2:} + ( ${3:; + } ) is + +--| Notes (none) +--| ${4:[Additional comments on the use of the subprogram.]} +--| +--| Modifications +--| ${5:[A list of modifications made to the subprogram BODY. +--| Each entry in the list should include the date of the change, +--| the name of the person who made the change, and a description +--| of the modification. The first entry in the list should +--| always be the initial coding of the subprogram body. +--| The "Modifications" section is required only when the +--| subprogram body is a stand-alone compilation unit +--| in a file of its own.]} +$0 diff --git a/snippets/ada-ts-mode/prospec b/snippets/ada-ts-mode/prospec new file mode 100644 index 00000000..bd623c13 --- /dev/null +++ b/snippets/ada-ts-mode/prospec @@ -0,0 +1,35 @@ +# -*- mode: snippet -*- +# name: procedure_specification +# key: prospec +# -- +--X1804: CSU +-- .................................. +-- . . +-- . ${1:Subprogram_name} . SPEC +-- . . +-- .................................. +procedure ${2:} + ( ${3:; + } ); + +--| Purpose +--| ${4:[This section is a description of all purposes and functions +--| of the subprogram.]} +--| +--| Exceptions (none) +--| ${5:[A list of all exceptions which may propagate out of the +--| subprogram, and a description of when each would be raised.]} +--| +--| Notes (none) +--| ${6:[Additional comments on the use of the subprogram.]} +--| +--| Modifications +--| ${7:[A list of modifications made to the subprogram DECLARATION. +--| Each entry in the list should include the date of the change, +--| the name of the person who made the change, and a description +--| of the modification. The first entry in the list should +--| always be the initial coding of the subprogram declaration. +--| The "Modifications" section is required only when the +--| subprogram declaration is a stand-alone compilation unit +--| in a file of its own.]} +$0 diff --git a/snippets/ada-ts-mode/tskbody b/snippets/ada-ts-mode/tskbody new file mode 100644 index 00000000..e32c0db8 --- /dev/null +++ b/snippets/ada-ts-mode/tskbody @@ -0,0 +1,24 @@ +# -*- mode: snippet -*- +# name: task_body +# key: tskbody +# -- +-- ********************************** +-- * * +-- * ${1:Task_name} * BODY +-- * * +-- ********************************** +task body ${2:} is + +--| Notes (none) +--| ${3:[Additional comments on the use of the task.]} +--| +--| Modifications +--| ${4:[A list of modifications made to the task BODY. +--| Each entry in the list should include the date of the change, +--| the name of the person who made the change, and a description +--| of the modification. The first entry in the list should +--| always be the initial coding of the task BODY. +--| The "Modifications" section is required only when the +--| task BODY is a stand-alone compilation unit +--| in a file of its own.]} +$0 diff --git a/snippets/ada-ts-mode/tskspec b/snippets/ada-ts-mode/tskspec new file mode 100644 index 00000000..cf033675 --- /dev/null +++ b/snippets/ada-ts-mode/tskspec @@ -0,0 +1,28 @@ +# -*- mode: snippet -*- +# name: task_specification +# key: tskspec +# -- +-- ********************************** +-- * * +-- * ${1:Task_name} * SPEC +-- * * +-- ********************************** +task ${2:} is + +--| Purpose +--| ${3:[This section is a description of all purposes and functions +--| of the task.]} +--| +--| Notes (none) +--| ${4:[Additional comments on the use of the task.]} +--| +--| Modifications +--| ${5:[A list of modifications made to the task DECLARATION. +--| Each entry in the list should include the date of the change, +--| the name of the person who made the change, and a description +--| of the modification. The first entry in the list should +--| always be the initial coding of the task declaration. +--| The "Modifications" section is required only when the +--| task declaration is a stand-alone compilation unit +--| in a file of its own.]} +$0