[Geany-devel] Adding an R parser

Jon Senior jon at xxxxx
Fri Feb 19 10:10:50 UTC 2010


On Fri, 19 Feb 2010 10:02:22 +0000
Liviu Andronic <landronimirc at gmail.com> wrote:
> Nice. Thanks for bringing up the patch.

No problem... it had been bugging me for a while. It's in the tracker
now so hopefully we'll see it in geany-0.19.
 
> I have couple more issues with the current support for R in Geany.
> It's mostly minor, but it affects readability of the code. The syntax
> highlighting fails in some cases:
> - for the line below, "sum" and "length" are both functions but will
> be highlighted with different colours
> > sum(mtcars$cyl); length(mtcars$cyl)

That's the syntax highlighting. geany is recognising one as a function
name and the other as a reserved keyword. Not sure why "sum" is being
seen as a keyword though.

> - a function similar to the one below will have "trim" and "qt"
> highlighted differently.
> > trim.qt <- function(x) sum(x)
> > trim.qt(mtcars$cyl)

geany doesn't seem to recognise that a . in R can be used as part of a
variable / function name.

> - so will an object, say,
> > get.smth <- iris
> 
> - objects don't seem recognised at all.

In what sense? I think it doesn't highlight objects that you've
created, although I could be wrong. To be honest I only really notice
the highlighting for strings and the bracket closing.

> Are these failures of the current parser implementation, or is this
> something that one should expect? Thanks

It's the syntax highlighting, not the tag parser (tags are things like
function definitions or global variable definitions). I've not really
looked at it enough to see how tuneable it is. It's been a while since
I delved into the R template files. Maybe later today.

Jon



More information about the Devel mailing list