Skip to content

Commit c15594e

Browse files
vrnimjeSAtacker
authored andcommitted
Renamed 'rest' to 'expr', added test case and removed unnecessary changes
Signed-off-by: vrnimje <vedantnimjed@gmail.com>
1 parent adbc4ad commit c15594e

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

examples/Button.qf

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,5 @@
77
"Button2",
88
"Exit"
99
}
10-
Button{
11-
"Button3",
12-
"Exit"
13-
}
10+
1411
}

include/quick-ftxui.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct input {
4949
};
5050

5151
struct expression {
52-
std::list<node> rest;
52+
std::list<node> expr;
5353
};
5454

5555
// print function for debugging
@@ -87,7 +87,7 @@ BOOST_FUSION_ADAPT_STRUCT(client::quick_ftxui_ast::input,
8787
)
8888

8989
BOOST_FUSION_ADAPT_STRUCT(client::quick_ftxui_ast::expression,
90-
(std::list<client::quick_ftxui_ast::node>, rest)
90+
(std::list<client::quick_ftxui_ast::node>, expr)
9191
)
9292

9393
// clang-format on
@@ -161,7 +161,7 @@ void ast_printer::operator()(
161161
<< "Node" << std::endl;
162162
std::cout << '{' << std::endl;
163163

164-
for (quick_ftxui_ast::node const &node : expr.rest) {
164+
for (quick_ftxui_ast::node const &node : expr.expr) {
165165
boost::apply_visitor(node_printer(data, indent), node);
166166
}
167167

tests/test1.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ TEST_CASE("Parse Complex") {
3737
}"));
3838
}
3939

40+
TEST_CASE("Parse Multiple in any order") {
41+
REQUIRE(parse_helper("{\
42+
Input{\"amool\" , \"bmpp\", \"cmqq\"} \
43+
Button{\"amool\" , \"bmpp\"}\
44+
}"));
45+
}
46+
4047
TEST_CASE("Parse Recursive") {
4148
// expect pass
4249
REQUIRE(parse_helper("{\

0 commit comments

Comments
 (0)