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

feat: Some extensions to the syntax. #62

Merged
merged 1 commit into from
Feb 21, 2022
Merged

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Feb 21, 2022

Summary:

  • static_assert is now allowed inside functions.
  • sizeof can now contain any expression, not just constant expressions. E.g. sizeof(++*foo) is allowed in principle in the syntax. Tokstyle may later check this for sanity, but we want to use static_assert(sizeof(expr) == sizeof(other_expr), ...) with non-constexprs.
  • Tokstyle exclusions are now recorded as comments so we can reproduce them in pretty-printing.
  • GNU_PRINTF is now supported in the AST.
  • Multi-line macro body printing now works correctly (with escape at eol).

This change is Reviewable

@iphydf iphydf added this to the 0.0.15 milestone Feb 21, 2022
@auto-add-label auto-add-label bot added the enhancement New feature for the user, not a new feature for build script label Feb 21, 2022
@iphydf iphydf force-pushed the syntax branch 2 times, most recently from 834e5d8 to f66bad4 Compare February 21, 2022 22:56
* `static_assert` is now allowed inside functions.
* `sizeof` can now contain any expression, not just constant
  expressions. E.g. `sizeof(++*foo)` is allowed in principle in the
  syntax. Tokstyle may later check this for sanity, but we want to use
  `static_assert(sizeof(expr) == sizeof(other_expr), ...)` with
  non-constexprs.
* Tokstyle exclusions are now recorded as comments so we can reproduce
  them in pretty-printing.
* `GNU_PRINTF` is now supported in the AST.
* Multi-line macro body printing now works correctly (with `\\` at eol).
Copy link
Member

@JFreegman JFreegman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 10 of 10 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained

@toktok-releaser toktok-releaser merged commit 02e8fe8 into TokTok:master Feb 21, 2022
@iphydf iphydf deleted the syntax branch February 21, 2022 23:13
@iphydf iphydf changed the title feat: Some extensions to the syntax: feat: Some extensions to the syntax. Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature for the user, not a new feature for build script
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants