Skip to content

Println format string padding variable syntax $ not highlighted #546

@eugenesvk

Description

@eugenesvk

println!("{:>6}",6); this is highlighted
println!("{:>pad$}",5,pad=_xx); this isn't though also should
The format-escapes rule seems to be missing the fact that count can be an identifier, not just a number
width := count
count := parameter | integer
parameter := argument '$'
argument := integer | identifier

so count := (integer | identifier) '$'?

(same for precision := count | '*')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions