Il 02/01/2012 15:58, Thomas Morley ha scritto:
I tested a file with a large scheme-definition.
In the attached file you may notice some inconsequences:

Hi Thomas,

I have fixed the error in the scheme definition, so your file is highlighted correctly now.
I've done also some other improvements.

Anyone wishing to test it again is welcomed to do so, see files attached.

Tip for quick testing:

1) copy all the .ly files you want to test in a directory along with the attached files
2) create the html subdirectory
3) run ./srchilite.sh
4) open all the .html files at once and check tab by tab

I think that I'll submit the files "upstream" within saturday/sunday.
We'll fix next bugs when we find them :-) (I'm aware of some minor bugs in markup blocks)

Thanks,
Federico
java = java.lang 
moc = cpp.lang
cpp = cpp.lang
c = c.lang
C = cpp.lang
cc = cpp.lang
cs = csharp.lang
csharp = csharp.lang
h = cpp.lang
hh = cpp.lang
H = cpp.lang
hpp = cpp.lang
javascript = javascript.lang
js = javascript.lang
prolog = prolog.lang
pl = prolog.lang
perl = perl.lang
pm = perl.lang
php3 = php.lang
php4 = php.lang
php5 = php.lang
php = php.lang
ctp = php.lang
protobuf = proto.lang
proto = proto.lang
python = python.lang
py = python.lang
ruby = ruby.lang
rb = ruby.lang
flex = flex.lang
lex = flex.lang
l = flex.lang
ll = flex.lang
bison = bison.lang
yacc = bison.lang
y = bison.lang
yy = bison.lang
changelog = changelog.lang
lua = lua.lang
ml = caml.lang
caml = caml.lang
mli = caml.lang
sml = sml.lang
sig = sml.lang
syslog = log.lang
log = log.lang
pas = pascal.lang
pascal = pascal.lang    
fortran = fortran.lang
free-fortran = fortran.lang
fixed-fortran = fixed-fortran.lang
html = html.lang
htm = html.lang
tex = latex.lang
latex = latex.lang
cls = latex.lang
sty = latex.lang
dtx = latex.lang
lgt = logtalk.lang
logtalk = logtalk.lang
diff = diff.lang
patch = diff.lang
lang = langdef.lang
langdef = langdef.lang
outlang = outlang.lang
style = style.lang
ps = postscript.lang
eps = postscript.lang
postscript = postscript.lang
kcfg = xml.lang
ui = xml.lang
kdevelop = xml.lang
rc = xml.lang
docbook = xml.lang
kidl = xml.lang
xml = xml.lang
xhtml = xml.lang
bash = sh.lang
sh = sh.lang
csh = sh.lang
ksh = sh.lang
tcsh = sh.lang
shell = sh.lang
tcl = tcl.lang
tk = tcl.lang
txt = nohilite.lang
sql = sql.lang
bib = bib.lang
makefile = makefile.lang
am = makefile.lang
in = makefile.lang
css = css.lang
m4 = m4.lang
ac = m4.lang
autoconf = m4.lang
sl = slang.lang
slsh = slang.lang
slang = slang.lang
properties = properties.lang
desktop = desktop.lang
ini = desktop.lang
conf = conf.lang
lsm = lsm.lang
spec = spec.lang
haxe = haxe.lang
hx = haxe.lang
ldap = ldap.lang
ldif = ldap.lang
glsl = glsl.lang
xorg = xorg.lang
scala = scala.lang
ada = ada.lang
adb = ada.lang
pc = pc.lang
pkgconfig = pc.lang
oz = oz.lang
texinfo = texinfo.lang
texi = texinfo.lang
hs = haskell.lang
hs = haskell.lang
lhs = haskell_literate.lang
haskell = haskell.lang
manifest = manifest.lang
mf = manifest.lang
asm = asm.lang
s = asm.lang
applescript = applescript.lang
scpt = applescript.lang
vbscript = vbscript.lang
vbs = vbscript.lang
awk = awk.lang
bat = bat.lang
batch = bat.lang
clipper = clipper.lang
prg = clipper.lang
cbl = cobol.lang
cobol = cobol.lang
dmd = d.lang
d = d.lang
errors = errors.lang
erl = erlang.lang
erlang = erlang.lang
vala = vala.lang
lisp = lisp.lang
el = lisp.lang
scm = scheme.lang
scheme = scheme.lang
po = po.lang
pot = po.lang
opa = opa.lang
javalog = javalog.lang
upc = upc.lang
tml = tml.lang
ly = lilypond.lang
# LilyPond v2.14.2

