Skip to content

Commit adbc4ad

Browse files
vrnimjeSAtacker
authored andcommitted
Removing code structure's dependency on the order in which the components are to be rendered
Signed-off-by: vrnimje <vedantnimjed@gmail.com>
1 parent 00c66c4 commit adbc4ad

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

examples/Button.qf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"Exit"
99
}
1010
Button{
11-
"arg3",
12-
"Nothin"
13-
}
11+
"Button3",
12+
"Exit"
13+
}
1414
}

include/quick-ftxui.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ struct input {
4949
};
5050

5151
struct expression {
52-
button first;
5352
std::list<node> rest;
5453
};
5554

@@ -88,7 +87,6 @@ BOOST_FUSION_ADAPT_STRUCT(client::quick_ftxui_ast::input,
8887
)
8988

9089
BOOST_FUSION_ADAPT_STRUCT(client::quick_ftxui_ast::expression,
91-
(client::quick_ftxui_ast::button, first)
9290
(std::list<client::quick_ftxui_ast::node>, rest)
9391
)
9492

@@ -162,7 +160,6 @@ void ast_printer::operator()(
162160
std::cout << "tag: "
163161
<< "Node" << std::endl;
164162
std::cout << '{' << std::endl;
165-
node_printer(data, indent).operator()(expr.first);
166163

167164
for (quick_ftxui_ast::node const &node : expr.rest) {
168165
boost::apply_visitor(node_printer(data, indent), node);
@@ -215,7 +212,7 @@ struct parser
215212

216213
node = button_comp | input_comp | expression;
217214

218-
expression = '{' >> button_comp >> *node >> '}';
215+
expression = '{' >> *node >> '}';
219216

220217
// Debugging and error handling and reporting support.
221218
BOOST_SPIRIT_DEBUG_NODES((button_comp)(expression));

0 commit comments

Comments
 (0)