Add support for the Nim programming language using the Python lexer. Nim website: https://nim-lang.org/
Additional notes: PR #193 is another PR for Nim support. That one has an own lexer. "Nimrod" is the old name of the language. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2085
-- Commit Summary --
* Add Nim filetype
-- File Changes --
A data/filedefs/filetypes.nim (34) M data/filetype_extensions.conf (1)
-- Patch Links --
https://github.com/geany/geany/pull/2085.patch https://github.com/geany/geany/pull/2085.diff
The filetypes file filename has the wrong form for a [custom filetype](https://www.geany.org/manual/current/index.html#custom-filetypes) I'm surprised it worked.
@trustable-code pushed 1 commit.
52cbc2fae1da1de3387f6ef58365d4f9c09dd5cc Correct file name
@elextr Thanks. Now it should be correct.
b4n requested changes on this pull request.
Looks reasonable, but do we want Nim builtin? I don't mind, but for not very widespread languages that only need/have a custom filetype, we often just have a [wiki page](https://wiki.geany.org/tag/filetype?do=showtag&tag=filetype). However, if the filetype is of sufficient quality I guess we can have it in, especially as I read a few mentions of Nim lately here and at Universal-CTags so it might be gaining popularity.
+primary=addr as asm atomic bind block break case cast const continue converter defer discard distinct div do elif else end enum except export finally for from func generic if import include interface iterator let macro method mixin mod notin object of out proc raise return shl shr static template try type using var when while with without yield seq array tuple ref ptr not and xor in or is isnot new result + +identifiers=bool float int string nil true false echo + +[settings] + +extension=nim +comment_single=# +comment_use_indent=true +tag_parser=Python +lexer_filetype=Python + +[lexer_properties] +styling.within.preprocessor=1 +lexer.cpp.track.preprocessor=0
Those two seem irrelevant in case of the Python lexer, aren't they?
+[settings]
+ +extension=nim +comment_single=# +comment_use_indent=true +tag_parser=Python +lexer_filetype=Python + +[lexer_properties] +styling.within.preprocessor=1 +lexer.cpp.track.preprocessor=0 + +[indentation] + +width=2 +type=0
Is this required by the NIM language? We prefer to not force indent type on people unless it's a requirement of the language (e.g. tabs for Makefiles). If it's the official recommendation, it's fine to provide those commented-out.
@@ -0,0 +1,34 @@
+# For complete documentation of this file, please see Geany's main documentation
This file needs to be added to *data/Makefile.am*
@b4n, a quick survey shows Nim doesn't make it near the top of any of the programming language rankings, its no typescript or coffeescript or other high profile JS languages (as flawed these lists are, not making any is likely significant).
But whilst in the past I have also tended to suggest the wiki I have sort of changed my mind a bit, really should Geany (or other tools) be picking winners, especially when it is only a filetypes.XXX.conf file. Its unlikely to need much support effort at that level.
Certainly more heavily integrated languages with lexers and parsers that need more support should be considered carefully, but one config file seems low impact.
However as there are already too many programming languages, maybe we need another group in filetypes.extensions, but thats another issue (#2087 actually :).
@trustable-code pushed 2 commits.
ed5c17b9e1112f3b3b1be6c663a36006e091547e Add filetypes.Nim.conf to Makefile.am 615a85287b065ea4923f65d461e5c628c41f160b Remove unneeded lexer_properties and indentation width
@b4n Thanks. I have removed the unneeded things as you have requested. I kept the line "type=0" because Nim does not allow tabulators.
Hope this can be merged any time soon now.
ntrel commented on this pull request.
+comment_single=#
+comment_use_indent=true +tag_parser=Python +lexer_filetype=Python + +[indentation] + +type=0 + +[build-menu] + +# %f will be replaced by the complete filename +# %e will be replaced by the filename without extension +# (use only one of it at one time) +compiler=nim c "%f" +run_cmd=%e
This should use `"%e"` in case there are spaces in the path.
Thanks @trustable-code. If you have time to fix the `%e` issue, that would be great. Otherwise I could fix it later and merge. @b4n's comments all seem to be resolved now (Nim rejects tabs).
elextr commented on this pull request.
+comment_single=#
+comment_use_indent=true +tag_parser=Python +lexer_filetype=Python + +[indentation] + +type=0 + +[build-menu] + +# %f will be replaced by the complete filename +# %e will be replaced by the filename without extension +# (use only one of it at one time) +compiler=nim c "%f" +run_cmd=%e
Probably should be "./%e" to work on many Linux systems.
@trustable-code pushed 2 commits.
a789caef3e9c5e319ba9883b3f0c9e54cda5a77a Fix run_cmd 7ca98b1a91a9f9b5c68f9e9350934e7c85b4f436 Improved keywords
@ntrel The PR is now updated.
Merged #2085 into master.
github-comments@lists.geany.org