nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] ruby syntax highlight patterns REDUX


From: John M. Gabriele
Subject: [Nano-devel] ruby syntax highlight patterns REDUX
Date: Thu, 25 May 2006 21:20:28 -0700 (PDT)

Ok, it looks like, since those previous syntax highlight patterns had
a license notice in them, it's going to be problematic to get them
into GNU nano (I'd exchanged emails with the author a couple of times,
but it looks like it's going to be a little too much red tape to fiddle
with copyright assignment forms just for a handful of regexes).

So, to expedite the process such that we can just get some Ruby patterns
into GNU nano, I deleted those previous ruby patterns from my .nanorc,
deleted the previous emails on the subject from my inbox, and am
starting some new ones from scratch. Here's a first try -- the ones
with "XXX" in the comment are the ones I could use some help with:

-------------------- snip ----------------------------------------

## Here is an example for Ruby.
syntax "ruby" "\.rb$"

## Alphabetical list of some language keywords.
color yellow "\<(and|begin|break|class|def|do|else|elsif|end|false|if|new)\>"
color yellow "\<(next|nil|or|redo|retry|return|true|unless|while|yield)\>"

## Strings.
color cyan ""[^"]*""
color cyan "'[^']*'"
color cyan "%[qQwW]?\{[^}]*\}"

## Expression substitution inside a string. "Looks like #{this}."
## Really, this one should *only* be for inside "", %{}, %Q{}, or %W{}. XXX
color brightcyan "#\{[^}]*\}"

## Symbols.
## Why doesn't this work? XXX
## It's supposed to match words beginning with a colon. XXX
color magenta "\<:[a-zA-Z0-9_]+\>"

## Regular expressions.
color red "/[^/]*/[iomx]*"
color red "%r\{[^}]*\}[iomx]*"

## Comments.
## How do I make this work everywhere *except* inside a string? XXX
color green "#.*$"

## Markers that I should pay more attention to. :)
color brightred "(XXX|TODO|FIXME)"

-------------------- /snip ----------------------------------------

Please comment on any errors you see, or additions you can make,
so we can get a patched-up version of this checked-in. :)

Thanks,
---John


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]