1 " Description: PIR indenter
2 " Author: Andrew Rodland <arodland@entermail.net>
3 " Maintainer: Jimmy Zhuo <zhuomingliang@yahoo.com.cn>
4 " Last Change: 2009 Jan 16
6 " As usual, we want to be alone
7 if exists("b:did_indent")
12 setlocal indentexpr=PIRIndent()
13 setlocal indentkeys=o,O,*<Return>,<bs>,:,=.end,0#
16 return synIDattr(synID(a:lnum, 1, 1), "name") =~? '^myPod$\|^pod[A-Z]'
20 let thisline = getline(v:lnum)
22 let POD_START = '^=[a-z]'
24 if thisline =~? POD_START
34 if thisline =~? COMMENT
40 let lnum = prevnonblank(lnum-1)
41 let prevline = getline(lnum)
43 if prevline !~? COMMENT
54 let ind = indent(lnum)
56 let SUB = '^\s*\.pcc_sub\s\+\|^\s*\.sub\s\+\|^\s*\.macro\s\+'
57 let RETURNBLOCK = '\s*\.begin_return\s*$'
58 let END = '^\s*\.end\s*$\|^\s*\.end_return\s*\|^\s*\.endm$'
59 let LABEL = '^\s*\k\+:'
65 if prevline =~? RETURNBLOCK