Skip to content

Commit

Permalink
Add Nix support
Browse files Browse the repository at this point in the history
  • Loading branch information
techee committed Nov 1, 2024
1 parent ddb6278 commit 0496049
Show file tree
Hide file tree
Showing 14 changed files with 766 additions and 1 deletion.
1 change: 1 addition & 0 deletions data/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ filetypes_dist = \
filedefs/filetypes.makefile \
filedefs/filetypes.markdown \
filedefs/filetypes.matlab \
filedefs/filetypes.nix \
filedefs/filetypes.Meson.conf \
filedefs/filetypes.nim \
filedefs/filetypes.nsis \
Expand Down
62 changes: 62 additions & 0 deletions data/filedefs/filetypes.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# For complete documentation of this file, please see Geany's main documentation
[styling]
# Edit these in the colorscheme .conf file instead

default=default
commentline=comment_line
commentblock=comment
string=string_1
stringmultiline=string_1
escapechar=regex
identifier=default
operator=operator
operatorstring=regex
number=number_1
key=tag
path=preprocessor
keyword1=keyword_1
keyword2=keyword_1
keyword3=keyword_2
keyword4=keyword_2

[keywords]
# all items must be in one line
keywords1=assert else if in inherit let or rec then with
keywords2=false null true
keywords3=abort add addDrvOutputDependencies all any attrNames attrValues baseNameOf bitAnd bitOr bitXor break builtins catAttrs ceil compareVersions concatLists concatMap concatStringsSep convertHash currentSystem currentTime deepSeq derivation dirOf div elem elemAt fetchClosure fetchGit fetchTarball fetchTree fetchurl filter filterSource findFile flakeRefToString floor foldl' fromJSON fromTOML functionArgs genList genericClosure getAttr getContext getEnv getFlake groupBy hasAttr hasContext hashFile hashString head import intersectAttrs isAttrs isBool isFloat isFunction isInt isList isNull isPath isString langVersion length lessThan listToAttrs map mapAttrs match mul nixPath nixVersion outputOf parseDrvName parseFlakeRef partition path pathExists placeholder readDir readFile readFileType removeAttrs replaceStrings seq sort split splitVersion storeDir storePath stringLength sub substring tail throw toFile toJSON toPath toString toXML trace traceVerbose tryEval typeOf unsafeDiscardOutputDependency unsafeDiscardStringContext warn zipAttrsWith
keywords4=

[lexer_properties]

[settings]
# default extension used when saving files
extension=nix

# MIME type
mime_type=text/x-nix

# these characters define word boundaries when making selections and searching
# using word matching options
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789

# single comment char, like # in this file
comment_single=#
# multiline comments
#comment_open=/*
#comment_close=*/

# set to false if a comment character/string should start at column 0 of a line, true uses any
# indentation of the line, e.g. setting to true causes the following on pressing CTRL+d
# #command_example();
# setting to false would generate this
# # command_example();
# This setting works only for single line comments
comment_use_indent=true

# context action command (please see Geany's main documentation for details)
context_action_cmd=

