x if cond else y and x when cond else y expressions
This commit is contained in:
1 parent
2fe0eaf2ad
commit
e92fdb4a99
20 files changed
+336
-44
No files matched your search
@@ -110,7 +110,7 @@ format_digits :: proc(buf: []byte, shortest: bool, neg: bool, digs: Decimal_Slic
|
||||
|
||||
switch fmt {
|
||||
case 'f', 'F':
|
||||
add_bytes(&b, neg ? '-' : '+');
|
||||
add_bytes(&b, '-' if neg else '+');
|
||||
|
||||
// integer, padded with zeros when needed
|
||||
if digs.decimal_point > 0 {
|
||||
@@ -138,7 +138,7 @@ format_digits :: proc(buf: []byte, shortest: bool, neg: bool, digs: Decimal_Slic
|
||||
return to_bytes(b);
|
||||
|
||||
case 'e', 'E':
|
||||
add_bytes(&b, neg ? '-' : '+');
|
||||
add_bytes(&b, '-' if neg else '+');
|
||||
|
||||
ch := byte('0');
|
||||
if digs.count != 0 {
|
||||
|
||||
Reference in new issue
Block a user