GNOME Bugzilla – Bug 641573
Does not apply syntax highlighting to .lex files
Last modified: 2014-02-05 12:02:46 UTC
gedit does not apply syntax highlighting to .lex files used by lexers such as lex and flex. Example files: * http://www.stephensykes.com/etacc/c.lex * http://www.b.shuttle.de/ncc-1701/tstampscanner/humanreadable.lex * http://www.satyam.com.ar/pht/php_scanner.lex * http://www.cs.ucf.edu/courses/cop3402/spring2011/Assignments/pascal.lex
http://en.wikipedia.org/wiki/Lex_%28software%29 http://en.wikipedia.org/wiki/Flex_lexical_analyser
Created attachment 232203 [details] [review] lex lang definition file Hi, As gtksourceview support highlighting only on yacc/bison files and not on lex/flex ones, I tried to make a .lang file for Lex/Flex lexical analyzer. It seems to highlight ok with the files linked by Moo and some other one. Hope it helps! The patch has been created by git format-patch. If that's not the right way, let me know...
Created attachment 239597 [details] [review] Flex/Lex language file The same as the patch, just this is the pure .lang file without the git patch stuff
Hi, I attached also the .lang file directly, and not the patch generated by the git tool, as I don't know what is the best format for you to review my stuff, in case it's useful. However, the content of the file is the same as the patch.
Hi Marcello, at a first glance the file looks pretty good, and attaching both the patch and the file has been a good choice (the patch allows us to apply it preserving the commit message etc, but the standalone file is useful for testing or for people who want to download the file) Some minor comments - it probably belongs in "Sources" not in "Other" - please use two-space indentation - in the patch version make sure to also add the file to Makefile.am and po/POTFILES.in so that it is built and translated Also keep in mind that we are in code-freeze for the upcoming release, so this we'll have to wait a bit before going in
Why should code-freeze matter in this case? This doesn't change existing functionality, and does not in any way risk causing instability. I propose an exception and merge it it anyway.
Created attachment 239624 [details] [review] Lex spec file - patch Git commit patch containing lex specification file. Changed indentation to two spaces, and added the file in Makefile.am and po/POTFILES.in
Created attachment 239625 [details] lex spec file - .lang file .lang file only (not the complete patch to the source tree)
Hi Paolo, I changed the two attachments according to what you said. I don't understand what you do mean as <<it probably belongs in "Sources" not in "Other">>
(In reply to comment #9) > I don't > understand what you do mean as <<it probably belongs in "Sources" not in > "Other">> It is the category of the lang file. Although nowadays gedit doesn't use the categories for choosing the highlighting mode.
Created attachment 256006 [details] [review] Lex spec file - patch
Created attachment 256007 [details] Lex spec file - .lang file
I've modified a bit the commit for the indentation and trailing spaces, and pushed it to the master branch: https://git.gnome.org/browse/gtksourceview/commit/?id=06e032204a4af5776f17582e0bdd344fe3416934 Thanks.