2 " Language: YACC input file
3 " Maintainer: Nikolai Weibull <now@bitwi.se>
4 " Latest Revision: 2006-12-20
6 " Only load this indent file when no other was loaded.
7 if exists("b:did_indent")
13 setlocal indentexpr=GetYaccIndent()
14 setlocal indentkeys=!^F,o,O
15 setlocal nosmartindent
17 " Only define the function once.
18 if exists("*GetYaccIndent")
22 function GetYaccIndent()
27 let ind = indent(v:lnum - 1)
28 let line = getline(v:lnum - 1)
32 elseif line =~ '^\w\+\s*:'
33 let ind = ind + matchend(line, '^\w\+\s*')
34 elseif line =~ '^\s*;'
37 let ind = indent(v:lnum)