[indentation]
#width=4
# 0 is spaces, 1 is tabs, 2 is tab & spaces
#type=0
1 change: 1 addition & 0 deletions data/filetype_extensions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Markdown=*.mdml;*.markdown;*.md;*.mkd;*.mkdn;*.mdwn;*.mdown;*.mdtxt;*.mdtext;
Matlab/Octave=*.m;
Meson=meson.build;meson.options;meson_options.txt;
Nim=*.nim;
Nix=*.nix;
NSIS=*.nsi;*.nsh;
Objective-C=*.m;*.mm;*.h;
Pascal=*.pas;*.pp;*.inc;*.dpr;*.dpk;*.lpr;
Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ lexilla = static_library('lexilla',
'scintilla/lexilla/lexers/LexMarkdown.cxx',
'scintilla/lexilla/lexers/LexMatlab.cxx',
'scintilla/lexilla/lexers/LexNim.cxx',
'scintilla/lexilla/lexers/LexNix.cxx',
'scintilla/lexilla/lexers/LexNsis.cxx',
'scintilla/lexilla/lexers/LexNull.cxx',
'scintilla/lexilla/lexers/LexPascal.cxx',
Expand Down
1 change: 1 addition & 0 deletions scintilla/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ lexilla/lexers/LexMake.cxx \
lexilla/lexers/LexMarkdown.cxx \
lexilla/lexers/LexMatlab.cxx \
lexilla/lexers/LexNim.cxx \
lexilla/lexers/LexNix.cxx \
lexilla/lexers/LexNsis.cxx \
lexilla/lexers/LexNull.cxx \
lexilla/lexers/LexPascal.cxx \
Expand Down
123 changes: 123 additions & 0 deletions scintilla/lexilla/include/SciLexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@
#define SCLEX_JULIA 133
#define SCLEX_ASCIIDOC 134
#define SCLEX_GDSCRIPT 135
#define SCLEX_TOML 136
#define SCLEX_TROFF 137
#define SCLEX_DART 138
#define SCLEX_ZIG 139
#define SCLEX_NIX 140
#define SCLEX_AUTOMATIC 1000
#define SCE_P_DEFAULT 0
#define SCE_P_COMMENTLINE 1
Expand Down Expand Up @@ -198,6 +203,19 @@
#define SCE_C_USERLITERAL 25
#define SCE_C_TASKMARKER 26
#define SCE_C_ESCAPESEQUENCE 27
#define SCE_COBOL_DEFAULT 0
#define SCE_COBOL_COMMENT 1
#define SCE_COBOL_COMMENTLINE 2
#define SCE_COBOL_COMMENTDOC 3
#define SCE_COBOL_NUMBER 4
#define SCE_COBOL_WORD 5
#define SCE_COBOL_STRING 6
#define SCE_COBOL_CHARACTER 7
#define SCE_COBOL_WORD3 8
#define SCE_COBOL_PREPROCESSOR 9
#define SCE_COBOL_OPERATOR 10
#define SCE_COBOL_IDENTIFIER 11
#define SCE_COBOL_WORD2 16
#define SCE_D_DEFAULT 0
#define SCE_D_COMMENT 1
#define SCE_D_COMMENTLINE 2
Expand Down Expand Up @@ -288,6 +306,7 @@
#define SCE_HJ_SYMBOLS 50
#define SCE_HJ_STRINGEOL 51
#define SCE_HJ_REGEX 52
#define SCE_HJ_TEMPLATELITERAL 53
#define SCE_HJA_START 55
#define SCE_HJA_DEFAULT 56
#define SCE_HJA_COMMENT 57
Expand All @@ -301,6 +320,7 @@
#define SCE_HJA_SYMBOLS 65
#define SCE_HJA_STRINGEOL 66
#define SCE_HJA_REGEX 67
#define SCE_HJA_TEMPLATELITERAL 68
#define SCE_HB_START 70
#define SCE_HB_DEFAULT 71
#define SCE_HB_COMMENTLINE 72
Expand Down Expand Up @@ -2058,6 +2078,109 @@
#define SCE_GD_WORD2 14
#define SCE_GD_ANNOTATION 15
#define SCE_GD_NODEPATH 16
#define SCE_TOML_DEFAULT 0
#define SCE_TOML_COMMENT 1
#define SCE_TOML_IDENTIFIER 2
#define SCE_TOML_KEYWORD 3
#define SCE_TOML_NUMBER 4
#define SCE_TOML_TABLE 5
#define SCE_TOML_KEY 6
#define SCE_TOML_ERROR 7
#define SCE_TOML_OPERATOR 8
#define SCE_TOML_STRING_SQ 9
#define SCE_TOML_STRING_DQ 10
#define SCE_TOML_TRIPLE_STRING_SQ 11
#define SCE_TOML_TRIPLE_STRING_DQ 12
#define SCE_TOML_ESCAPECHAR 13
#define SCE_TOML_DATETIME 14
#define SCE_TROFF_DEFAULT 0
#define SCE_TROFF_REQUEST 1
#define SCE_TROFF_COMMAND 2
#define SCE_TROFF_NUMBER 3
#define SCE_TROFF_OPERATOR 4
#define SCE_TROFF_STRING 5
#define SCE_TROFF_COMMENT 6
#define SCE_TROFF_IGNORE 7
#define SCE_TROFF_ESCAPE_STRING 8
#define SCE_TROFF_ESCAPE_MACRO 9
#define SCE_TROFF_ESCAPE_FONT 10
#define SCE_TROFF_ESCAPE_NUMBER 11
#define SCE_TROFF_ESCAPE_COLOUR 12
#define SCE_TROFF_ESCAPE_GLYPH 13
#define SCE_TROFF_ESCAPE_ENV 14
#define SCE_TROFF_ESCAPE_SUPPRESSION 15
#define SCE_TROFF_ESCAPE_SIZE 16
#define SCE_TROFF_ESCAPE_TRANSPARENT 17
#define SCE_TROFF_ESCAPE_ISVALID 18
#define SCE_TROFF_ESCAPE_DRAW 19
#define SCE_TROFF_ESCAPE_MOVE 20
#define SCE_TROFF_ESCAPE_HEIGHT 21
#define SCE_TROFF_ESCAPE_OVERSTRIKE 22
#define SCE_TROFF_ESCAPE_SLANT 23
#define SCE_TROFF_ESCAPE_WIDTH 24
#define SCE_TROFF_ESCAPE_VSPACING 25
#define SCE_TROFF_ESCAPE_DEVICE 26
#define SCE_TROFF_ESCAPE_NOMOVE 27
#define SCE_DART_DEFAULT 0
#define SCE_DART_COMMENTLINE 1
#define SCE_DART_COMMENTLINEDOC 2
#define SCE_DART_COMMENTBLOCK 3
#define SCE_DART_COMMENTBLOCKDOC 4
#define SCE_DART_STRING_SQ 5
#define SCE_DART_STRING_DQ 6
#define SCE_DART_TRIPLE_STRING_SQ 7
#define SCE_DART_TRIPLE_STRING_DQ 8
#define SCE_DART_RAWSTRING_SQ 9
#define SCE_DART_RAWSTRING_DQ 10
#define SCE_DART_TRIPLE_RAWSTRING_SQ 11
#define SCE_DART_TRIPLE_RAWSTRING_DQ 12
#define SCE_DART_ESCAPECHAR 13
#define SCE_DART_IDENTIFIER 14
#define SCE_DART_IDENTIFIER_STRING 15
#define SCE_DART_OPERATOR 16
#define SCE_DART_OPERATOR_STRING 17
#define SCE_DART_SYMBOL_IDENTIFIER 18
#define SCE_DART_SYMBOL_OPERATOR 19
#define SCE_DART_NUMBER 20
#define SCE_DART_KEY 21
#define SCE_DART_METADATA 22
#define SCE_DART_KW_PRIMARY 23
#define SCE_DART_KW_SECONDARY 24
#define SCE_DART_KW_TERTIARY 25
#define SCE_DART_KW_TYPE 26
#define SCE_ZIG_DEFAULT 0
#define SCE_ZIG_COMMENTLINE 1
#define SCE_ZIG_COMMENTLINEDOC 2
#define SCE_ZIG_COMMENTLINETOP 3
#define SCE_ZIG_NUMBER 4
#define SCE_ZIG_OPERATOR 5
#define SCE_ZIG_CHARACTER 6
#define SCE_ZIG_STRING 7
#define SCE_ZIG_MULTISTRING 8
#define SCE_ZIG_ESCAPECHAR 9
#define SCE_ZIG_IDENTIFIER 10
#define SCE_ZIG_FUNCTION 11
#define SCE_ZIG_BUILTIN_FUNCTION 12
#define SCE_ZIG_KW_PRIMARY 13
#define SCE_ZIG_KW_SECONDARY 14
#define SCE_ZIG_KW_TERTIARY 15
#define SCE_ZIG_KW_TYPE 16
#define SCE_NIX_DEFAULT 0
#define SCE_NIX_COMMENTLINE 1
#define SCE_NIX_COMMENTBLOCK 2
#define SCE_NIX_STRING 3
#define SCE_NIX_STRING_MULTILINE 4
#define SCE_NIX_ESCAPECHAR 5
#define SCE_NIX_IDENTIFIER 6
#define SCE_NIX_OPERATOR 7
#define SCE_NIX_OPERATOR_STRING 8
#define SCE_NIX_NUMBER 9
#define SCE_NIX_KEY 10
#define SCE_NIX_PATH 11
#define SCE_NIX_KEYWORD1 12
#define SCE_NIX_KEYWORD2 13
#define SCE_NIX_KEYWORD3 14
#define SCE_NIX_KEYWORD4 15
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */

#endif
Loading

0 comments on commit 0496049

Please sign in to comment.