Commit 033f49ae authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files
parents 9eab0412 5f33616f
......@@ -262,40 +262,4 @@ package body TASTE.Backend.Skeletons is
end loop;
return Result;
end Interface_View_Template;
-- Define a custom "Strip" filter for the templates
function Custom_Strip_Filter (Value : String;
Context : Filter_Context) return String is
pragma Unreferenced (Context);
Pre_Count, Post_Count : Natural := 0;
Index : Natural := 0;
Discard : Boolean := True;
Result : String (1 .. Value'Length);
begin
for Each of Value loop
exit when Discard = False;
if Is_Line_Terminator (Each) or Is_Space (Each) then
Pre_Count := Pre_Count + 1;
else
Discard := False;
end if;
end loop;
Discard := True;
for Each of reverse Value loop
exit when Discard = False;
if Is_Line_Terminator (Each) or Is_Space (Each) then
Post_Count := Post_Count + 1;
else
Discard := False;
end if;
end loop;
for I in Value'First + Pre_Count .. Value'Last - Post_Count loop
Index := Index + 1;
Result (Index) := Value (I);
end loop;
return Result (1 .. Index);
end Custom_Strip_Filter;
begin
Register_Filter ("STRIP", Custom_Strip_Filter'Access);
end TASTE.Backend.Skeletons;
......@@ -45,7 +45,4 @@ private
function Interface_View_Template (IV : Complete_Interface_View)
return IV_As_Template;
function Custom_Strip_Filter (Value : String;
Context : Filter_Context) return String;
end TASTE.Backend.Skeletons;
......@@ -3,4 +3,4 @@ package TASTE.Parser_Version is
"6788fd7 ; Commit Date: Fri Feb 23 15:17:57 2018 ";
Ocarina_Version : constant String :=
"Ocarina 2017.x (Working Copy from rc50d394)";
end TASTE.Parser_Version;
\ No newline at end of file
end TASTE.Parser_Version;
......@@ -28,11 +28,11 @@
package body @_CAPITALIZE:Name_@ is
@@TABLE@@
procedure @_REPLACE_ALL((\n)/):Provided_Interfaces_@ is
procedure @_STRIP:Provided_Interfaces_@ is
begin
-- Write your code here
null;
end @_REPLACE_ALL((\n)/):REPLACE(^(\S+)\s+.*/\1):Provided_Interfaces_@;
end @_STRIP:REPLACE(^(\S+)\s+.*/\1):Provided_Interfaces_@;
@@END_TABLE@@
@@TABLE@@
......
@_LOWER:Name_@(@_REPLACE_ALL((\n)/):Parameters_@)
@_LOWER:Name_@(@_STRIP:Parameters_@)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment