Lee S. avatar Lee S. committed b664bef

Updates to the main syntax script, and some updates to try and get the documentation started.

Comments (0)

Files changed (2)

src/doc/abc-plugin.txt

 ==============================================================================
 CONTENTS                                                    *abc-vim-contents*
 
-    1. Introduction                  |abc-vim|
-    2. Prerequisites                 |abc-prerequisites|
-    3. Why abc-vim?                  |abc-why|
-    4. abc Intro                     |abc-intro|
-        4.1. abc vs. Commercial      |abc-is-free|
-        4.2. The abc Code 'Feel'     |abc-feel|
-        4.3. Suggested Reading       |abc-reading|
-        4.4. Practice!               |abc-practice|
-    5. abc syntax                    |abc-syntax|
-        5.1.                         |abc-syntax-|
-        5.2.                         |abc-syntax-|
-        5.3.                         |abc-syntax-|
-        5.4.                         |abc-syntax-|
-        5.5.                         |abc-syntax-|
-        5.6.                         |abc-syntax-|
-        5.7.                         |abc-syntax-|
-        5.8.                         |abc-syntax-|
-        5.9.                         |abc-syntax-|
-        5.10.                        |abc-syntax-|
-        5.11.                        |abc-syntax-|
-        5.12.                        |abc-syntax-|
-        5.13.                        |abc-syntax-|
-        5.14.                        |abc-syntax-|
-    6. Folding                       |abc-folding|
-    7. Placeholders                  |abc-placeholders|
-    8. Compilers                     |abc-compilers|
-    9. Omnicompletion                |abc-omni|
-    10.                              |abc-vim-|
-    11. Options                      |abc-options|
-       11.1. Registered Tunes        |abc-register-files|
-       11.2. Temporary Tunes         |abc-temporary-files|
-       11.3. Per-Tune Options        |abc-local-options|
-       11.4. Global Options          |abc-global-options|
-    12. Help                         |abc-help|
-    13. Developers                   |abc-developers|
-    14. Changelog                    |abc-changelog|
-    15. Licenses                     |abc-licenses|
-    16. Todo                         |abc-todo|
+    1. Introduction                                      |abc-vim|
+    2. Prerequisites                                     |abc-prerequisites|
+    3. Why abc-vim?                                      |abc-why|
+    4. abc Intro                                         |abc-intro|
+        4.1. Headers                                     |abc-intro-headers|
+        4.2. Music                                       |abc-intro-music|
+    5. abc syntax                                        |abc-syntax|
+        5.1. Toplevel Objects                            |abc-toplevel|
+            5.1.1. Version String                        |abc-version|
+        5.2. Directives                                  |abc-directives|
+            5.2.1. Directive Locking                     |abc-directive-lock|
+        5.3. Embedded Syntaxes                           |abc-emb-syntax|
+            5.3.1. PostScript                            |abc-emb-postscript|
+            5.3.2. XML                                   |abc-emb-xml|
+            5.3.3. TeX                                   |abc-emb-tex|
+            5.3.4. C                                     |abc-emb-c|
+        5.4. Free Text                                   |abc-freetext|
+        5.5. Typeset Text                                |abc-typesettext|
+        5.6. Fields & Datatypes                          |abc-fields-datatypes|
+        5.7. Regular Expressions & 'abc-include'         |abc-include|
+        5.8. Header Sections                             |abc-header|
+        5.9. Tune Body Sections                          |abc-body|
+        5.10. Precedence                                 |abc-precedence|
+        5.11.                                            |abc-syntax|
+        5.12.                                            |abc-syntax|
+        5.13. MIDI                                       |abc-midi|
+        5.14. Errors and Warnings                        |abc-errors|
+        5.15. Unicode Support                            |abc-utf|
+    6. Folding                                           |abc-folding|
+    7. abc and XML                                       |abc-xml|
+        7.1. DocBook                                     |abc-docbook|
+        7.2. XHTML                                       |abc-html|
+        7.3. SVG                                         |abc-svg|
+        7.4. MathML                                      |abc-mml|
+        7.5. Others                                      |abc-other-xml|
+    8. Variables                                         |abc-variables|
+    9. Compilers                                         |abc-compilers|
+    10. Omnicompletion                                   |abc-omni|
+    11. Options                                          |abc-options|
+        11.1. Per-Tune Options                           |abc-local-options|
+        11.2. Global Options                             |abc-global-options|
+    12. Help                                             |abc-help|
+    13. Developers                                       |abc-developers|
+    14. Changelog                                        |abc-changelog|
+    15. Licenses                                         |abc-licenses|
+    16. Todo                                             |abc-todo|
 
 ==============================================================================
 1. Introduction                                                      *abc-vim*
   http://trillian.mit.edu/~jc/music/abc/doc/ABCtut.html
 <
 ==============================================================================
