@techee requested changes on this pull request.
@killerbees19 Thanks for all your work and your patience! I'll try to assist you to get this merged to Geany finally.
A few more general comments apart from those commenting specific code:
lexer_has_braces()
in editor.c
- see HACKING.Apart from these suggestions the pull request looks good to me in general so once they are resolved, I think we could merge it.
In data/filedefs/filetypes.cil:
> @@ -0,0 +1,36 @@ +# For complete documentation of this file, please see Geany's main documentation +[styling] +# Edit these in the colorscheme .conf file instead +default=default +comment=comment +commentline=comment_line +stringliteral=string
I'd suggest renaming stringliteral
to string
here.
In data/filedefs/filetypes.cil:
> +stringliteral=string +keyword=type +keyword2=keyword_2 +keyword3=keyword_1 +label=preprocessor +operator=operator +stringeol=string_eol +identifier=identifier_1 + +[keywords] +# Credits: Jad Altahan (github.com/xv) - https://sourceforge.net/p/scintilla/feature-requests/1265/#fa85/e6e8/8255/9ec1/e3a3 +keywords=bool char float32 float64 int int8 int16 int32 int64 native nullref object string typedref uint8 uint32 unsigned abstract ansi assembly auto autochar beforefieldinit catch cdecl cil class compilercontrolled explicit extends extern famandassem family famorassem fastcall final finally forwardref hidebysig implements initonly instance interface internalcall lasterr literal managed nested newslot noinlining nomangle nooptimization notserialized optil pinvokeimpl platformapi preservesig private privatescope public reqsecobj rtspecialname runtime sealed sequential serializable specialname static stdcall strict synchronized thiscall unicode unmanaged unmanagedexp valuetype vararg virtual void winapi +metadata=.addon .assembly .cctor .class .corflags .ctor .custom .data .emitbyte .entrypoint .event .export .field .file .fire .get .hash .imagebase .import .language .line .locale .localized .locals .manifestres .maxstack .method .module .mresource .namespace .other .override .pack .param .pdirect .permission .permissionset .property .property .publickey .publickeytoken .removeon .set .size .stackreserve .subsystem .try .ver .vtable .vtentry .vtfixup .zeroinit +opcode=add add.ovf add.ovf.un and arglist beq beq.s bge bge.s bge.un bge.un.s bgt bgt.s bgt.un bgt.un.s ble ble.s ble.un ble.un.s blt blt.s blt.un blt.un.s bne.un bne.un.s box br br.s break brfalse brfalse.s brinst brinst.s brnull brnull.s brtrue brtrue.s brzero brzero.s bstr call calli callmostderived callvirt castclass ceq cgt cgt.un ckfinite ckfinite clt clt.un constrained. conv.i conv.i1 conv.i2 conv.i4 conv.i8 conv.ovf.i conv.ovf.i.un conv.ovf.i1 conv.ovf.i1.un conv.ovf.i2 conv.ovf.i2.un conv.ovf.i4 conv.ovf.i4.un conv.ovf.i8 conv.ovf.i8.un conv.ovf.u conv.ovf.u.un conv.ovf.u1 conv.ovf.u1.un conv.ovf.u2 conv.ovf.u2.un conv.ovf.u4 conv.ovf.u4.un conv.ovf.u8 conv.ovf.u8.un conv.r.un conv.r4 conv.r8 conv.u conv.u1 conv.u2 conv.u4 conv.u8 cpblk cpobj div div.un dup endfault endfilter endfinally initblk initobj isinst jmp ldarg ldarg.0 ldarg.1 ldarg.2 ldarg.3 ldarg.s ldarga ldarga.s ldc.i4 ldc.i4.0 ldc.i4.1 ldc.i4.2 ldc.i4.3 ldc.i4.4 ldc.i4.5 ldc.i4.6 ldc.i4.7 ldc.i4.8 ldc.i4.m1 ldc.i4.s ldc.i8 ldc.r4 ldc.r8 ldelem ldelem.i ldelem.i1 ldelem.i2 ldelem.i4 ldelem.i8 ldelem.r4 ldelem.r8 ldelem.ref ldelem.u1 ldelem.u2 ldelem.u4 ldelema ldfld ldflda ldftn ldind.i ldind.i1 ldind.i2 ldind.i4 ldind.i8 ldind.r4 ldind.r8 ldind.ref ldind.u1 ldind.u2 ldind.u4 ldlen ldloc ldloc.0 ldloc.1 ldloc.2 ldloc.3 ldloc.s ldloca ldloca.s ldnull ldobj ldsfld ldsflda ldstr ldtoken ldvirtftn leave leave.s localloc mkrefany mul mul.ovf mul.ovf.un neg newarr newobj no. nop not or pop readonly. refanytype refanyval rem rem.un ret rethrow shl shr shr.un sizeof starg starg.s stelem stelem.i stelem.i1 stelem.i2 stelem.i4 stelem.i8 stelem.r4 stelem.r8 stelem.ref stfld stind.i stind.i1 stind.i2 stind.i4 stind.i8 stind.r4 stind.r8 stind.ref stloc stloc.0 stloc.1 stloc.2 stloc.3 stloc.s stobj stsfld sub sub.ovf sub.ovf.un switch tail. throw unaligned. unbox unbox.any volatile. xor + +[settings]
Please have a look at some other filetype file (e.g. filetypes.c
) and add all the settings and comments (that aren't too specific to the given language) in this file. This will make all filetype config files look similar and have some config options that are easy to modify by users.
For mime_type
use text/x-cil
- I haven't found the correct MIME type for CIL but this could be OK.
In data/filedefs/filetypes.cil:
> + +[settings] +lexer_filetype=CIL + +# default extension used when saving files +extension=il + +[indentation] +#width=4 +# 0 is spaces, 1 is tabs, 2 is tab & spaces +#type=1 + +[build_settings] +## %f will be replaced by the complete filename +## %e will be replaced by the filename without extension +#compiler=ilasm /OUTPUT="%e" "%f"
Is this some standard tool or are there many alternatives? The most commonly used one could be left uncommented and you could also specify some other commands - see filetypes.c
.
In data/filetype_extensions.conf:
> @@ -15,6 +15,7 @@ BibTeX=*.bib; CAML=*.ml;*.mli; C=*.c;*.xpm; C++=*.cpp;*.cxx;*.c++;*.cc;*.h;*.hpp;*.hxx;*.h++;*.hh;*.C;*.H; +CIL=*.il
Just curious - I don't have any experience with CIL but I used "smali" (decompiled Android bytecode) and it looks very similar to CIL, maybe it's just another dialect of it. So I think also *.smali
could be added here.
In scintilla/scintilla_changes.patch:
> @@ -62,7 +62,7 @@ diff --git scintilla/lexilla/src/Lexilla.cxx scintilla/lexilla/src/Lexilla.cxx index cd4b23617..af4a73db4 100644 --- scintilla/lexilla/src/Lexilla.cxx +++ scintilla/lexilla/src/Lexilla.cxx -@@ -165,12 +165,69 @@ namespace { +@@ -165,12 +165,71 @@ namespace {
Drop this diff - the patch should succeed without it.
In src/filetypes.c:
> @@ -475,7 +476,7 @@ static guint match_basename(const GeanyFiletype *ft, const gchar *base_filename) for (guint j = 0; ft->pattern[j] != NULL; j++) { gchar *pat = ft->pattern[j]; - +
Drop the whitespace diff.
In src/filetypes.c:
> @@ -536,7 +537,7 @@ GeanyFiletype *filetypes_detect_from_extension(const gchar *utf8_filename) for (guint i = 0; i < filetypes_array->len; i++) { guint mlen = match_basename(filetypes[i], base_filename); - +
Drop the whitespace diff.
> @@ -1567,6 +1569,9 @@ gboolean highlighting_is_string_style(gint lexer, gint style) style == SCE_H_SGML_SIMPLESTRING || style == SCE_H_SINGLESTRING); + case SCLEX_CIL: + return (style == SCE_CIL_STRING);
I'd also suggest adding SCE_CIL_STRINGEOL here.
> @@ -1869,7 +1879,7 @@ gboolean highlighting_is_comment_style(gint lexer, gint style) case SCLEX_MARKDOWN: /* there is no comment type in those lexers, listing here just for completeness */ return FALSE; - +
Drop the whitespace diff.
In src/highlightingmappings.h:
> @@ -336,6 +336,31 @@ static const HLKeyword highlighting_keywords_CAML[] = #define highlighting_properties_CAML EMPTY_PROPERTIES +/* CIL */ +#define highlighting_lexer_CIL SCLEX_CIL +static const HLStyle highlighting_styles_CIL[] = +{ + { SCE_CIL_DEFAULT, "default", FALSE }, + { SCE_CIL_COMMENT, "comment", FALSE }, + { SCE_CIL_COMMENTLINE, "commentline", FALSE }, + { SCE_CIL_WORD, "keyword", FALSE }, + { SCE_CIL_WORD2, "keyword2", FALSE }, + { SCE_CIL_WORD3, "keyword3", FALSE }, + { SCE_CIL_STRING, "stringliteral", FALSE },
I'd suggest renaming this to plain "string" and updating filetypes.cil
accordingly.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.