-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--sort=no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
name Units/simple-nix.d/input.nix /^ name = "hello";$/;" a | ||
hash Units/simple-nix.d/input.nix /^ hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";$/;" a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ stdenv, fetchgit }: | ||
|
||
stdenv.mkDerivation { | ||
name = "hello"; | ||
src = fetchgit { | ||
url = "https://example.com"; | ||
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Generated by ./misc/optlib2c from optlib/nix.ctags, Don't edit this manually. | ||
*/ | ||
#include "general.h" | ||
#include "parse.h" | ||
#include "routines.h" | ||
#include "field.h" | ||
#include "xtag.h" | ||
|
||
|
||
static void initializeNixParser (const langType language CTAGS_ATTR_UNUSED) | ||
{ | ||
} | ||
|
||
extern parserDefinition* NixParser (void) | ||
{ | ||
static const char *const extensions [] = { | ||
"nix", | ||
NULL | ||
}; | ||
|
||
static const char *const aliases [] = { | ||
NULL | ||
}; | ||
|
||
static const char *const patterns [] = { | ||
NULL | ||
}; | ||
|
||
static kindDefinition NixKindTable [] = { | ||
{ | ||
true, 'p', "package", "package definition", | ||
}, | ||
{ | ||
true, 'f', "function", "function definition", | ||
}, | ||
{ | ||
true, 'a', "attr", "attribute definition", | ||
}, | ||
}; | ||
static tagRegexTable NixTagRegexTable [] = { | ||
{"[p?]name\\s*=\\s*\"(\\w+)\"", "\\1", | ||
"p", NULL, NULL, false}, | ||
{"(\\S+)\\s*=\\s+\\w+:", "\\1", | ||
"f", NULL, NULL, false}, | ||
{"\\s+([a-zA-Z_0-9-]{4,20})\\s*=", "\\1", | ||
"a", NULL, NULL, false}, | ||
}; | ||
|
||
|
||
parserDefinition* const def = parserNew ("Nix"); | ||
|
||
def->versionCurrent= 0; | ||
def->versionAge = 0; | ||
def->enabled = true; | ||
def->extensions = extensions; | ||
def->patterns = patterns; | ||
def->aliases = aliases; | ||
def->method = METHOD_NOT_CRAFTED|METHOD_REGEX; | ||
def->kindTable = NixKindTable; | ||
def->kindCount = ARRAY_SIZE(NixKindTable); | ||
def->tagRegexTable = NixTagRegexTable; | ||
def->tagRegexCount = ARRAY_SIZE(NixTagRegexTable); | ||
def->initialize = initializeNixParser; | ||
|
||
return def; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# | ||
# | ||
# Copyright (c) 2024, Ben Sima | ||
# | ||
# Author: Ben Sima <[email protected]> | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# as published by the Free Software Foundation; either version 2 | ||
# of the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||
# USA. | ||
# | ||
# | ||
--langdef=Nix | ||
--map-Nix=+.nix | ||
|
||
# Index packages when we see "name = <tag>" or "pname = <tag>" | ||
--kinddef-Nix=p,package,package definition | ||
--regex-Nix=/[p?]name\s*=\s*"(\w+)"/\1/p/ | ||
|
||
# Functions have args, so look for a : right of the = | ||
# (This should probably be a multiline regex.) | ||
--kinddef-Nix=f,function,function definition | ||
--regex-Nix=/(\S+)\s*=\s+\w+:/\1/f/ | ||
|
||
# Attrs definitions just have =, but only index if they have >=4 chars, | ||
# otherwise we get way too many tags. This will also index attr definitions | ||
# inside nix build files, which is not the most useful when writing nix code, | ||
# but can be useful when writing packages I guess. | ||
--kinddef-Nix=a,attr,attribute definition | ||
--regex-Nix=/\s+([a-zA-Z_0-9-]{4,20})\s*=/\1/a/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters