Re: ta and running java classes

From: mitchell <mforal.n....at.gmail.com>
Date: Mon, 22 Jun 2009 18:23:33 -0700 (PDT)

Martin,

> The regular expression you use ('package%s+([^;]+)') would also match
> commented out package declarations (like '//package org.foo;').
>
> currently I use the following (I put that in the wiki too):
>
> local package = buffer_text:match('^%s*package%s+([^;]+)') -- first
> line
> if not package then package = buffer_text:match('\n%s*package%s+([^;]
> +)') end
>
> Still, a package declaration within a multiline comment could get
> chosen over the actual one

You could check that buffer:get_style_name(buffer.style_at[position of
the package text]) is not 'comment'.
Received on Mon 22 Jun 2009 - 21:23:33 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:38:10 EST