Re: problem with tcl lexer

From: mitchell <c....at.caladbolg.net>
Date: Wed, 1 Dec 2010 08:37:29 -0800 (PST)

On Nov 30, 9:55 am, mitchell <c....at.caladbolg.net> wrote:
> Hi Scott,
>
> > I'm not sure if this is the correct place to post, but I discovered a
> > problem with the TCL lexer. Who knew, there are companies that still
> > use this language (I just started a new job recently)?!
>
> > Anyway, this line is handle improperly by the lexer:
>
> > set radius_sim [simulator::radiusServer #auto $radius_rc]
>
> > The lexer thinks that the "#" starts a comment, when it is part of the
> > string "#auto". I'm still learning TCL myself, but I think this is
> > part of TCL's OO notation.
>
> TCL is quite quirky in that way it seems. I don't know of any quick fixes;
> I'll have to look into this in more detail when I have the time. In the
> future you can use the scintillua bug tracker
> (http://scintillua.googlecode.com118). I've filed the bug in the meantime.

The solution is to modify the comment token in the tcl.lua lexer:

local comment = token(l.COMMENT, '#' * P(function(input, index)
  local i = index - 2
  while i > 0 and input:find('^[ \t]', i) do i = i - 1 end
  if i < 1 or input:find('^[\r\n;]', i) then return index end
end) * l.nonnewline^0)

I will commit this to scintillua hg later today. You will have to
manually make the change in the new 3.5 release.
Received on Wed 01 Dec 2010 - 11:37:29 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:54:32 EST