Skip to content

Commit

Permalink
nixd/Syntax: deprecated notes for URL literal
Browse files Browse the repository at this point in the history
  • Loading branch information
inclyc committed Sep 19, 2023
1 parent 9ff4393 commit c8603fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nixd/lib/Syntax/Parser/Parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,12 @@ uri
: URI {
$$ = decorateNode(new nixd::syntax::URI, *yylocp, *Data);
$$->S = std::string($1);

Diagnostic Diag;
Diag.Msg = "URL literal is deprecated";
Diag.Kind = Diagnostic::Warning;
Diag.Range = $$->Range;
Data->Diags.emplace_back(std::move(Diag));
}

identifier_or
Expand Down
5 changes: 5 additions & 0 deletions nixd/tools/nixd-lint/test/url-literal.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# RUN: nixd-lint %s | FileCheck %s
{
# CHECK: warning: URL literal is deprecated
bar = http://1.1.1.1;
}

0 comments on commit c8603fd

Please sign in to comment.