2 " Language: YACC input file
3 " Maintainer: Nikolai Weibull <now@bitwi.se>
4 " Latest Revision: 2006-04-19
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
16 " Only define the function once.
17 if exists("*GetYaccIndent")
21 function GetYaccIndent()
26 let ind = indent(v:lnum - 1)
27 let line = getline(v:lnum - 1)
31 elseif line =~ '^\w\+\s*:'
32 let ind = ind + matchend(line, '^\w\+\s*')
33 elseif line =~ '^\s*;'
36 let ind = indent(v:lnum)