-5.                                                            *abc-vim-syntax*
+5. abc Syntax                                                     *abc-syntax*
+
 
 ==============================================================================
-6.                                                           *abc-vim-folding*
+6. abc Folds                                                     *abc-folding*
+
 
 ==============================================================================
-7.                                                      *abc-vim-placeholders*
+7. abc and XML                                                       *abc-xml*
+
 
 ==============================================================================
-8.                                                         *abc-vim-compilers*
+8. Variables                                                   *abc-variables*
+
 
 ==============================================================================
-9.                                                              *abc-vim-omni*
+9. Compilers                                                   *abc-compilers*
+
 
 ==============================================================================
-10.                                                          *abc-vim-options*
+10. Omnicompletion                                                  *abc-omni*
+
 
 ==============================================================================
-11.                                                             *abc-vim-help*
+11. Options                                                      *abc-options*
+
 
 ==============================================================================
-12.                                                       *abc-vim-developers*
+12. Help                                                            *abc-help*
+
 
 ==============================================================================
-13.                                                        *abc-vim-changelog*
+13. Developers                                                *abc-developers*
+
 
 ==============================================================================
-15.                                                         *abc-vim-licenses*
+14. Changelog                                                  *abc-changelog*
+
 
 ==============================================================================
-16. Todo                                                        *abc-vim-todo*
+15. Licenses                                                    *abc-licenses*
+
+
+==============================================================================
+16. Todo                                                            *abc-todo*
 
 
 "vim:tw=78:ts=8:ft=help

src/syntax/abc.vim

 "   See the License for the specific language governing permissions and
 "   limitations under the License.
 " }}}
-" Load PostScript and SVG syntax. PostScript is native to abc code, SVG is to
-" support SVG content. HTML code is technically supported this way, for XHTML.
+" Load PostScript and XML syntax.
 " Initialization {{{
 if !exists("main_syntax")
     if version < 600
-        syntax clear " Clear the syntax
+        syntax clear " Clear the syntax highlighting
     elseif has("b:current_syntax=1")
         finish
     endif
-    let main_syntax = "abc"
     syn include syntax/xml.vim " Supports any other form of XML used in a tune.
     syn include after/syntax/svg.vim
     " Supports using SVG content in beginsvg/endsvg sections.
     " Supports using C-style Unicode string character escape codes.
     syn include syntax/postscr.vim
     " abc is extended from PostScript syntax.
+    let main_syntax = "abc"
     endif
 endif
 " }}}
 " Numbers {{{
 syn case ignore
+" Hexadecimal numbers are used in HTML entities & for the CSS color value for
+" '%%bgcolor'.
 syn match abcHex "\<\x\{2,}\>"
 " Integers
 syn match abcInteger "\<\d\+\>"
 " }}}
 " Free text, remarks, & comments {{{
 " Free text has least priority
