Permalink
Browse files

fix lucius, update after syntax

  • Loading branch information...
1 parent 21fa9d2 commit 74622f4725d3c0261717b95a339434f0984fb53f @pbrisbin committed Feb 10, 2012
Showing with 25 additions and 9 deletions.
  1. +17 −7 after/syntax/haskell.vim
  2. +1 −1 syntax/hamlet.vim
  3. +7 −1 test/test.hs
View
24 after/syntax/haskell.vim
@@ -13,18 +13,23 @@ unlet b:current_syntax
syn include @cassius syntax/cassius.vim
unlet b:current_syntax
-syn include @lucious syntax/lucius.vim
+syn include @lucius syntax/lucius.vim
unlet b:current_syntax
syn include @julius syntax/julius.vim
unlet b:current_syntax
-syn region hmBlock matchgroup=quasiQuote start=/\[\$\?[iw]\?hamlet|/ end=/|\]/ contains=@hamlet
-syn region hmBlock matchgroup=quasiQuote start=/\[\$\?xs\?hamlet|/ end=/|\]/ contains=@hamlet
-syn region hmBlock matchgroup=quasiQuote start=/\[\$\?x\?shamlet|/ end=/|\]/ contains=@hamlet
-syn region csBlock matchgroup=quasiQuote start=/\[\$\?cassius|/ end=/|\]/ contains=@cassius
-syn region lcBlock matchgroup=quasiQuote start=/\[\$\?lucius|/ end=/|\]/ contains=@lucius
-syn region jsBlock matchgroup=quasiQuote start=/\[\$\?julius|/ end=/|\]/ contains=@julius
+syn match txtInterp contained /\#{[^}]*}/ contains=txtOp,txtString,txtNum
+syn match txtOp contained /\(\$\|\.\)/
+syn match txtString contained /"[^"]*"/
+syn match txtNum contained /\<[0-9]*\>/
+
+syn region hmBlock matchgroup=quasiQuote start=/\[\$\?[iws]\?hamlet|/ end=/|\]/ contains=@hamlet
+syn region hmBlock matchgroup=quasiQuote start=/\[\$\?xs\?hamlet|/ end=/|\]/ contains=@hamlet
+syn region csBlock matchgroup=quasiQuote start=/\[\$\?cassius|/ end=/|\]/ contains=@cassius
+syn region lcBlock matchgroup=quasiQuote start=/\[\$\?lucius|/ end=/|\]/ contains=@lucius
+syn region jsBlock matchgroup=quasiQuote start=/\[\$\?julius|/ end=/|\]/ contains=@julius
+syn region txtBlock matchgroup=quasiQuote start=/\[\$\?[sl]t|/ end=/|\]/ contains=txtInterp
if version < 508
command! -nargs=+ HiLink hi link <args>
@@ -37,6 +42,11 @@ HiLink quasiQuote Boolean
HiLink hmBlock StorageClass
HiLink jsBlock StorageClass
+HiLink txtInterp Structure
+HiLink txtOp Operator
+HiLink txtString String
+HiLink txtNum Number
+
delcommand HiLink
" restore current syntax value
View
2 syntax/hamlet.vim
@@ -15,7 +15,7 @@ endif
syntax spell toplevel
syn match hmString contained /"[^"]*"/ contains=hmVar,hmRoute,hmLang
-syn match hmNum contained /[0-9]*/
+syn match hmNum contained /\<[0-9]*\>/
syn match hmTrail display excludenl /\s\+$/
syn match hmComment display /\(\$#.*$\|<!--.*-->\)/
View
8 test/test.hs
@@ -4,7 +4,9 @@
<script src="/jquery.min.js">
<script src="/jquery-ui.min.js">
- \<!-- why you no work -->
+ <!-- comment -->
+
+ $# comment
<body>
<p>Go to
@@ -101,3 +103,7 @@
f(1.0);
|]
+
+[st|Some #{interpolated $ text}|]
+
+[lt|Some #{lazily $ interpolated $ text}|]

0 comments on commit 74622f4

Please sign in to comment.