Skip to content

Commit

Permalink
update(fildesh): with new boolean syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
grencez committed Jun 10, 2024
1 parent c720229 commit 5293472
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ bazel_dep(name = "rules_proto", version = "4.0.0")
git_override(
module_name = "fildesh",
remote = "https://github.com/grencez/fildesh.git",
commit="11ff65ed78103bc1b1caefb1deb8fa42110eea08",
commit="b8ff76bc9f8aa9b063a04891a7ad0460f3522d88",
)
2 changes: 1 addition & 1 deletion example/popcorn.sxpb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(name "popcorn")
(amount 3)
(variety true)
(variety +true)
(expect_unit_cost 7.50)

; List of favorite kinds.
Expand Down
2 changes: 1 addition & 1 deletion example/sauces.sxpb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
(()
(name "hot sauce")
(amount 3)
(variety true)
(variety +true)
(expect_unit_cost 6.50)
((favorites)
"yuzu" "kiss" "fire"
Expand Down
6 changes: 6 additions & 0 deletions src/binaryproto2sxproto_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ write_message_to_sxproto_ostream(
if (i > 0) {out << ' ';}
std::string s;
TextFormat::PrintFieldValueToString(message, field, i, &s);
if (field->type() == FieldDescriptor::TYPE_BOOL) {
out << '+';
}
out << s;
}
}
Expand All @@ -56,6 +59,9 @@ write_message_to_sxproto_ostream(
else {
std::string s;
TextFormat::PrintFieldValueToString(message, field, -1, &s);
if (field->type() == FieldDescriptor::TYPE_BOOL) {
out << '+';
}
out << s;
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/loneof/travel.sxpb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
((commute_with bus) (name "muni"))
((joyride_with car))
((vacation_with car) (rideshare true))
((vacation_with car) (rideshare +true))
16 changes: 8 additions & 8 deletions test/manyof/boolexpr.sxpb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
((expressions)

(value true)
(value +true)

(not (value false))
(not (value +false))

((or) (() (value false)) (() (value true)))
((or) (value false) (value true))
(((or)) false true)
((or) (() (value +false)) (() (value +true)))
((or) (value +false) (value +true))
(((or)) +false +true)

(((or))
false
(((and)) true false)
(((or)) false false true))
+false
(((and)) +true +false)
(((or)) +false +false +true))
)

0 comments on commit 5293472

Please sign in to comment.