-syn region abcFreeText start="^\s*$" excludenl skip="\_.$" excludenl end="^\s*$" contains=abcSpecialChar,abcSpecial,@abcXML
-syn region abcRemark start="^r:" excludenl end="$" oneline keepend nextgroup=abcFieldContinue skipwhite skipnl fold
-syn region abcRemark start="\[r:[^%]*" end="\]" contained keepend fold
+syn region abcFreeText start='^\s*$' excludenl skip='\_.$' excludenl end='^\s*$' contains=abcSpecialChar,abcSpecial,@abcXML
+syn match abcComment excludenl '%.*$'
+syn region abcRemark start='^r:' excludenl end='$' oneline keepend nextgroup=abcFieldContinue skipwhite skipnl fold
+syn region abcRemark start='\[r:[^%]*' end='\]' contained keepend fold
+" abcRemark is treated as both a means for a multiline comment and as an inline
+" comment.
 " }}}
 " Typeset Text {{{
 " NOTE: 
 " utf-32 little endian
 " }}}
 " Unicode {{{
-if !exists("abc_no_utf")
+if !exists("g:abc_no_utf")
     syn match abcSpecial "\\u00c0" contained conceal cchar=À
     syn match abcSpecial "\\u00e0" contained conceal cchar=à
     syn match abcSpecial "\\u00c8" contained conceal cchar=È
 endif
 " }}}
 " Mnemonics & Entities {{{
-if !exists("abc_no_digraph")
+if !exists("g:abc_no_digraph")
     syn match abcSpecial "\C\\`A\|&Agrave;"  contained conceal cchar=À
     syn match abcSpecial "\C\\`a\|&agrave;"  contained conceal cchar=à
     syn match abcSpecial "\C\\`E\|&Egrave;"  contained conceal cchar=È
 "endfunc
 " }}}
 " Music Code {{{
+syn match abcSlur '(' contained
+syn region abcSlur start='(' end=')' keepend contained
+
+syn match abcTuplet '([2-9]\%(:[2-9]\=\)\{,2}' contained
+
+
+
+syn region abcAnnotation start=#"\%(\^\|_\|<\|>\|@\d,\d:\)\{1}# skip=#[^%]*# end=#"# keepend oneline contained contains=@abcPostScript
+
+
+syn match abcAccidental '\%(^\{1,2}\|=\|_\{1,2}\|^=\|_=\|==\)' contained
+
+" Default group: 
+" <grace notes>?, <chord symbols>*, (<annotations>|<decorations>)*,
+" <accidentals>?, <NOTE>, <octave>*, <note length>?, <tie>?
+
+" Chords/Unisons group:
+" <chord symbols>*, (<annotations>|<decorations>)*, '[',
+" (<grace notes>?, <accidentals>?, <NOTE>, <octave>*, <note length>?, (<tie>|<overlay>)?)+, ']', <note length>?
+
+" Chord symbols group:
+" '"', <NOTE>, <accidental>?, <type>?, ('/', <bass note>)?, '"'
+
+" Grace notes group:
+" '{', '/'?, (<accidentals>?, <NOTE>, <octave>*, <note length>?, <tie>?)+, '}'
+
+" Slur group:
+" <chord symbols>*, (<annotations>|<decorations>)*, '('*, (<grace notes>?,
+" (<annotations>|<decorations>)*, <accidentals>?, <NOTE>, <octave>*, <note
+" length>?, <tie>?)+, ')'*
+
+" Rests group:
+" <grace notes>?, <chord symbols>*, (<annotations>|<decorations>)*, <REST>, <note length>?
+
+" Spacers group:
+" <grace notes>?, <chord symbols>*, (<annotations>|<decorations>)*, <SPACER>,
+" <position>?
+
 syn match abcRepeatEnd "\%(|\|\[\)\%([1-9]\%([,-][2-9]\)*\)\=" contained
 syn sync linecont "\\"
-syn match abcLineContinue "\\" nextgroup=postscrComment skipwhite
+syn match abcLineContinue "\\" nextgroup=abcComment skipwhite
 syn region abcRepeat start="\z(|\|\[\|\]\)\z(:\+\)" skip="::\|:|:\|:||:\|\z1[1-9]\%([,-][2-9]\)*" end="\z2\z1" keepend contains=abcBarChar,abcRepeatBarChar,abcRepeatEnd
 " containedin=abcCodeLine
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.