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

libexpr: diagnostics framework & error recovery basics #9119

Closed
wants to merge 3 commits into from

Conversation

inclyc
Copy link
Member

@inclyc inclyc commented Oct 7, 2023

Motivation

This is an initial support for warning & diagnostics (it is really large so I pushed it here for review). We talked about Nix language versioning in NixOS/rfcs#137 , and this PR brings some deprecate warnings for nix parser.

Previously we are just throwing exceptions, but it may not work for encountered some syntax we want to give a "warning" to the user, so I deferred the throwing after parsing.

Context

Depends-on: #9089
Partially-addresses: #8584

Impl strategy

Adding a macro-based framework that allow many kinds of diagnostic definition & formatting

Priorities

Add 👍 to pull requests you find important.

inclyc added 2 commits October 5, 2023 10:57
This is an NFC PR that splits epilogue & prologue from parser.

As mentioned in NixOS#8812, we can add static checking tools & auto
formatting for these files, but if it is written .y directly, the clang
parser cannot understand the code is actually "C++".
This PR contains no functioanl change, there are bunch of suggesstions
by clang-tidy in the file and there are fixes available.

Including:

- 0 -> nullptr
- use `auto` for iterator types
- sort `#include`s
- closing namespace comment
- use `.empty()` instead of comparing it with empty object
- use `auto` if it the type is apparently specified (e.g. `new Type`)
- add const specifier or `&` to improve readability
@inclyc inclyc requested a review from edolstra as a code owner October 7, 2023 16:01
@inclyc inclyc marked this pull request as draft October 7, 2023 16:02
@inclyc inclyc force-pushed the users/inclyc/support-diag branch from c84be50 to 50bf588 Compare October 7, 2023 16:28
@inclyc inclyc closed this Dec 29, 2023
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.

1 participant