Uses the recently merged Zig lexer from lexilla.
Fixes #3724. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3974
-- Commit Summary --
* Add Zig support
-- File Changes --
M data/Makefile.am (3) A data/filedefs/filetypes.zig (71) M data/filetype_extensions.conf (1) M meson.build (1) M scintilla/Makefile.am (3) M scintilla/lexilla/include/SciLexer.h (19) A scintilla/lexilla/lexers/LexZig.cxx (465) M scintilla/lexilla/src/Lexilla.cxx (3) M scintilla/scintilla_changes.patch (1) M src/editor.c (2) M src/filetypes.c (1) M src/filetypes.h (1) M src/highlighting.c (11) M src/highlightingmappings.h (32)
-- Patch Links --
https://github.com/geany/geany/pull/3974.patch https://github.com/geany/geany/pull/3974.diff
@techee pushed 1 commit.
1cd4d6609a5c7498f4ae3af970145b4ff30b0ccb Add Zig support
LGBI. Not that I know anything about Zig, just a bit of Geany :)
@eht16 Thanks for having a look at it.
I forgot to mention that there hasn't been a formal lexilla release with Zig or Dart yet. This means that the changes in SciLexer.h for these lexers had to be added manually rather than using the real Lexilla's unmodified file. In any case, once Geany updates to the latest lexilla, it should be auto-fixed.
I forgot to mention that there hasn't been a formal lexilla release with Zig or Dart yet. This means that the changes in SciLexer.h for these lexers had to be added manually rather than using the real Lexilla's unmodified file. In any case, once Geany updates to the latest lexilla, it should be auto-fixed.
Fine, we have done that before until Geany updates of Lexilla and ctags which is usually slower than Lexilla and ctags releases ;-)
@techee pushed 4 commits.
23be3acfbf0eebfc8641ceaa4442b80ce550b3e8 Add Zig support f10c566e684e5469c7c73eebc217b3fdb1a252b7 Fix scintilla_changes.patch 1544de2ee06123efbf9382f7edeebc45133fa004 Use the latest SciLexer.h from lexilla ba27bf06f356c13db4669f42d2dbcbdad43ddf46 Add SCE_ZIG_CHARACTER and SCE_ZIG_ESCAPECHAR to highlighting_is_string_style()
@techee commented on this pull request.
@@ -1685,6 +1687,10 @@ gboolean highlighting_is_string_style(gint lexer, gint style)
style == SCE_NIM_TRIPLE || style == SCE_NIM_TRIPLEDOUBLE || style == SCE_NIM_STRINGEOL); + + case SCLEX_ZIG: + return (style == SCE_ZIG_STRING || + style == SCE_ZIG_MULTISTRING);
Correct, done.
@elextr commented on this pull request.
+#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
troff ??
@techee commented on this pull request.
+#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
Yes, this is `SciLexer.h` taken from lexilla - it contains all the styles for all the languages that lexilla supports (we don't patch it in any way). In addition to Zig, Dart, and TOML that I added to lexilla, the troff lexer was merged independently of me so there's this extra language as well.
@elextr commented on this pull request.
+#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
Ok
@techee pushed 1 commit.
8255fc7033913cd8fde87ab6b5dbb1d00633f213 Support identifiers expressed as strings
@b4n approved this pull request.
LGTM. I don't know any Zig, but this PR seems to work OK.
@techee would you like to squash it a bit, or merge as-is?
> @techee would you like to squash it a bit, or merge as-is?
Yeah, squashed. Merging. Thanks for having a look at it.
Merged #3974 into master.
github-comments@lists.geany.org