Julia syntax highlighting for gedit

958 views
Skip to first unread message

Uwe Fechner

unread,
Jul 29, 2014, 5:46:21 AM7/29/14
to julia...@googlegroups.com
Hello,

I am trying to teach gedit to understand the Julia syntax.
I am using Ubuntu 12.04, 64 bits.

I tried the code from:
https://github.com/cko/juliaLang-gnome

I copied julia.xml to /usr/share/mime and julia.lang
to /usr/share/gtksourceview-3.0/language-specs/

For updating the mime types I used:
sudo update-mime-database /usr/share/mime

It does not work.

I fixed an error in julia.xml and one error in julia.lang,
but there are still errors in julia.lang.

See: https://gist.github.com/ufechner7/19e20d67d5000db294f2

I get the following error message if I launch gedit in the
console and open a .jl file:

(gedit:12899): GtkSourceView-WARNING **: Failed to load '/usr/share/gtksourceview-3.0/language-specs/julia.lang': Fehler beim Kompilieren des regulären Ausdrucks (?-ix)\b('[^\']|\\.'|'\\[0-7]{1,3}'|'\x[0-9a-fA-F]{1,2}'|'\u[0-9a-fA-F]{1,3}'|'\u[0-9a-cA-C][0-9a-fA-F]{3}'|'\u[dD][0-7][0-9a-fA-F]{2}'|'\U[0-9a-fA-F]{1,5}'|'\U10[0-9a-fA-F]{4}')\b an Zeichen 59: Groß- und Kleinschreibung-beeinflussende Escape-Sequenzen (\l, \L, \u, \U) sind an dieser Stelle nicht erlaubt.

(Translation: Error compiling the regular expression ...
Escape sequences, that influence capitalization (\l, \L, \u, \U) are not allowed at this place.)

Any idea how to fix this?

Best regards:

Uwe Fechner

Milan Bouchet-Valat

unread,
Jul 29, 2014, 6:04:06 AM7/29/14
to julia...@googlegroups.com
I've not looked at the file, but I'm currently using the attached file
and it works fine. It's not completely up-to-date as regards the
standard function names, so it would need a little more work before it
can be sent to the gedit developers (any help appreciated).


Regards
julia.lang

Uwe Fechner

unread,
Jul 29, 2014, 6:17:00 AM7/29/14
to julia...@googlegroups.com
Thanks, this works already nicely!

Best regards:

Uwe

Waldir Pimenta

unread,
Jul 29, 2014, 12:42:59 PM7/29/14
to julia...@googlegroups.com
Note that there's a julia.lang in the Julia repo, an earlier version of which was submitted to gtksourceview and included in it (since release 3.10 IIRC).

Apart from the changes already made to the version in the JuliaLang repo since the submission (diff), issue #6132 tracks the addition of support for multiline comments to various editors. I was meaning to address it but haven't had the time yet.

If the versions linked/attached previously in this thread contain this or other fixes, those should at least be submitted to the julia.lang in the Julia repo. Afterwards, the changes should be submitted to gtksourceview as well.

Milan Bouchet-Valat

unread,
Jul 29, 2014, 2:15:17 PM7/29/14
to julia...@googlegroups.com
Le mardi 29 juillet 2014 à 09:42 -0700, Waldir Pimenta a écrit :
> Note that there's a julia.lang in the Julia repo, an earlier version
> of which was submitted to gtksourceview and included in it (since
> release 3.10 IIRC).
Ah, good to know it got included. I wasn't aware of that.

> Apart from the changes already made to the version in the JuliaLang
> repo since the submission (diff), issue #6132 tracks the addition of
> support for multiline comments to various editors. I was meaning to
> address it but haven't had the time yet.
>
> If the versions linked/attached previously in this thread contain this
> or other fixes, those should at least be submitted to the julia.lang
> in the Julia repo. Afterwards, the changes should be submitted to
> gtksourceview as well.
Unfortunately, I wrote that file from scratch (based on the Python
syntax spec file) before I noticed your work, so merging the changes
won't be completely trivial. I'll try to have a look, but I'm not even
sure my file brings improvements over yours at all.


Regards

Reply all
Reply to author
Forward
0 new messages