Skip to content

Berry f-strings now support '::' in expression - #526

Merged
skiars merged 1 commit into
berry-lang:masterfrom
s-hadinger:fstring_double_colon
Aug 13, 2026
Merged

Berry f-strings now support '::' in expression#526
skiars merged 1 commit into
berry-lang:masterfrom
s-hadinger:fstring_double_colon

Conversation

@s-hadinger

Copy link
Copy Markdown
Contributor

Description:

Berry, now f-strings supports ':' in expression, if double as '::'.

Example:

var is_on = true
var s = f"status = {is_on ? 'on' :: 'off'}"
# s is 'status = on'

f"status = {is_on ? 'on' :: 'off'}" is equivalent to format("status = %s", is_on ? 'on' : 'off')

@skiars
skiars merged commit c304823 into berry-lang:master Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants