Mercurial > hg > RemoteEditor > vim7
comparison runtime/syntax/automake.vim @ 0:76efa0be13f1
Initial revision
author | atsuki |
---|---|
date | Sat, 10 Nov 2007 15:07:22 +0900 |
parents | |
children | e170173ecb68 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:76efa0be13f1 |
---|---|
1 " Vim syntax file | |
2 " Language: automake Makefile.am | |
3 " Maintainer: Felipe Contreras <felipe.contreras@gmail.com> | |
4 " Former Maintainer: John Williams <jrw@pobox.com> | |
5 " Last Change: $LastChangedDate: 2006-04-16 22:06:40 -0400 (dom, 16 apr 2006) $ | |
6 " URL: http://svn.debian.org/wsvn/pkg-vim/trunk/runtime/syntax/automake.vim?op=file&rev=0&sc=0 | |
7 " | |
8 " This script adds support for automake's Makefile.am format. It highlights | |
9 " Makefile variables significant to automake as well as highlighting | |
10 " autoconf-style @variable@ substitutions . Subsitutions are marked as errors | |
11 " when they are used in an inappropriate place, such as in defining | |
12 " EXTRA_SOURCES. | |
13 | |
14 | |
15 " Read the Makefile syntax to start with | |
16 if version < 600 | |
17 source <sfile>:p:h/make.vim | |
18 else | |
19 runtime! syntax/make.vim | |
20 endif | |
21 | |
22 syn match automakePrimary "^[A-Za-z0-9_]\+_\(PROGRAMS\|LIBRARIES\|LISP\|PYTHON\|JAVA\|SCRIPTS\|DATA\|HEADERS\|MANS\|TEXINFOS\|LTLIBRARIES\)\s*="me=e-1 | |
23 | |
24 syn match automakeSecondary "^[A-Za-z0-9_]\+_\(SOURCES\|AR\|LIBADD\|LDADD\|LDFLAGS\|DEPENDENCIES\|LINK\|SHORTNAME\)\s*="me=e-1 | |
25 syn match automakeSecondary "^[A-Za-z0-9_]\+_\(CCASFLAGS\|CFLAGS\|CPPFLAGS\|CXXFLAGS\|FFLAGS\|GCJFLAGS\|LFLAGS\|OBJCFLAGS\|RFLAGS\|YFLAGS\)\s*="me=e-1 | |
26 | |
27 syn match automakeExtra "^EXTRA_DIST\s*="me=e-1 | |
28 syn match automakeExtra "^EXTRA_PROGRAMS\s*="me=e-1 | |
29 syn match automakeExtra "^EXTRA_[A-Za-z0-9_]\+_SOURCES\s*="me=e-1 | |
30 | |
31 " TODO: Check these: | |
32 syn match automakePrimary "^TESTS\s*="me=e-1 | |
33 syn match automakeSecondary "^OMIT_DEPENDENCIES\s*="me=e-1 | |
34 syn match automakeOptions "^\(AUTOMAKE_OPTIONS\|ETAGS_ARGS\|TAGS_DEPENDENCIES\)\s*="me=e-1 | |
35 syn match automakeClean "^\(MOSTLY\|DIST\|MAINTAINER\)\=CLEANFILES\s*="me=e-1 | |
36 syn match automakeSubdirs "^\(DIST_\)\=SUBDIRS\s*="me=e-1 | |
37 syn match automakeConditional "^\(if\s*[a-zA-Z0-9_]\+\|else\|endif\)\s*$" | |
38 | |
39 syn match automakeSubst "@[a-zA-Z0-9_]\+@" | |
40 syn match automakeSubst "^\s*@[a-zA-Z0-9_]\+@" | |
41 syn match automakeComment1 "#.*$" contains=automakeSubst | |
42 syn match automakeComment2 "##.*$" | |
43 | |
44 syn match automakeMakeError "$[{(][^})]*[^a-zA-Z0-9_})][^})]*[})]" " GNU make function call | |
45 | |
46 syn region automakeNoSubst start="^EXTRA_[a-zA-Z0-9_]*\s*=" end="$" contains=ALLBUT,automakeNoSubst transparent | |
47 syn region automakeNoSubst start="^DIST_SUBDIRS\s*=" end="$" contains=ALLBUT,automakeNoSubst transparent | |
48 syn region automakeNoSubst start="^[a-zA-Z0-9_]*_SOURCES\s*=" end="$" contains=ALLBUT,automakeNoSubst transparent | |
49 syn match automakeBadSubst "@\([a-zA-Z0-9_]*@\=\)\=" contained | |
50 | |
51 syn region automakeMakeDString start=+"+ skip=+\\"+ end=+"+ contains=makeIdent,automakeSubstitution | |
52 syn region automakeMakeSString start=+'+ skip=+\\'+ end=+'+ contains=makeIdent,automakeSubstitution | |
53 syn region automakeMakeBString start=+`+ skip=+\\`+ end=+`+ contains=makeIdent,makeSString,makeDString,makeNextLine,automakeSubstitution | |
54 | |
55 " Define the default highlighting. | |
56 " For version 5.7 and earlier: only when not done already | |
57 " For version 5.8 and later: only when an item doesn't have highlighting yet | |
58 if version >= 508 || !exists("did_automake_syntax_inits") | |
59 if version < 508 | |
60 let did_automake_syntax_inits = 1 | |
61 command -nargs=+ HiLink hi link <args> | |
62 else | |
63 command -nargs=+ HiLink hi def link <args> | |
64 endif | |
65 | |
66 HiLink automakePrimary Statement | |
67 HiLink automakeSecondary Type | |
68 HiLink automakeExtra Special | |
69 HiLink automakeOptions Special | |
70 HiLink automakeClean Special | |
71 HiLink automakeSubdirs Statement | |
72 HiLink automakeConditional PreProc | |
73 HiLink automakeSubst PreProc | |
74 HiLink automakeComment1 makeComment | |
75 HiLink automakeComment2 makeComment | |
76 HiLink automakeMakeError makeError | |
77 HiLink automakeBadSubst makeError | |
78 HiLink automakeMakeDString makeDString | |
79 HiLink automakeMakeSString makeSString | |
80 HiLink automakeMakeBString makeBString | |
81 | |
82 delcommand HiLink | |
83 endif | |
84 | |
85 let b:current_syntax = "automake" | |
86 | |
87 " vi: ts=8 sw=4 sts=4 |