You've already forked templates-parser
mirror of
https://github.com/AdaCore/templates-parser.git
synced 2026-02-12 12:29:55 -08:00
Do not display ELSE branch when empty in tree output.
Minor clean-up, fix some expected output.
This commit is contained in:
@@ -165,7 +165,6 @@ Should be 0 : 0
|
||||
[TEXT] Well a another one [@_VAR2_@]
|
||||
[END_BLOCK]
|
||||
[END_TABLE]
|
||||
[ELSE]
|
||||
[END_IF]
|
||||
[TEXT]
|
||||
[TABLE] TERMINATE_SECTIONS
|
||||
|
||||
@@ -60,7 +60,6 @@
|
||||
[IF] @_EXIST:MATDSIZE_@
|
||||
[TEXT] @_TABLE_LINE_@
|
||||
[TEXT] [@_MATDSIZE_@]
|
||||
[ELSE]
|
||||
[END_IF]
|
||||
[END_BLOCK]
|
||||
[END_TABLE]
|
||||
@@ -81,7 +80,6 @@
|
||||
[IF] @_EXIST:V6_@
|
||||
[TEXT] >@_V5_@
|
||||
[TEXT] >@_V6_@
|
||||
[ELSE]
|
||||
[END_IF]
|
||||
[END_BLOCK]
|
||||
[END_TABLE]
|
||||
|
||||
@@ -6,5 +6,4 @@
|
||||
[TEXT]
|
||||
[IF] (@_TWO_@ > 0)
|
||||
[TEXT] here
|
||||
[ELSE]
|
||||
[END_IF]
|
||||
|
||||
@@ -84,12 +84,10 @@ include.tmplt
|
||||
[TEXT]
|
||||
[IF] (@_$2_@ = toto)
|
||||
[TEXT] 5> @_$1_@
|
||||
[ELSE]
|
||||
[END_IF]
|
||||
[TEXT]
|
||||
[IF] ((@_WEB_NBSP:$2_@ = toto) or (@_WEB_NBSP:$1_@ = "xx yy"))
|
||||
[TEXT] 6> @_$2_@
|
||||
[ELSE]
|
||||
[END_IF]
|
||||
[TEXT]
|
||||
[TABLE]
|
||||
@@ -122,12 +120,10 @@ include.tmplt
|
||||
[TEXT]
|
||||
[IF] (@_$2_@ = toto)
|
||||
[TEXT] 5> @_$1_@
|
||||
[ELSE]
|
||||
[END_IF]
|
||||
[TEXT]
|
||||
[IF] ((@_WEB_NBSP:$2_@ = toto) or (@_WEB_NBSP:$1_@ = "xx yy"))
|
||||
[TEXT] 6> @_$2_@
|
||||
[ELSE]
|
||||
[END_IF]
|
||||
[TEXT]
|
||||
[TABLE]
|
||||
@@ -160,12 +156,10 @@ include.tmplt
|
||||
[TEXT]
|
||||
[IF] (@_$2_@ = toto)
|
||||
[TEXT] 5> @_$1_@
|
||||
[ELSE]
|
||||
[END_IF]
|
||||
[TEXT]
|
||||
[IF] ((@_WEB_NBSP:$2_@ = toto) or (@_WEB_NBSP:$1_@ = "xx yy"))
|
||||
[TEXT] 6> @_$2_@
|
||||
[ELSE]
|
||||
[END_IF]
|
||||
[TEXT]
|
||||
[TABLE]
|
||||
|
||||
@@ -67,7 +67,6 @@
|
||||
[COMMON]
|
||||
[IF] (@_MATDSIZE_@ /= )
|
||||
[TEXT] @_TABLE_LINE_@> @_MATDSIZE_@
|
||||
[ELSE]
|
||||
[END_IF]
|
||||
[END_BLOCK]
|
||||
[END_TABLE]
|
||||
|
||||
@@ -31,6 +31,8 @@ separate (Templates_Parser)
|
||||
|
||||
procedure Print_Tree (T : Tree; Level : Natural := 0) is
|
||||
|
||||
use type Expr.Tree;
|
||||
|
||||
procedure Print_Indent (L : Natural);
|
||||
-- Output proper number of spaces for identation
|
||||
|
||||
@@ -93,9 +95,11 @@ begin
|
||||
Expr.Print_Tree (T.Cond);
|
||||
Text_IO.New_Line;
|
||||
Print_Tree (T.N_True, Level + 1);
|
||||
Print_Indent (Level);
|
||||
Text_IO.Put_Line ("[ELSE]");
|
||||
Print_Tree (T.N_False, Level + 1);
|
||||
if T.N_False /= null then
|
||||
Print_Indent (Level);
|
||||
Text_IO.Put_Line ("[ELSE]");
|
||||
Print_Tree (T.N_False, Level + 1);
|
||||
end if;
|
||||
Print_Indent (Level);
|
||||
Text_IO.Put_Line ("[END_IF]");
|
||||
Print_Tree (T.Next, Level);
|
||||
|
||||
Reference in New Issue
Block a user