Skip to content

Commit

Permalink
Merge pull request geany#3974 from techee/zig
Browse files Browse the repository at this point in the history
Add Zig support
  • Loading branch information
techee authored Nov 8, 2024
2 parents c5d68ef + 274f560 commit 2900a44
Show file tree
Hide file tree
Showing 15 changed files with 691 additions and 3 deletions.
3 changes: 2 additions & 1 deletion data/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ filetypes_dist = \
filedefs/filetypes.vhdl \
filedefs/filetypes.xml \
filedefs/filetypes.yaml \
filedefs/filetypes.zephir
filedefs/filetypes.zephir \
filedefs/filetypes.zig

# generated filetypes
filetypes_nodist = \
Expand Down
74 changes: 74 additions & 0 deletions data/filedefs/filetypes.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# For complete documentation of this file, please see Geany's main documentation
[styling]
# Edit these in the colorscheme .conf file instead
default=default
comment_line=comment_line
comment_line_doc=comment_doc
comment_line_top=comment_doc
number=number_1
operator=operator
character=character
string=string_1
multistring=string_1
escapechar=string_1
identifier=identifier_1
function=function
builtin_function=keyword_2
kw_primary=keyword_1
kw_secondary=keyword_2
kw_tertiary=keyword_2
kw_type=class
identifer_string=preprocessor
[keywords]
# all items must be in one line
primary=addrspace align allowzero and anyframe anytype asm async await break callconv catch comptime const continue defer else enum errdefer error export extern fn for if inline linksection noalias noinline nosuspend opaque or orelse packed pub resume return struct suspend switch test threadlocal try union unreachable usingnamespace var volatile while true false null undefined
secondary=i8 u8 i16 u16 i32 u32 i64 u64 i128 u128 isize usize c_char c_short c_ushort c_int c_uint c_long c_ulong c_longlong c_ulonglong c_longdouble f16 f32 f64 f80 f128 bool anyopaque void noreturn type anyerror comptime_int comptime_float
[lexer_properties]
[settings]
# default extension used when saving files
extension=zig
# MIME type
mime_type=text/x-zig
# 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

[build-menu]
# %f will be replaced by the complete filename
# %e will be replaced by the filename without extension
FT_00_LB=_Build
FT_00_CM=zig build-exe %f
FT_00_WD=
FT_02_LB=Te_st
FT_02_CM=zig test %f
FT_02_WD=
EX_00_LB=_Run
EX_00_CM=zig run %f
EX_00_WD=
1 change: 1 addition & 0 deletions data/filetype_extensions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ VHDL=*.vhd;*.vhdl;
XML=*.xml;*.sgml;*.xsl;*.xslt;*.xsd;*.xhtml;*.xul;*.dtd;*.xtpl;*.mml;*.mathml;
YAML=*.yaml;*.yml;
Zephir=*.zep;
Zig=*.zig;
None=*;

# Note: restarting is required after editing groups
Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ lexilla = static_library('lexilla',
'scintilla/lexilla/lexers/LexVHDL.cxx',
'scintilla/lexilla/lexers/LexVisualProlog.cxx',
'scintilla/lexilla/lexers/LexYAML.cxx',
'scintilla/lexilla/lexers/LexZig.cxx',
'scintilla/lexilla/lexlib/Accessor.cxx',
'scintilla/lexilla/lexlib/Accessor.h',
'scintilla/lexilla/lexlib/CatalogueModules.h',
Expand Down
3 changes: 2 additions & 1 deletion scintilla/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ lexilla/lexers/LexTxt2tags.cxx \
lexilla/lexers/LexVHDL.cxx \
lexilla/lexers/LexVerilog.cxx \
lexilla/lexers/LexVisualProlog.cxx \
lexilla/lexers/LexYAML.cxx
lexilla/lexers/LexYAML.cxx \
lexilla/lexers/LexZig.cxx

LEXLIB_SRCS = \
lexilla/include/Lexilla.h \
Expand Down
92 changes: 92 additions & 0 deletions scintilla/lexilla/include/SciLexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@
#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_AUTOMATIC 1000
#define SCE_P_DEFAULT 0
#define SCE_P_COMMENTLINE 1
Expand Down Expand Up @@ -2058,6 +2062,94 @@
#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_ZIG_IDENTIFIER_STRING 17
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */

#endif
Loading

0 comments on commit 2900a44

Please sign in to comment.