Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve escape sequences support in *printf(...) #31

Open
26 tasks
scopeInfinity opened this issue Oct 9, 2021 · 1 comment
Open
26 tasks

Improve escape sequences support in *printf(...) #31

scopeInfinity opened this issue Oct 9, 2021 · 1 comment
Labels
enhancement New feature or request hacktoberfest

Comments

@scopeInfinity
Copy link
Owner

Source

Specification

Source: https://en.wikipedia.org/wiki/Printf_format_string#Format_placeholder_specification

  • syntax for a format placeholder: %[parameter][flags][width][.precision][length]type

To keep things simple we can go with the subset of the following options to build an minimum viable product

  • Type field:
    • '%'
    • 'd' 'i'
    • 'u'
    • 'f' 'F'
    • 'g' 'G'
    • 'x' 'X'
    • 'o'
    • 's'
    • 'c'
    • 'p'
  • Length field:
  • Flags field:
    • The field may be omitted (default, current behaviour)
    • '-' minus
    • '+' plus
    • ' ' space
    • '0'
  • Width field:
    • The field may be omitted (default, current behaviour)
    • or a numeric integer value
    • or a dynamic value when passed as another argument when indicated by an asterisk *.
  • Precision field:
    • The field may be omitted (default, current behaviour)
    • or a numeric integer value
    • or a dynamic value when passed as another argument when indicated by an asterisk *.

Multiple small pull requests are way better than one giant one :)

@scopeInfinity scopeInfinity added the enhancement New feature or request label Oct 9, 2021
@scopeInfinity
Copy link
Owner Author

Length field sub tasks are blocked on #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

No branches or pull requests

1 participant