All pastes #108457 Raw Edit

Something

public text v1 · immutable
#108457 ·published 2006-07-31 14:15 UTC
rendered paste body
if version < 600
  syntax clear
elseif exists("b:current_syntax")
  finish
endif

syn keyword LiquidKeyword else endfor endif for if in contained

" These are variables that are made available inside a for loop
syn keyword LiquidSpecial forloop length index index0 rindex rindex0 first last contained

" These are the operators Liquid supports.
syn match LiquidOperator "\(==\|!=\|<\|>\|>=\|<=\||\)" contained

" Pipes:
syn match LiquidPipe "\(\||\)" contained

" Strings:
syn region LiquidString start=+"+ skip=/\\"/ end=+"+ contained
syn region LiquidString start=+'+ skip=/\\'/ end=+-+ contained

" Numbers:
syn match LiquidNumber "-\=\<\d*\.\=[0-9_]\>" contained

" Comments:
syn region LiquidComment start='{% comment %}' end='{% endcomment %}'

" Output:

syn match LiquidTagStart '{%'
syn match LiquidTagEnd "%}"

syn region LiquidTags start='{%' keepend end='%}' contains=LiquidKeyword,LiquidSpecial,LiquidOperator,LiquidString,LiquidPipe,LiquidNumber 
syn region LiquidOutput start='{{' end='}}' 

hi link LiquidComment Comment
hi link LiquidNumber Number
hi link LiquidString String

hi link LiquidKeyword Keyword 
hi link LiquidPipe Special
hi link LiquidSpecial Special
hi link LiquidOutput Special
hi link LiquidOperator Operator

hi link LiquidTagStart Special
hi link LiquidTagEnd Special

let b:current_syntax="liquid"