string delim "\"" "\"" multiline

environment scheme delim '#\'?\(' ")" multiline nested begin
  environment scheme delim "(" ")" multiline nested begin
    include "url.lang"
  end
end

scheme_value = '##(t|f)', '#{1,2}\'?[[:alnum:]\.:+-]+'

comment delim "%{" "%}" multiline nested
comment start "%"

# Symbols
cbracket = "{|}|<<|>>"
symbol = "(|)|~|^|_"
dynamic = '\\(<|>|!|f{1,5}|p{1,5}|m(f|p)|fp|(r|s)fz|s(f|p){1,2})(?!\w)'

# Numbers
specialchar = '(?<!#)-[1-5]\b', '\\[0-9]\b' # strings and fingerings
note_duration = '(?<=[a-zR\',!?>])(1|2|4|8|16|32|64|128)(\.+|\b)'
value = '[[:digit:]/\*]+'

# Markup commands
markup_command = '\\((left-|center-|right-|general-)?align|arrow-head',
    'beam|bold|(left-|right-)brace|(filled-|rounded-)?box|(h)?bracket',
    'caps|char|circle|combine|concat|(left-|center-|right-|dir-)?column',
    'dynamic|dot|draw(-circle|-hline|-line)|eyeglasses|epsfile',
    
'fill-with-pattern|finger|(double|semi|sesqui)?flat|fontCaps|(abs-)?fontsize',
    '(auto-)?footnote|fraction|fret-diagram(-terse|-verbose)?|fromproperty',
    'halign|harp-pedal|hcenter-in|hspace|huge|italic|justify(-field|-string)?',
    '(justified-|fill-)?line|large(r)?|lookup',
    'magnify|mark(alphabet|letter)|markup(list|lines)?|medium',
    'musicglyph|natural|normal-size(-super|-sub)|normalsize',
    'normal-text|note(-by-number)?|null|number',
    'override-lines|pad(-around|-markup|-to-box|-x)',
    'page(-link|-ref)|parenthesize|path|pattern',
    'postscript|property-recursive|put-adjacent',
    'raise|replace|roman|rotate|sans|(double|semi|sesqui)?sharp|simple',
    '(back)?slashed-digit|small(er|Caps)?|stencil|strut|sub|super',
    'table-of-contents|teeny|text|tick|tiny',
    'translate(-scaled)?|transparent|triangle|typewriter|underline|upright',
    'vcenter|vspace|verbatim-file',
    'with-(url|color|dimensions|link)|whiteout|woodwind-diagram',
    'wordwrap(-lines|-field|-string)?)\b'


lyric_command = '\\(lyricmode|lyrics(to)?)'

# Main commands
preproc = '\\(book(part)?|context|consists|header|include|language|layout',
    'midi|once|override(Property)?|paper|remove(WithTag)?',
    'revert|score|(un)?set|version|with)\b'

# Variables of music functions
variable = '(alto|baritone|bass|french|mezzosoprano|percussion',
    'soprano|subbass|tenor|treble|varbaritone',
    'percent|tremolo|unfold|volta',
    
'\\(aeolian|dorian|ionian|lydian|locrian|minor|major|mixolydian|phrygian))\b'

header_variable = 'arranger', 'breakbefore', 'composer', 'copyright', 'date',
    'dedication', 'enteredby', 'filename', 'footer', 'instrument\b', 
'lastupdated',
    'maintainer(Email|Web)?', 'meter', 'moreInfo',
    'mutopia(composer|instrument|opus|poet|title)?',
    'opus', 'poet', 'piece', 'source(url)?', 'style', '(sub){0,2}title',
    'tagline', 'texidoc'

