GNOME Bugzilla – Bug 153438
keywords including periods aren't highlighted
Last modified: 2006-08-06 09:54:24 UTC
Working with fortran.lang, I've tried to include operators such as ".LE." ".GE." and so on. I've tried "<keyword>\.LE\.</keyword>", and that doesn't match ".LE." or "\.LE\.". I've tried "<keyword>.LE.</keyword>", which of course matches all 4-letter strings with "le" in the middle (although perversely not ".le." :-)) Shouldn't the first <keyword> I wrote work, if these are just normal regexs?
Sorry for the late reply. Have you tried [.]LE[.]?
Neither of the below work either (not at all recognised, wildcard or period): <keyword>[\.]foobar[\.]</keyword> <keyword>[.]foobar[.]</keyword>
Is there supposed to be whitespace on either side of the operator? If so you probably need to do something like this: [ \t\n]?\.foobar\.[ \t\n]? It should work without it the whitespace matching, but it doesn't. If you remove the whitespace matching it will only work if there are non-whitespace characters on either side. For example, this works: this is some text with.foobar.in it. And this fails: this is some text with .foobar. in it.
It is not a bug in gtksourceview. See scheme.lang to see how to solve your problem.
Created attachment 70280 [details] [review] Patch to fix fortran syntax highlighting Thanks for the pointer, patch for fortran highlighting in a similar vein attached.
Thanks John... I have not tried the patch but from a look it seems that it would match something like 'foo.OR.bar', if it's true, is that valid? should the beginning and end regex be something like '[ \t]\.' ?
Just tried "if (foo.and.bar) then" in both intel and GNU fortran compilers, both were happy with it, so I think it's fine the way it is.
awesome, thanks. I'll commit this afternoon