Skip to content

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