@@ -62,17 +62,17 @@ endfunction " }}}2
62
62
" GetLocList() for C-like compilers
63
63
function ! syntastic#c#GetLocList (filetype , subchecker, options ) " {{{2
64
64
try
65
- let flags = s: getCflags (a: filetype , a: subchecker , a: options )
65
+ let flags = s: _getCflags (a: filetype , a: subchecker , a: options )
66
66
catch /\m\C^Syntastic: skip checks$/
67
67
return []
68
68
endtry
69
69
70
70
let makeprg = syntastic#util#shexpand (g: syntastic_ {a: filetype }_compiler) .
71
71
\ ' ' . flags . ' ' . syntastic#util#shexpand (' %' )
72
72
73
- let errorformat = s: getCheckerVar (' g' , a: filetype , a: subchecker , ' errorformat' , a: options [' errorformat' ])
73
+ let errorformat = s: _getCheckerVar (' g' , a: filetype , a: subchecker , ' errorformat' , a: options [' errorformat' ])
74
74
75
- let postprocess = s: getCheckerVar (' g' , a: filetype , a: subchecker , ' remove_include_errors' , 0 ) ?
75
+ let postprocess = s: _getCheckerVar (' g' , a: filetype , a: subchecker , ' remove_include_errors' , 0 ) ?
76
76
\ [' filterForeignErrors' ] : []
77
77
78
78
" process makeprg
@@ -87,29 +87,29 @@ endfunction " }}}2
87
87
" Private functions {{{1
88
88
89
89
" initialize c/cpp syntax checker handlers
90
- function ! s: init () " {{{2
90
+ function ! s: _init () " {{{2
91
91
let s: handlers = []
92
92
let s: cflags = {}
93
93
94
- call s: regHandler (' \m\<cairo' , ' syntastic#c#checkPKG' , [' cairo' , ' cairo' ])
95
- call s: regHandler (' \m\<freetype' , ' syntastic#c#checkPKG' , [' freetype' , ' freetype2' , ' freetype' ])
96
- call s: regHandler (' \m\<glade' , ' syntastic#c#checkPKG' , [' glade' , ' libglade-2.0' , ' libglade' ])
97
- call s: regHandler (' \m\<glib' , ' syntastic#c#checkPKG' , [' glib' , ' glib-2.0' , ' glib' ])
98
- call s: regHandler (' \m\<gtk' , ' syntastic#c#checkPKG' , [' gtk' , ' gtk+-2.0' , ' gtk+' , ' glib-2.0' , ' glib' ])
99
- call s: regHandler (' \m\<libsoup' , ' syntastic#c#checkPKG' , [' libsoup' , ' libsoup-2.4' , ' libsoup-2.2' ])
100
- call s: regHandler (' \m\<libxml' , ' syntastic#c#checkPKG' , [' libxml' , ' libxml-2.0' , ' libxml' ])
101
- call s: regHandler (' \m\<pango' , ' syntastic#c#checkPKG' , [' pango' , ' pango' ])
102
- call s: regHandler (' \m\<SDL' , ' syntastic#c#checkPKG' , [' sdl' , ' sdl' ])
103
- call s: regHandler (' \m\<opengl' , ' syntastic#c#checkPKG' , [' opengl' , ' gl' ])
104
- call s: regHandler (' \m\<webkit' , ' syntastic#c#checkPKG' , [' webkit' , ' webkit-1.0' ])
105
-
106
- call s: regHandler (' \m\<php\.h\>' , ' syntastic#c#checkPHP' , [])
107
- call s: regHandler (' \m\<Python\.h\>' , ' syntastic#c#checkPython' , [])
108
- call s: regHandler (' \m\<ruby' , ' syntastic#c#checkRuby' , [])
94
+ call s: _regHandler (' \m\<cairo' , ' syntastic#c#checkPKG' , [' cairo' , ' cairo' ])
95
+ call s: _regHandler (' \m\<freetype' , ' syntastic#c#checkPKG' , [' freetype' , ' freetype2' , ' freetype' ])
96
+ call s: _regHandler (' \m\<glade' , ' syntastic#c#checkPKG' , [' glade' , ' libglade-2.0' , ' libglade' ])
97
+ call s: _regHandler (' \m\<glib' , ' syntastic#c#checkPKG' , [' glib' , ' glib-2.0' , ' glib' ])
98
+ call s: _regHandler (' \m\<gtk' , ' syntastic#c#checkPKG' , [' gtk' , ' gtk+-2.0' , ' gtk+' , ' glib-2.0' , ' glib' ])
99
+ call s: _regHandler (' \m\<libsoup' , ' syntastic#c#checkPKG' , [' libsoup' , ' libsoup-2.4' , ' libsoup-2.2' ])
100
+ call s: _regHandler (' \m\<libxml' , ' syntastic#c#checkPKG' , [' libxml' , ' libxml-2.0' , ' libxml' ])
101
+ call s: _regHandler (' \m\<pango' , ' syntastic#c#checkPKG' , [' pango' , ' pango' ])
102
+ call s: _regHandler (' \m\<SDL' , ' syntastic#c#checkPKG' , [' sdl' , ' sdl' ])
103
+ call s: _regHandler (' \m\<opengl' , ' syntastic#c#checkPKG' , [' opengl' , ' gl' ])
104
+ call s: _regHandler (' \m\<webkit' , ' syntastic#c#checkPKG' , [' webkit' , ' webkit-1.0' ])
105
+
106
+ call s: _regHandler (' \m\<php\.h\>' , ' syntastic#c#checkPHP' , [])
107
+ call s: _regHandler (' \m\<Python\.h\>' , ' syntastic#c#checkPython' , [])
108
+ call s: _regHandler (' \m\<ruby' , ' syntastic#c#checkRuby' , [])
109
109
endfunction " }}}2
110
110
111
111
" return a handler dictionary object
112
- function ! s: regHandler (regex, function , args ) " {{{2
112
+ function ! s: _regHandler (regex, function , args ) " {{{2
113
113
let handler = {}
114
114
let handler[" regex" ] = a: regex
115
115
let handler[" func" ] = function (a: function )
@@ -118,7 +118,7 @@ function! s:regHandler(regex, function, args) " {{{2
118
118
endfunction " }}}2
119
119
120
120
" resolve checker-related user variables
121
- function ! s: getCheckerVar (scope, filetype , subchecker, name, default) " {{{2
121
+ function ! s: _getCheckerVar (scope, filetype , subchecker, name, default) " {{{2
122
122
let prefix = a: scope . ' :' . ' syntastic_'
123
123
if exists (prefix . a: filetype . ' _' . a: subchecker . ' _' . a: name )
124
124
return {a: scope }:syntastic_{a: filetype }_{a: subchecker }_{a: name }
@@ -130,10 +130,10 @@ function! s:getCheckerVar(scope, filetype, subchecker, name, default) " {{{2
130
130
endfunction " }}}2
131
131
132
132
" resolve user CFLAGS
133
- function ! s: getCflags (ft , ck, opts) " {{{2
133
+ function ! s: _getCflags (ft , ck, opts) " {{{2
134
134
" determine whether to parse header files as well
135
135
if has_key (a: opts , ' header_names' ) && expand (' %' ) = ~? a: opts [' header_names' ]
136
- if s: getCheckerVar (' g' , a: ft , a: ck , ' check_header' , 0 )
136
+ if s: _getCheckerVar (' g' , a: ft , a: ck , ' check_header' , 0 )
137
137
let flags = get (a: opts , ' header_flags' , ' ' ) . ' -c ' . syntastic#c#NullOutput ()
138
138
else
139
139
" checking headers when check_header is unset: bail out
@@ -143,21 +143,21 @@ function! s:getCflags(ft, ck, opts) " {{{2
143
143
let flags = get (a: opts , ' main_flags' , ' ' )
144
144
endif
145
145
146
- let flags .= ' ' . s: getCheckerVar (' g' , a: ft , a: ck , ' compiler_options' , ' ' ) . ' ' . s: getIncludeDirs (a: ft )
146
+ let flags .= ' ' . s: _getCheckerVar (' g' , a: ft , a: ck , ' compiler_options' , ' ' ) . ' ' . s: _getIncludeDirs (a: ft )
147
147
148
148
" check if the user manually set some cflags
149
- let b_cflags = s: getCheckerVar (' b' , a: ft , a: ck , ' cflags' , ' ' )
149
+ let b_cflags = s: _getCheckerVar (' b' , a: ft , a: ck , ' cflags' , ' ' )
150
150
if b_cflags == ' '
151
151
" check whether to search for include files at all
152
- if ! s: getCheckerVar (' g' , a: ft , a: ck , ' no_include_search' , 0 )
152
+ if ! s: _getCheckerVar (' g' , a: ft , a: ck , ' no_include_search' , 0 )
153
153
if a: ft == # ' c' || a: ft == # ' cpp'
154
154
" refresh the include file search if desired
155
- if s: getCheckerVar (' g' , a: ft , a: ck , ' auto_refresh_includes' , 0 )
156
- let flags .= ' ' . s: searchHeaders ()
155
+ if s: _getCheckerVar (' g' , a: ft , a: ck , ' auto_refresh_includes' , 0 )
156
+ let flags .= ' ' . s: _searchHeaders ()
157
157
else
158
158
" search for header includes if not cached already
159
159
if ! exists (' b:syntastic_' . a: ft . ' _includes' )
160
- let b: syntastic_ {a: ft }_includes = s: searchHeaders ()
160
+ let b: syntastic_ {a: ft }_includes = s: _searchHeaders ()
161
161
endif
162
162
let flags .= ' ' . b: syntastic_ {a: ft }_includes
163
163
endif
@@ -169,15 +169,15 @@ function! s:getCflags(ft, ck, opts) " {{{2
169
169
endif
170
170
171
171
" add optional config file parameters
172
- let config_file = s: getCheckerVar (' g' , a: ft , a: ck , ' config_file' , ' .syntastic_' . a: ft . ' _config' )
172
+ let config_file = s: _getCheckerVar (' g' , a: ft , a: ck , ' config_file' , ' .syntastic_' . a: ft . ' _config' )
173
173
let flags .= ' ' . syntastic#c#ReadConfig (config_file)
174
174
175
175
return flags
176
176
endfunction " }}}2
177
177
178
178
" get the gcc include directory argument depending on the default
179
179
" includes and the optional user-defined 'g:syntastic_c_include_dirs'
180
- function ! s: getIncludeDirs (filetype ) " {{{2
180
+ function ! s: _getIncludeDirs (filetype ) " {{{2
181
181
let include_dirs = []
182
182
183
183
if a: filetype = ~# ' \v^%(c|cpp|objc|objcpp)$' &&
@@ -195,7 +195,7 @@ endfunction " }}}2
195
195
196
196
" search the first 100 lines for include statements that are
197
197
" given in the handlers dictionary
198
- function ! s: searchHeaders () " {{{2
198
+ function ! s: _searchHeaders () " {{{2
199
199
let includes = ' '
200
200
let files = []
201
201
let found = []
@@ -324,7 +324,7 @@ let s:default_includes = [
324
324
\ ' ..' . syntastic#util#Slash () . ' include' ,
325
325
\ ' ..' . syntastic#util#Slash () . ' includes' ]
326
326
327
- call s: init ()
327
+ call s: _init ()
328
328
329
329
let &cpo = s: save_cpo
330
330
unlet s: save_cpo
0 commit comments