Browse files

small fixes to language grammar and preferences, plus two new snippet…

…s, from Christian Hitz

git-svn-id: http://svn.textmate.org/trunk/Bundles/Lilypond.tmbundle@6260 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
1 parent ddad693 commit cfc9504498b53d95243d2abe45344f60fe132114 @jrus jrus committed Nov 28, 2006
Showing with 152 additions and 28 deletions.
  1. +6 −8 Preferences/Miscellaneous.tmPreferences
  2. +19 −0 Snippets/repeat.tmSnippet
  3. +16 −0 Snippets/times.tmSnippet
  4. +109 −20 Syntaxes/Lilypond.tmLanguage
  5. +2 −0 info.plist
View
14 Preferences/Miscellaneous.tmPreferences
@@ -4,8 +4,12 @@
<dict>
<key>name</key>
<string>Miscellaneous</string>
+ <key>scope</key>
+ <string>source.lilypond</string>
<key>settings</key>
<dict>
+ <key>decreaseIndentPattern</key>
+ <string>[^{]*\}.*|&gt;&gt;</string>
<key>highlightPairs</key>
<array>
<array>
@@ -29,14 +33,12 @@
<string>”</string>
</array>
<array>
- <string>`</string>
- <string>'</string>
- </array>
- <array>
<string>&lt;</string>
<string>&gt;</string>
</array>
</array>
+ <key>increaseIndentPattern</key>
+ <string>.*\{[^}]*$|&lt;&lt;</string>
<key>shellVariables</key>
<array>
<dict>
@@ -71,10 +73,6 @@
<string>"</string>
</array>
<array>
- <string>(</string>
- <string>)</string>
- </array>
- <array>
<string>{</string>
<string>}</string>
</array>
View
19 Snippets/repeat.tmSnippet
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>\repeat "${1:volta}" ${2:2} {
+ $3
+}
+${1/(volta)|(.*)/(?1:\\alternative {\n\t{ }\n\t{ }\n})(?2:)/}</string>
+ <key>name</key>
+ <string>repeat</string>
+ <key>scope</key>
+ <string>source.lilypond</string>
+ <key>tabTrigger</key>
+ <string>rep</string>
+ <key>uuid</key>
+ <string>73B33ED5-1704-47C6-B397-034B27A38433</string>
+</dict>
+</plist>
View
16 Snippets/times.tmSnippet
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>\times $1/$2 { $3 }</string>
+ <key>name</key>
+ <string>times</string>
+ <key>scope</key>
+ <string>source.lilypond</string>
+ <key>tabTrigger</key>
+ <string>times</string>
+ <key>uuid</key>
+ <string>A94FA5D8-1C91-474F-A98D-AFFC42D39BBA</string>
+</dict>
+</plist>
View
129 Syntaxes/Lilypond.tmLanguage
@@ -4,20 +4,21 @@
<dict>
<key>comment</key>
<string>
- This bundle is, as can easily be seen, but it should still
- be as useful as the Lilypond.app pyobjc application, which
- has no syntax coloring, no way to do snippets, and pretty
- much no interesting functionality at all, other than a "Run"
- menu option. :)
+ This bundle is, as can easily be seen, far from complete,
+ but it should still be as useful as the Lilypond.app pyobjc
+ application, which has no syntax coloring, no way to do
+ snippets, and pretty much no interesting functionality at
+ all, other than a "Run" menu option. :)
</string>
<key>fileTypes</key>
<array>
<string>ly</string>
+ <string>ily</string>
</array>
<key>foldingStartMarker</key>
- <string>\{\s*$</string>
+ <string>(\{|&lt;&lt;)\s*$</string>
<key>foldingStopMarker</key>
- <string>^.*\}</string>
+ <string>(\}|&gt;&gt;)</string>
<key>keyEquivalent</key>
<string>^~L</string>
<key>name</key>
@@ -143,7 +144,7 @@
<string>(?x)
((\\) clef) \s+ # backslash + "clef" + spaces (groups 1-2)
(?:
- (")? # beginning quotes (group 3)
+ ("?) # beginning quotes (group 3)
( (?: # group 4
treble | violin | G | french | # G clefs
alto | C | tenor | (?:mezzo)?soprano | baritone | # C clefs
@@ -175,7 +176,7 @@
</dict>
</dict>
<key>match</key>
- <string>(\\)[a-zA-Z]+\b</string>
+ <string>(\\)[a-zA-Z-]+\b</string>
<key>name</key>
<string>support.function.general.lilypond</string>
</dict>
@@ -297,13 +298,21 @@
<array>
<dict>
<key>include</key>
+ <string>#comments</string>
+ </dict>
+ <dict>
+ <key>include</key>
<string>#strings</string>
</dict>
<dict>
<key>include</key>
<string>#scheme</string>
</dict>
<dict>
+ <key>include</key>
+ <string>#g_markup</string>
+ </dict>
+ <dict>
<key>match</key>
<string>=</string>
<key>name</key>
@@ -314,7 +323,7 @@
<string>(?x)
dedication | title | subtitle | subsubtitle | poet |
composer | meter | opus | arranger | instrument |
- piece | breakbefore | copyright | tagline
+ piece | breakbefore | copyright | tagline | enteredby
</string>
<key>name</key>
<string>support.constant.header.lilypond</string>
@@ -332,10 +341,90 @@
</dict>
</array>
</dict>
+ <key>g_m_group</key>
+ <dict>
+ <key>begin</key>
+ <string>{</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.section.group.begin.lilypond</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>}</string>
+ <key>endCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.section.group.end.lilypond</string>
+ </dict>
+ </dict>
+ <key>name</key>
+ <string>meta.group.lilypond</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>#f_generic</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#strings</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#comments</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#scheme</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#g_m_group</string>
+ </dict>
+ </array>
+ </dict>
+ <key>g_markup</key>
+ <dict>
+ <key>begin</key>
+ <string>(?x)
+ ((\\) markup) \s+ # backslash + "markup" + spaces
+ (?={)
+ </string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>support.function.element.markup.lilypond</string>
+ </dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.function.markup</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>(?&lt;=})</string>
+ <key>name</key>
+ <string>meta.element.markup.lilypond</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>#g_m_group</string>
+ </dict>
+ </array>
+ </dict>
<key>g_relative</key>
<dict>
<key>begin</key>
- <string>((\\)relative)\s*(?:([a-g][',]*)\s*)?(?={)</string>
+ <string>((\\)relative)\s*(?:([a-h][',]*)\s*)?(?={)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
@@ -447,7 +536,7 @@
<key>0</key>
<dict>
<key>name</key>
- <string>punctuation.section.group.begin.lilypond</string>
+ <string>punctuation.section.group.end.lilypond</string>
</dict>
</dict>
<key>name</key>
@@ -537,16 +626,16 @@
<key>match</key>
<string>(?x)
(\\)
- (?: accent | markato | staccatissimo | # basic accents
+ (?: accent | markato | staccatissimo | # basic accents
espressivo | staccato | tenuto | portato |
(?:up|down)bow | flageolet | thumb |
[lr](?:heel|toe) | open | stopped |
(?:reverse)?turn | trill |
- prall(?: prall | mordent | down | up)? | # pralls
- (?: up | down | line ) prall | # and
- (?: up | down )? mordent | # mordents
+ prall(?: prall | mordent | down | up)? | # pralls
+ (?: up | down | line ) prall | # and
+ (?: up | down )? mordent | # mordents
signumcongruentiae |
- (?: (?:very)? long | short)?fermata | # fermatas
+ (?: (?:very)? long | short)?fermata(Markup)? | # fermatas
segno | (?:var)?coda
)
</string>
@@ -590,7 +679,7 @@
<key>begin</key>
<string>(?x)\b
( # (group 1)
- ( [a-g] # Pitch (group 2)
+ ( [a-h] # Pitch (group 2)
( (?:i[sh]){1,2} | # - sharp (group 3)
(?:e[sh]|s){1,2} # - flat
)?
@@ -655,7 +744,7 @@
(?x)
\b( # Basic Pitches
- [a-g] # Dutch/English/etc.
+ [a-h] # Dutch/English/etc.
(?: (iss?|s|sharp|x)(iss?|s|sharp|x|ih) | # sharp / flat
(ess?|s|flat|f)(ess?|s|flat|f|eh)
)? |
@@ -875,7 +964,7 @@
</dict>
<key>match</key>
<string>(?x)\b
- ( [a-g] # Pitch (group 1)
+ ( [a-h] # Pitch (group 1)
( (?:i[sh]){1,2} | # - sharp (group 2)
(?:e[sh]|s){1,2} # - flat
)?
View
2 info.plist
@@ -20,6 +20,8 @@
<string>F25B30BE-0526-4D92-806C-F0D678DDF669</string>
<string>C54C69BF-701D-445E-A433-102BEFCE20C7</string>
<string>70991DF0-7C6F-4B3D-AED4-2F9A56EAB687</string>
+ <string>A94FA5D8-1C91-474F-A98D-AFFC42D39BBA</string>
+ <string>73B33ED5-1704-47C6-B397-034B27A38433</string>
<string>B06CC484-F595-4C6A-95EB-D0E46123D9FE</string>
<string>E8B6A543-90A6-46A4-A307-B21B67EF7F2F</string>
<string>6F8F1607-8D59-4E4D-94D1-7565B4921B81</string>

0 comments on commit cfc9504

Please sign in to comment.