Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Refactor.

  • Loading branch information...
commit a6cee3940549756acb523ea0e28ea7a677f2165a 1 parent a6844a8
Marnen Laibow-Koser authored

Showing 1 changed file with 21 additions and 14 deletions. Show diff stats Hide diff stats

  1. +21 14 udl/lilypond.udl
35 udl/lilypond.udl
@@ -2,23 +2,30 @@
2 2 sublanguage Lilypond
3 3 family markup
4 4
5   -start_style M_DEFAULT
6   -end_style M_COMMENT
  5 +start_style CSL_DEFAULT
  6 +end_style CSL_REGEX
7 7
8   -initial IN_M_DEFAULT
  8 +initial IN_CSL_DEFAULT
9 9
10   -state IN_M_DEFAULT:
11   -'%{' : paint(upto, M_DEFAULT), => IN_M_BLOCK_COMMENT
12   -'%' : paint(upto, M_DEFAULT), => IN_M_COMMENT
13   -'"' : paint(upto, M_DEFAULT), => IN_M_STRING
  10 +pattern IDENTIFIERCHAR = '[^\W\d]' # characters that can appear in identifiers
  11 +pattern NONIDENTIFIERCHAR = '[\W\d]'
14 12
15   -state IN_M_BLOCK_COMMENT:
16   -'%}' : paint(include, M_COMMENT), => IN_M_DEFAULT
17   -/\z/ : paint(upto, M_COMMENT)
  13 +state IN_CSL_DEFAULT:
  14 +'%{' : paint(upto, CSL_DEFAULT), => IN_CSL_BLOCK_COMMENT
  15 +'%' : paint(upto, CSL_DEFAULT), => IN_CSL_COMMENT
  16 +'"' : paint(upto, CSL_DEFAULT), => IN_CSL_STRING
  17 +/\\(?=$IDENTIFIERCHAR)/ : paint(upto, CSL_DEFAULT), paint(include, CSL_IDENTIFIER), => IN_CSL_IDENTIFIER
18 18
19   -state IN_M_COMMENT:
20   -/\n/ : paint(include, M_COMMENT), => IN_M_DEFAULT
  19 +state IN_CSL_BLOCK_COMMENT:
  20 +'%}' : paint(include, CSL_COMMENT), => IN_CSL_DEFAULT
  21 +/\z/ : paint(upto, CSL_COMMENT)
21 22
22   -state IN_M_STRING:
  23 +state IN_CSL_COMMENT:
  24 +/\n/ : paint(include, CSL_COMMENT), => IN_CSL_DEFAULT
  25 +
  26 +state IN_CSL_STRING:
23 27 '\\"' : #stay
24   -'"' : paint(include, M_STRING), => IN_M_DEFAULT
  28 +'"' : paint(include, CSL_STRING), => IN_CSL_DEFAULT
  29 +
  30 +state IN_CSL_IDENTIFIER:
  31 +/$NONIDENTIFIERCHAR/ : paint(upto, CSL_IDENTIFIER), => IN_CSL_DEFAULT

0 comments on commit a6cee39

Please sign in to comment.
Something went wrong with that request. Please try again.