# Contexts
# old regexp: '([A-Z][a-z]+){2,}' <-- too greedy, a list is better
context = '\\?(ChoirStaff|ChordNames|CueVoice|Devnull|Drum(Staff|Voice)',
    'Dynamics|FiguredBass|FretBoards|Global|GrandStaff',
    'GregorianTranscription(Staff|Voice)|Lyrics|Mensural(Staff|Voice)',
    'NoteNames|PianoStaff|RhythmicStaff|Score|Staff(Group)?',
    'Tab(Staff|Voice)|Vaticana(Staff|Voice)|Voice)\b'

# Layout objects
layout_object = 'Accidental(Cautionary|Placement|Suggestion)?',
    'Ambitus(Accidental|Line|NoteHead)?', 'Arpeggio', 'BalloonTextItem',
    'Bar(Line|Number)?', 
'BassFigure(Alignment(Positioning)?|Bracket|Continuation|Line)?',
    'Beam', 'BendAfter', 'Break(AlignGroup|Alignment)?', 'BreathingSign',
    'ChordName', 'Clef', 'Cluster(Spanner(Beacon)?)', 'CombineTextScript',
    'Cue(Clef|EndClef)?', 'Custos', 'Dot(Column|s)?',
    'Double(PercentRepeat(Counter)?|RepeatSlash)?',
    'Dynamic(LineSpanner|Text|TextSpanner)?\b', 'Episema', 'Fingering', 'Flag',
    'Footnote(Item|Spanner)', 'FretBoard', 'Glissando', 'GraceSpacing',
    'Grid(Line|Point)', 'Hairpin', 'HorizontalBracket',
    'Instrument(Name|Switch)', 'Key(Cancellation|Signature)',
    'Laissez(VibrerTie(Column)?)', 'LedgerLineSpanner',
    'LeftEdge', 'LigatureBracket',
    'Lyric(Extender|Hyphen|Space|Text)', 'MeasureGrouping',
    'MelodyItem', 'MensuralLigature', 'MetronomeMark',
    'MultiMeasureRest(Number|Text)?', 'NonMusicalPaperColumn',
    'Note(Collision|Column|Head|Name|Spacing)', 'OctavateEight',
    'OttavaBracket', 'PaperColumn', 'ParenthesesItem',
    'Percent(Repeat(Counter)?)', 'PhrasingSlur', 'PianoPedalBracket',
    'RehearsalMark', 'Repeat(Slash|Tie(Column)?)', 'Rest(Collision)?',
     'Script(Column|Row)?', 'Slur', 'Sostenuto(Pedal(LineSpanner)?)',
     'SpacingSpanner', 'SpanBar', 'Staff(Grouper|Spacing|Symbol)',
     'StanzaNumber', 'Stem(Tremolo)?', 'StringNumber', 'StrokeFinger',
     'SustainPedal(LineSpanner)?',
     'System(StartBar|StartBrace|StartBracket|StartSquare)?',
     'TabNoteHead', 'Text(Script|Spanner)', 'Tie(Column)?', 'TimeSignature',
     'TrillPitch(Accidental|Group|Head)', 'TrillSpanner',
     'Tuplet(Bracket|Number)', 'UnaCordaPedal(LineSpanner)?',
     'VaticanaLigature', 'Vertical(Alignment|AxisGroup)', 'VoiceFollower',
     'VoltaBracket(Spanner)?'

# Context properties
context_property = '\b[a-z]+([A-Z]+[a-z]+)+',
                   'ottavation|output|stanza|timing|tonic'

# Layout properties
layout_property = '\b[a-z]+(-[a-z]+)+', 'indent'

# All the other commands (including variables defined by users)
function = '\\[[:alpha:]-]+'

symbol "#C000C0" b ;
cbracket, preproc black b ;
dynamic "#FF8000" b ;

string "#C20F0F" ;
scheme, scheme_value "#A04900" ;
comment gray i ;

note_duration teal ;
value "#808000" ;
specialchar "#FF8000" ;

function "#0000C0" b ;
markup_command "#008000" ;
lyric_command "#006000" b ;

header_variable, variable blue ;
context "#C000C0" b ;
layout_object "#C000C0" ;
context_property, layout_property blue ;

Attachment: srchilite.sh
Description: Bourne shell script

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to