Bug#592647: libgtksourceview2.0-common: Improvement of the octave.lang file

2010-08-11 Thread Carnë Draug
Package: libgtksourceview2.0-common
Version: 2.10.3-1
Severity: minor
Tags: patch

I found that the language file for the octave language is a bit poor so I
decided to make some improvements. I'm attaching the new octave.lang file.

I got some input from one of the octave developers and original developer of
octave.lang file when doing it ( http://tinyurl.com/ygr8yj3 ) and testing from
some ubuntu users ( http://tinyurl.com/yzdks6l ).

I've also sent it to the gtksourceview developers (filed a bug report in
bugzilla https://bugzilla.gnome.org/show_bug.cgi?id=613378) but they have
keep silent for some months now. Hopefully you'll get it upstream or at least
for the debian community.

Here's the list of changes I made

* comments and continuation line
  * ... is now identified as a continuation line character
  * comments after the continuation line character do not disrupt it
  * continuation lines characters are ignored if they are between
single quotes

* shebang line
  * now it's defined by the default configuration as being such instead
of just another comment

* block comments
  * added #{ and #} to the list of possibilities for block comments
  * highlights correctly when block comments are nested

* operators
  * now are highlighted (not only simple arithmetic operators, this
includes element by element, transpose operator, autoincrement, assignment and
logical operators)

* functions
  * added a bunch of functions (got some input for one of the octave
developers to avoid problems picking functions that may be removed from octave
to avoid problems in the future)
  * just to make it look pretty I mixed some very similar functions
into one such as (a)?sin(d|h)?
  * removed 'ans' from the list of functions and highlighted it as a
variable

* metadata
  * changed default for line comment from % back to #

* pkg as preprocessor
  * if pkg is not called 'like a function' (i.e. pkg (load,..)) it's
highlighted as preprocessor (in similarity to the 'use' function in Perl)

* constants/functions
  * functions such as Inf, pi, NaN which can be called with no
arguments to return a constant value, are highlighted as constants in those
situations but still as functions if followed by opening parenthesis

* data types
  * the function handle character '@' is now highlighted

* true/false as functions
  * are highlighted as boolean unless followed by opening parenthesis,
in which case are highlighted as functions

* keywords
  * added the keywords, persistent, replot, static, varargin, varargout
  * removed the keywords assert, nargin, nargout and moved them to be
highlighted as functions

* strings
  * added a printf regexp that should identify its formatting (copied
it from the C.lang file)
  * added an escape regexp that should escape only some stuff, not
whatever is right after an \ (also copied it from the C.lang file)



-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=en_IE.utf8, LC_CTYPE=en_IE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

-- no debconf information


octave.lang
Description: Binary data


Bug#592647: libgtksourceview2.0-common: Improvement of the octave.lang file

2010-08-11 Thread Carnë Draug
I actually sent the original octave.lang instead of the improved
version. I'm so embarassed. I attached the right file this time. Sorry
about the mistake.

Carnë Draug


octave.lang
Description: Binary data