Commits

abudden committed 44ede65 Merge

Merged tag highlight refactor.

Comments (0)

Files changed (30)

autoload/TagHighlight/Debug.vim

+" Tag Highlighter:
+"   Author:  A. S. Budden <abudden _at_ gmail _dot_ com>
+"   Date:    29/06/2011
+"   Version: 1
+" Copyright: Copyright (C) 2010 A. S. Budden
+"            Permission is hereby granted to use and distribute this code,
+"            with or without modifications, provided that this copyright
+"            notice is copied with it. Like anything else that's free,
+"            <+$FILENAME$>.vim is provided *as is* and comes with no
+"            warranty of any kind, either expressed or implied. By using
+"            this plugin, you agree that in no event will the copyright
+"            holder be liable for any damages resulting from the use
+"            of this software.
+
+" ---------------------------------------------------------------------
+try
+	if &cp || (exists('g:loaded_TagHLDebug') && (g:plugin_development_mode != 1))
+		throw "Already loaded"
+	endif
+catch
+	finish
+endtry
+let g:loaded_TagHLDebug = 1
+
+let TagHighlight#Debug#DebugLevels = [
+			\ "None",
+			\ "Critical",
+			\ "Error",
+			\ "Warning",
+			\ "Status",
+			\ "Information",
+			\ ]
+
+function! TagHighlight#Debug#GetDebugLevel()
+	let debug_level = TagHighlight#Option#GetOption('DebugLevel', 'Error')
+	let debug_num = index(g:TagHighlight#Debug#DebugLevels, debug_level)
+	if debug_num != -1
+		return debug_num
+	else
+		return index(g:TagHighlight#Debug#DebugLevels, 'Error')
+	endif
+endfunction
+
+function! TagHighlight#Debug#GetDebugLevelName()
+	let debug_level_num = TagHighlight#Debug#GetDebugLevel()
+	return g:TagHighlight#Debug#DebugLevels[debug_level_num]
+endfunction
+
+function! TagHighlight#Debug#Print(str, level)
+	let level_index = index(g:TagHighlight#Debug#DebugLevels, a:level)
+	if level_index == -1
+		level_index = index(g:TagHighlight#Debug#DebugLevels, 'Critical')
+	endif
+	if level_index <= TagHighlight#Debug#GetDebugLevel()
+		echomsg a:str
+	endif
+endfunction

autoload/TagHighlight/Generation.vim

+" Tag Highlighter:
+"   Author:  A. S. Budden <abudden _at_ gmail _dot_ com>
+"   Date:    01/07/2011
+"   Version: 1
+" Copyright: Copyright (C) 2010 A. S. Budden
+"            Permission is hereby granted to use and distribute this code,
+"            with or without modifications, provided that this copyright
+"            notice is copied with it. Like anything else that's free,
+"            Generation.vim is provided *as is* and comes with no
+"            warranty of any kind, either expressed or implied. By using
+"            this plugin, you agree that in no event will the copyright
+"            holder be liable for any damages resulting from the use
+"            of this software.
+
+" ---------------------------------------------------------------------
+try
+	if &cp || (exists('g:loaded_TagHLGeneration') && (g:plugin_development_mode != 1))
+		throw "Already loaded"
+	endif
+catch
+	finish
+endtry
+let g:loaded_TagHLGeneration = 1
+
+function! TagHighlight#Generation#UpdateTypesFile(recurse, skiptags)
+	" Initial very simple implementation
+	
+	" Start with a copy of the settings so that we can tweak things
+	let RunOptions = TagHighlight#Option#CopyOptions()
+	if a:recurse
+		let RunOptions['Recurse'] = 1
+	endif
+	if a:skiptags
+		let RunOptions['DoNotGenerateTags'] = 1
+	endif
+
+	" Most simple options are automatic.  The options below are
+	" handled manually.
+	
+	" Find the ctags path
+	let ctags_option = TagHighlight#Option#GetOption('CtagsExecutable', '')
+	if ctags_option == ''
+		" Option not set: search for 'ctags' in the path
+		let RunOptions['CtagsExeFull'] = TagHighlight#RunPythonScript#FindExeInPath('ctags')
+	elseif ctags_option =~ '[\\/]'
+		" Option set and includes '/' or '\': must be explicit
+		" path to named executable: just pass to mktypes
+		let RunOptions['CtagsExeFull'] = ctags_option
+	else
+		" Option set but doesn't include path separator: search
+		" in the path
+		let RunOptions['CtagsExeFull'] = TagHighlight#RunPythonScript#FindExePath(ctags_option)
+	endif
+	
+	" Find the cscope path
+
+	call TagHighlight#RunPythonScript#RunGenerator(RunOptions)
+endfunction
+
+" Old implementation:
+func! UpdateTypesFile(recurse, skiptags)
+	let s:vrc = globpath(&rtp, "mktypes.py")
+
+	call s:Debug_Print(g:DBG_Status, "Starting UpdateTypesFile revision " . s:CTagsHighlighterVersion)
+
+	if type(s:vrc) == type("")
+		let mktypes_py_file = s:vrc
+	elseif type(s:vrc) == type([])
+		let mktypes_py_file = s:vrc[0]
+	endif
+
+	let sysroot = 'python ' . shellescape(mktypes_py_file)
+	let syscmd = ''
+	
+	if exists('b:TypesFileRecurse')
+		if b:TypesFileRecurse == 1
+			let syscmd .= ' -r'
+		endif
+	else
+		if a:recurse == 1
+			let syscmd .= ' -r'
+		endif
+	endif
+
+	if exists('b:TypesFileLanguages')
+		for lang in b:TypesFileLanguages
+			let syscmd .= ' --include-language=' . lang
+		endfor
+	endif
+
+	let TypesFileIncludeSynMatches = s:GetOption('TypesFileIncludeSynMatches', 0)
+	if TypesFileIncludeSynMatches == 1
+		let syscmd .= ' --include-invalid-keywords-as-matches'
+	endif
+
+	let TypeFileSkipVimKeywords = s:GetOption('TypesFileSkipVimKeywords', 0)
+	if TypeFileSkipVimKeywords == 1
+		let syscmd .= ' --exclude-vim-keywords'
+	endif
+
+	let TypesFileIncludeLocals = s:GetOption('TypesFileIncludeLocals', 1)
+	if TypesFileIncludeLocals == 1
+		let syscmd .= ' --include-locals'
+	endif
+
+	let TypesFileDoNotGenerateTags = s:GetOption('TypesFileDoNotGenerateTags', 0)
+	if TypesFileDoNotGenerateTags == 1
+		let syscmd .= ' --use-existing-tagfile'
+	elseif a:skiptags == 1
+		let syscmd .= ' --use-existing-tagfile'
+	endif
+
+	let syscmd .= ' --ctags-file ' . s:GetOption('TypesCTagsFile', 'tags')
+	let syscmd .= ' --types-prefix ' . s:GetOption('TypesPrefix', 'types')
+
+	let CheckForCScopeFiles = s:GetOption('CheckForCScopeFiles', 0)
+	if CheckForCScopeFiles == 1
+		if cscope_connection()
+			" Kill all existing cscope connections so that the database can be
+			" rebuilt.  Because we run cscope in the background (from python)
+			" we can't just re-add the cscope database as it might not have
+			" finished yet.  Otherwise, we'd parse the output of 'cs show'
+			" and re-add the database at the end of the function.
+			cs kill -1
+		endif
+		let syscmd .= ' --build-cscopedb-if-cscope-file-exists'
+		let syscmd .= ' --cscope-dir=' 
+		let cscope_path = s:FindExePath('extra_source/cscope_win/cscope')
+		let syscmd .= cscope_path
+	endif
+
+	let sysoutput = system(sysroot . syscmd) 
+	echo sysroot . syscmd
+	if sysoutput =~ 'python.*is not recognized as an internal or external command'
+		let sysroot = g:VIMFILESDIR . '/extra_source/mktypes/dist/mktypes.exe'
+		let sysoutput = sysoutput . "\nUsing compiled mktypes\n" . system(sysroot . syscmd)
+	endif
+
+	echo sysoutput
+
+	if g:CTagsHighlighterDebug >= g:DBG_None
+		echomsg sysoutput
+		messages
+	endif
+
+	" There should be a try catch endtry
+	" above, with the fall-back using the
+	" exe on windows or the full system('python') etc
+	" on Linux
+
+endfunc

autoload/TagHighlight/Option.vim

+" Tag Highlighter:
+"   Author:  A. S. Budden <abudden _at_ gmail _dot_ com>
+"   Date:    29/06/2011
+"   Version: 1
+" Copyright: Copyright (C) 2010 A. S. Budden
+"            Permission is hereby granted to use and distribute this code,
+"            with or without modifications, provided that this copyright
+"            notice is copied with it. Like anything else that's free,
+"            <+$FILENAME$>.vim is provided *as is* and comes with no
+"            warranty of any kind, either expressed or implied. By using
+"            this plugin, you agree that in no event will the copyright
+"            holder be liable for any damages resulting from the use
+"            of this software.
+
+" ---------------------------------------------------------------------
+try
+	if &cp || (exists('g:loaded_TagHLOption') && (g:plugin_development_mode != 1))
+		throw "Already loaded"
+	endif
+catch
+	finish
+endtry
+let g:loaded_TagHLOption = 1
+
+" TODO: Options should be customisable per project (following the same method
+" as looking for tags/types... look for options file).
+
+function! TagHighlight#Option#GetOption(name, default)
+	let opt = a:default
+
+	" Option priority (highest first):
+	" * buffer dictionary,
+	" * global dictionary,
+	if has_key(g:TagHighlightSettings, a:name)
+		let opt = g:TagHighlightSettings[a:name]
+	endif
+	if exists('b:TagHighlightSettings') && has_key(b:TagHighlightSettings, a:name)
+		let opt = b:TagHighlightSettings[a:name]
+	endif
+	return opt
+endfunction
+
+function! TagHighlight#Option#CopyOptions()
+	" Skip a few keys to speed copying
+	let skip_keys = ["ScriptOptions","AllTypes","ExtensionLookup"]
+	let result = {}
+	for key in keys(g:TagHighlightSettings)
+		if type(g:TagHighlightSettings[key]) == type([])
+			let result[key] = g:TagHighlightSettings[key][:]
+		elseif type(g:TagHighlightSettings[key]) == type({})
+			let result[key] = deepcopy(g:TagHighlightSettings[key])
+		else
+			let result[key] = g:TagHighlightSettings[key]
+		endif
+	endfor
+	if exists('b:TagHighlightSettings')
+		for key in keys(b:TagHighlightSettings)
+			if type(b:TagHighlightSettings[key]) == type([])
+				let result[key] = b:TagHighlightSettings[key][:]
+			elseif type(b:TagHighlightSettings[key]) == type({})
+				let result[key] = deepcopy(b:TagHighlightSettings[key])
+			else
+				let result[key] = b:TagHighlightSettings[key]
+			endif
+		endfor
+	endif
+
+	return result
+endfunction

autoload/TagHighlight/ReadTypes.vim

+" Tag Highlighter:
+"   Author:  A. S. Budden <abudden _at_ gmail _dot_ com>
+"   Date:    01/07/2011
+"   Version: 1
+" Copyright: Copyright (C) 2010 A. S. Budden
+"            Permission is hereby granted to use and distribute this code,
+"            with or without modifications, provided that this copyright
+"            notice is copied with it. Like anything else that's free,
+"            ReadTypes.vim is provided *as is* and comes with no
+"            warranty of any kind, either expressed or implied. By using
+"            this plugin, you agree that in no event will the copyright
+"            holder be liable for any damages resulting from the use
+"            of this software.
+
+" ---------------------------------------------------------------------
+try
+	if &cp || (exists('g:loaded_TagHLReadTypes') && (g:plugin_development_mode != 1))
+		throw "Already loaded"
+	endif
+catch
+	finish
+endtry
+let g:loaded_TagHLReadTypes = 1
+
+function! TagHighlight#ReadTypes#ReadTypesAutoDetect()
+	let extension = expand('%:e')
+	" echomsg "Reading types for extension " . extension
+	for key in keys(g:TagHighlightSettings['ExtensionLookup'])
+		let regex = '^'.key.'$'
+		if extension =~ regex
+			call TagHighlight#ReadTypes#ReadTypes(g:TagHighlightSettings['ExtensionLookup'][key])
+		endif
+	endfor
+endfunction
+
+function! TagHighlight#ReadTypes#ReadTypes(suffix)
+	let savedView = winsaveview()
+
+	let file = '<afile>'
+	if len(expand(file)) == 0
+		let file = '%'
+	endif
+
+	" echomsg "Reading types of suffix " . a:suffix . " for file " . file
+
+	if TagHighlight#Option#GetOption('DisableTypeParsing', 0) == 1
+		call TagHighlight#Debug#Print("Type file parsing disabled", 'Status')
+		return
+	endif
+
+	let skiplist = TagHighlight#Option#GetOption('ParsingSkipList', [])
+	if len(skiplist) > 0
+		let basename = expand(file . ':p:t')
+		let fullname = expand(file . ':p')
+		if index(skiplist, basename) != -1
+			call TagHighlight#Debug#Print("Skipping file due to basename match", 'Status')
+			return
+		endif
+		if index(skiplist, fullname) != -1
+			call TagHighlight#Debug#Print("Skipping file due to fullname match", 'Status')
+			return
+		endif
+	endif
+
+	call TagHighlight#Debug#Print("Searching for types file", 'Status')
+
+	" Clear any existing syntax entries
+	for group in g:TagHighlightSettings['AllTypes']
+		exe 'syn clear' group
+	endfor
+	
+	let type_files = TagHighlight#ReadTypes#FindTypeFiles(
+				\ TagHighlight#Option#GetOption('TypesFilePrefix',"types") . '_' .
+				\ a:suffix .
+				\ '.vim')
+	for fname in type_files
+		exe 'so' fname
+	endfor
+
+	" Restore the view
+	call winrestview(savedView)
+endfunction
+
+function! TagHighlight#ReadTypes#FindTypeFiles(filename)
+	" TODO: Initial implementation only supports current directory
+	let results = []
+	if filereadable(a:filename)
+		let results += [a:filename]
+	endif
+	return results
+endfunction

autoload/TagHighlight/RunPythonScript.vim

+" Tag Highlighter:
+"   Author:  A. S. Budden <abudden _at_ gmail _dot_ com>
+"   Date:    29/06/2011
+"   Version: 1
+" Copyright: Copyright (C) 2010 A. S. Budden
+"            Permission is hereby granted to use and distribute this code,
+"            with or without modifications, provided that this copyright
+"            notice is copied with it. Like anything else that's free,
+"            RunPythonScript.vim is provided *as is* and comes with no
+"            warranty of any kind, either expressed or implied. By using
+"            this plugin, you agree that in no event will the copyright
+"            holder be liable for any damages resulting from the use
+"            of this software.
+
+" ---------------------------------------------------------------------
+try
+	if &cp || (exists('g:loaded_TagHLRunPythonScript') && (g:plugin_development_mode != 1))
+		throw "Already loaded"
+	endif
+catch
+	finish
+endtry
+let g:loaded_TagHLRunPythonScript = 1
+
+let s:python_variant = 'None'
+
+" This script is responsible for finding a means of running the python app.
+" If vim is compiled with python support (and we can run a simple test
+" command), use that method.  If not, but python is in the path, use it to
+" run the script.  If python is not in path, we'll have to rely on a compiled
+" executable version.
+
+function! s:GetPath()
+	if has("win32")
+		let path = substitute($PATH, '\\\?;', ',', 'g')
+	else
+		let path = substitute($PATH, ':', ',', 'g')
+	endif
+	return path
+endfunction
+
+function! TagHighlight#RunPythonScript#RunGenerator(options)
+	" Will only actually load the options once
+	call TagHighlight#RunPythonScript#LoadScriptOptions()
+
+	if s:python_variant == 'None'
+		call TagHighlight#RunPythonScript#FindPython()
+	endif
+
+	if index(["if_pyth","if_pyth3"], s:python_variant) != -1
+		let add_to_py_path = substitute(g:TagHighlightSettings['PluginPath'], '\\', '/','g')
+		let PY = s:python_cmd[0]
+		exe PY 'import sys'
+		exe PY 'sys.path = ["'.add_to_py_path.'"] + sys.path'
+		exe PY 'from module.utilities import TagHighlightOptionDict' 
+		exe PY 'from module.worker import RunWithOptions'
+		exe PY 'options = TagHighlightOptionDict()'
+		" We're using the custom interpreter: create an options object
+		for option in g:TagHighlightSettings['ScriptOptions']
+			if has_key(option, 'VimOptionMap') && has_key(a:options, option['VimOptionMap'])
+				" We can handle this one automatically
+				let pyoption = 'options["'.option['Destination'].'"]'
+				if option['Type'] == 'bool'
+					if a:options[option['VimOptionMap']]
+						exe PY pyoption '= True'
+					else
+						exe PY pyoption '= False'
+					endif
+				elseif option['Type'] == 'string'
+					exe PY pyoption '= """'.a:options[option['VimOptionMap']].'"""'
+				elseif option['Type'] == 'list'
+					exe PY pyoption '= []'
+					for entry in a:options[option['VimOptionMap']]
+						exe PY pyoption '+= ["""' . entry . '"""]'
+					endfor
+				endif
+			endif
+		endfor
+		exe PY 'RunWithOptions(options)'
+	elseif index(["python","compiled"], s:python_variant) != -1
+		let args = s:python_cmd[:]
+		" We're calling the script externally, build a list of arguments
+		for option in g:TagHighlightSettings['ScriptOptions']
+			if has_key(option, 'VimOptionMap') && has_key(a:options, option['VimOptionMap'])
+				" We can handle this one automatically
+				if option['Type'] == 'bool'
+					if ((a:options[option['VimOptionMap']] && option['Default'] == 'False')
+								\ || ( ! a:options[option['VimOptionMap']] && option['Default'] == 'True'))
+						let args += [option['CommandLineSwitches']]
+					endif
+				elseif option['Type'] == 'string'
+					let args += [option['CommandLineSwitches'] . '=' . a:options[option['VimOptionMap']]]
+				elseif option['Type'] == 'list'
+					for entry in a:options[option['VimOptionMap']]
+						let args += [option['CommandLineSwitches'] . '=' . entry]
+					endfor
+				endif
+			endif
+		endfor
+		let sysoutput = system(join(args, " "))
+	else
+		throw "Tag highlighter: invalid or not implemented python variant"
+	endif
+endfunction
+
+function! TagHighlight#RunPythonScript#FindExeInPath(file)
+	let full_file = a:file
+	if has("win32") || has("win32unix")
+		if a:file !~ '.exe$'
+			let full_file = a:file . '.exe.'
+		endif
+	endif
+	let short_file = fnamemodify(full_file, ':p:t')
+	let file_exe_list = split(globpath(s:GetPath(), short_file), '\n')
+	
+	if len(file_exe_list) > 0 && executable(file_exe_list[0])
+		let file_exe = file_exe_list[0]
+	else
+		return 'None'
+	endif
+	let file_exe = substitute(file_exe, '\\', '/', 'g')
+	return file_exe
+endfunction
+
+function! TagHighlight#RunPythonScript#LoadScriptOptions()
+	if has_key(g:TagHighlightSettings, 'ScriptOptions')
+		return
+	endif
+
+	let g:TagHighlightSettings['ScriptOptions'] = []
+	let entries = readfile(g:TagHighlightSettings['PluginPath'] . '/data/options.txt')
+	
+	let dest = ''
+	let option = {}
+	for entry in entries
+		if entry[len(entry)-1] == ':'
+			if dest != ''
+				let g:TagHighlightSettings['ScriptOptions'] += [deepcopy(option)]
+				let option = {}
+			endif
+			let dest = entry[:len(entry)-2]
+			let option['Destination'] = dest
+			echo "Dest:".dest
+		elseif dest != '' && entry[0] == "\t" && stridx(entry, ':') != -1
+			let parts = split(entry[1:], ':')
+			if parts[0] == 'CommandLineSwitches' && stridx(parts[1], ',') != -1
+				" Only take the first option for the command line switches
+				let parts[1] = split(parts[1], ',')[0]
+			endif
+			let option[parts[0]] = parts[1]
+			echo "Option:".parts[0]."=".parts[1]
+		endif
+	endfor
+	if dest != ''
+		let g:TagHighlightSettings['ScriptOptions'] += [option]
+	endif
+endfunction
+
+
+function! TagHighlight#RunPythonScript#GetPythonVersion()
+	" Assumes that python path is set correctly
+	if s:python_variant == 'if_pyth3'
+		py3 import sys
+		py3 vim.command('let g:taghl_getpythonversion = "{0}"'.format(sys.version))
+		let pyversion = g:taghl_getpythonversion
+		unlet g:taghl_getpythonversion
+	elseif s:python_variant == 'if_pyth'
+		py import sys
+		py vim.command('let g:taghl_getpythonversion = "%s"' % sys.version)
+		let pyversion = g:taghl_getpythonversion
+		unlet g:taghl_getpythonversion
+	elseif s:python_variant == 'python'
+		let syscmd = shellescape(s:python_path) . " --version"
+		let pyversion = system(syscmd)
+	elseif s:python_variant == 'compiled'
+		let syscmd = shellescape(s:highlighter_path) . " --pyversion"
+		let pyversion = system(syscmd)
+	else
+		let pyversion = 'ERROR'
+	endif
+	return pyversion
+endfunction
+
+function! TagHighlight#RunPythonScript#FindPython()
+	let s:python_variant = 'None'
+	let forced_variant = TagHighlight#Option#GetOption('ForcedPythonVariant', 'None')
+	" Supported variants
+	let supported_variants = ['if_pyth3', 'if_pyth', 'python', 'compiled']
+	" Priority of those variants (default is that specified above)
+	let variant_priority = TagHighlight#Option#GetOption('PythonVariantPriority',
+				\ supported_variants)
+
+	" Make sure that the user specified variant is supported
+	if index(supported_variants, forced_variant) == -1
+		let forced_variant = 'None'
+	endif
+
+	" Make sure that all variants in the priority list are supported
+	call filter(variant_priority, 'index(supported_variants, v:val) != -1')
+
+	" Try each variant in the priority list until we find one that works
+	for variant in variant_priority
+		if forced_variant == variant || forced_variant == 'None'
+			if variant == 'if_pyth3' && has('python3')
+				" Check whether the python 3 interface works
+				let g:taghl_findpython_testvar = 0
+				try
+					py3 import vim
+					py3 vim.command('let g:taghl_findpython_testvar = 1')
+					if g:taghl_findpython_testvar != 1
+						throw "Python doesn't seem to be working"
+					endif
+					unlet g:taghl_findpython_testvar
+					let s:python_variant = 'if_pyth3'
+					let s:python_cmd = ['py3']
+				endtry
+			elseif variant == 'if_pyth' && has('python')
+				" Check whether the python 2 interface works
+				let g:taghl_findpython_testvar = 0
+				try
+					py import vim
+					py vim.command('let g:taghl_findpython_testvar = 1')
+					if g:taghl_findpython_testvar != 1
+						throw "Python doesn't seem to be working"
+					endif
+					unlet g:taghl_findpython_testvar
+					let s:python_variant = 'if_pyth'
+					let s:python_cmd = ['py']
+				endtry
+			elseif variant == 'python'
+				" Try calling an external python
+				
+				" Has a specific path to python been set?
+				let python_path = TagHighlight#Option#GetOption('PathToPython', 'None')
+				if python_path != 'None' && executable(python_path)
+					" We've found python, it's probably usable
+					let s:python_variant = 'python'
+					let s:python_path = python_path
+					let s:python_cmd = [python_path, g:TagHighlightSettings['PluginPath'] . '/TagHighlight.py']
+				else
+					" See if it's in the path
+					let python_path = TagHighlight#RunPythonScript#FindExeInPath('python')
+					if python_path != 'None'
+						let s:python_variant = 'python'
+						let s:python_path = python_path
+						let s:python_cmd = [python_path, g:TagHighlightSettings['PluginPath'] . '/TagHighlight.py']
+					endif
+				endif
+			elseif variant == 'compiled'
+				" See if there's a compiled executable version of the
+				" highlighter
+				if has("win32")
+					let compiled_highlighter = split(globpath(&rtp, "plugin/TagHighlight/Compiled/Win32/TagHighlight.exe"), "\n")
+					if len(compiled_highlighter) > 0  && executable(compiled_highlighter[0])
+						let s:python_variant = 'compiled'
+						let s:python_cmd = [compiled_highlighter[0]]
+					endif
+				endif
+			endif
+		endif
+		
+		if s:python_variant != 'None'
+			" Found one!
+			break
+		endif
+	endfor
+
+	if s:python_variant != 'None'
+		" Consider checking that it's valid
+		if TagHighlight#Debug#GetDebugLevelName() == 'Information'
+			let pyversion = TagHighlight#RunPythonScript#GetPythonVersion()
+			call TagHighlight#Debug#Print("Python version reported as: " . pyversion,
+						\ 'Information')
+		endif
+	else
+		throw "Tag highlighter: could not find python or the compiled version of the highlighter."
+	endif
+
+	return s:python_variant
+endfunction
+

dist/ctags_highlighting.vba

-" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.
-UseVimball
-finish
-plugin/ctags_highlighting.vim	[[[1
-484
-" ctags_highlighting
-"   Author:  A. S. Budden
-"## Date::   6th May 2011            ##
-"## RevTag:: r461                    ##
-
-if &cp || exists("g:loaded_ctags_highlighting")
-	finish
-endif
-let g:loaded_ctags_highlighting = 1
-
-let s:CTagsHighlighterVersion = "## RevTag:: r461 ##"
-let s:CTagsHighlighterVersion = substitute(s:CTagsHighlighterVersion, '[#]\{2} RevTag[:]\{2} \(r\d\+\) *[#]\{2}', '\1', '')
-
-if !exists('g:VIMFILESDIR')
-	let g:VIMFILESDIR = fnamemodify(globpath(&rtp, 'mktypes.py'), ':p:h')
-endif
-
-let g:DBG_None        = 0
-let g:DBG_Critical    = 1
-let g:DBG_Error       = 2
-let g:DBG_Warning     = 3
-let g:DBG_Status      = 4
-let g:DBG_Information = 5
-
-if !exists('g:CTagsHighlighterDebug')
-	let g:CTagsHighlighterDebug = g:DBG_None
-endif
-
-func! s:GetOption(name, default)
-	let opt = a:default
-	if exists('g:' . a:name)
-		exe 'let opt = g:' . a:name
-	endif
-	if exists('b:' . a:name)
-		exe 'let opt = b:' . a:name
-	endif
-	return opt
-endfunction
-
-" These should only be included if editing a wx or qt file
-" They should also be updated to include all functions etc, not just
-" typedefs
-let g:wxTypesFile = escape(globpath(&rtp, "types_wx.vim"), '\,')
-let g:qtTypesFile = escape(globpath(&rtp, "types_qt4.vim"), '\,')
-let g:wxPyTypesFile = escape(globpath(&rtp, "types_wxpy.vim"), '\,')
-let g:jdkTypesFile = escape(globpath(&rtp, "types_jdk.vim"), '\,')
-let g:androidTypesFile = escape(globpath(&rtp, "types_android.vim"), '\,')
-
-" These should only be included if editing a wx or qt file
-let g:wxTagsFile = escape(globpath(&rtp, 'tags_wx'), ' \,')
-let g:qtTagsFile = escape(globpath(&rtp, 'tags_qt4'), ' \,')
-let g:wxPyTagsFile = escape(globpath(&rtp, 'tags_wxpy'), ' \,')
-
-" Update types & tags - called with a ! recurses
-command! -bang -bar UpdateTypesFile silent call UpdateTypesFile(<bang>0, 0) | 
-			\ let s:SavedTabNr = tabpagenr() |
-			\ let s:SavedWinNr = winnr() |
-			\ silent tabdo windo call ReadTypesAutoDetect() |
-			\ silent exe 'tabn ' . s:SavedTabNr |
-			\ silent exe s:SavedWinNr . "wincmd w"
-
-command! -bang -bar UpdateTypesFileOnly silent call UpdateTypesFile(<bang>0, 1) | 
-			\ let s:SavedTabNr = tabpagenr() |
-			\ let s:SavedWinNr = winnr() |
-			\ silent tabdo windo call ReadTypesAutoDetect() |
-			\ silent exe 'tabn ' . s:SavedTabNr |
-			\ silent exe s:SavedWinNr . "wincmd w"
-
-" load the types_*.vim highlighting file, if it exists
-autocmd BufRead,BufNewFile *.[ch]   call ReadTypes('c')
-autocmd BufRead,BufNewFile *.[ch]pp call ReadTypes('c')
-autocmd BufRead,BufNewFile *.p[lm]  call ReadTypes('pl')
-autocmd BufRead,BufNewFile *.java   call ReadTypes('java')
-autocmd BufRead,BufNewFile *.py     call ReadTypes('py')
-autocmd BufRead,BufNewFile *.pyw    call ReadTypes('py')
-autocmd BufRead,BufNewFile *.rb     call ReadTypes('ruby')
-autocmd BufRead,BufNewFile *.vhd*   call ReadTypes('vhdl')
-autocmd BufRead,BufNewFile *.php    call ReadTypes('php')
-autocmd BufRead,BufNewFile *.cs     call ReadTypes('cs')
-
-command! ReadTypes call ReadTypesAutoDetect()
-
-function! ReadTypesAutoDetect()
-	let extension = expand('%:e')
-	let extensionLookup = 
-				\ {
-				\     '\(c\|cc\|cpp\|h\|hpp\|cxx\|hxx\)' : "c",
-				\     'p[lm]'                            : "pl",
-				\     'java'                             : "java",
-				\     'pyw\?'                            : "py",
-				\     'rb'                               : "ruby",
-				\     'cs'                               : "cs",
-				\     'php'                              : "php",
-				\     'vhdl\?'                           : "vhdl",
-				\ }
-
-	call s:Debug_Print(g:DBG_Information, "Detecting types for extension '" . extension . "'")
-	for key in keys(extensionLookup)
-		let regex = '^' . key . '$'
-		if extension =~ regex
-			call s:Debug_Print(g:DBG_Information, "Loading types for extension '" . extensionLookup[key] . "'")
-			call ReadTypes(extensionLookup[key])
-			continue
-		endif
-	endfor
-endfunction
-
-function! ReadTypes(suffix)
-	let savedView = winsaveview()
-
-	let file = '<afile>'
-	if len(expand(file)) == 0
-		let file = '%'
-	endif
-
-	if exists('b:NoTypeParsing')
-		call s:Debug_Print(g:DBG_Information, "Type file parsing disabled")
-		return
-	endif
-	if exists('g:TypeParsingSkipList')
-		let basename = expand(file . ':p:t')
-		let fullname = expand(file . ':p')
-		if index(g:TypeParsingSkipList, basename) != -1
-			call s:Debug_Print(g:DBG_Information, "Skipping file due to basename match")
-			return
-		endif
-		if index(g:TypeParsingSkipList, fullname) != -1
-			call s:Debug_Print(g:DBG_Information, "Skipping file due to fullname match")
-			return
-		endif
-	endif
-	let fname = expand(file . ':p:h') . '/' . s:GetOption('TypesPrefix', 'types') . '_' . a:suffix . '.vim'
-	call s:Debug_Print(g:DBG_Information, "Checking for file " . fname)
-	if filereadable(fname)
-		call s:Debug_Print(g:DBG_Information, "Found")
-		exe 'so ' . fname
-	endif
-	let fname = expand(file . ':p:h:h') . '/' . s:GetOption('TypesPrefix', 'types') . '_' . a:suffix . '.vim'
-	call s:Debug_Print(g:DBG_Information, "Checking for file " . fname)
-	if filereadable(fname)
-		call s:Debug_Print(g:DBG_Information, "Found")
-		exe 'so ' . fname
-	endif
-	let fname = s:GetOption('TypesPrefix', 'types') . '_' . a:suffix . '.vim'
-	call s:Debug_Print(g:DBG_Information, "Checking for file " . fname)
-	if filereadable(fname)
-		call s:Debug_Print(g:DBG_Information, "Found")
-		exe 'so ' . fname
-	endif
-
-	" Open default source files
-	if index(['cc', 'cpp', 'h', 'hpp'], expand(file . ':e')) != -1
-		call s:Debug_Print(g:DBG_Information, 'C++ source file, checking for wx/Qt')
-		" This is a C++ source file
-		call cursor(1,1)
-		if search('^\s*#include\s\+<wx/', 'nc', 30)
-			call s:Debug_Print(g:DBG_Information, 'WxWidgets Source file - checking ' . g:wxTypesFile . '"')
-			if filereadable(g:wxTypesFile)
-				call s:Debug_Print(g:DBG_Information, 'Loading wx types')
-				execute 'so ' . g:wxTypesFile
-			endif
-			if filereadable(g:wxTagsFile)
-				execute 'setlocal tags+=' . g:wxTagsFile
-			endif
-		endif
-
-		call cursor(1,1)
-		if search('\c^\s*#include\s\+<q', 'nc', 30)
-			call s:Debug_Print(g:DBG_Information, 'Qt Source file - checking "' . g:qtTypesFile . '"')
-			if filereadable(g:qtTypesFile)
-				call s:Debug_Print(g:DBG_Information, 'Loading Qt4 types')
-				execute 'so ' . g:qtTypesFile
-			endif
-			if filereadable(g:qtTagsFile)
-				execute 'setlocal tags+=' . g:qtTagsFile
-			endif
-		else
-		endif
-	elseif index(['py', 'pyw'], expand(file . ':e')) != -1
-		" This is a python source file
-		call s:Debug_Print(g:DBG_Information, 'Python source file, checking for wx')
-
-		call cursor(1,1)
-		if search('^\s*import\s\+wx', 'nc', 30)
-			call s:Debug_Print(g:DBG_Information, 'wxPython Source file - checking "' . g:wxPyTypesFile . '"')
-			if filereadable(g:wxPyTypesFile)
-				call s:Debug_Print(g:DBG_Information, 'Loading wxpython types')
-				execute 'so ' . g:wxPyTypesFile
-			endif
-			if filereadable(g:wxPyTagsFile)
-				execute 'setlocal tags+=' . g:wxPyTagsFile
-			endif
-		endif
-	elseif index(['java',], expand(file . ':e')) != -1
-		" This is a java source file
-		call s:Debug_Print(g:DBG_Information, 'Java Source file - checking "' . g:jdkTypesFile . '"')
-		if filereadable(g:jdkTypesFile)
-			call s:Debug_Print(g:DBG_Information, 'Loading JDK types')
-			execute 'so ' . g:jdkTypesFile
-		endif
-		call cursor(1,1)
-		if search('^\s*import\s\+android\.', 'nc', 30)
-			call s:Debug_Print(g:DBG_Information, 'Android Source file - checking "' . g:androidTypesFile . '"')
-			if filereadable(g:androidTypesFile)
-				call s:Debug_Print(g:DBG_Information, 'Loading Android types')
-				execute 'so ' . g:androidTypesFile
-			endif
-		endif
-	endif
-
-	" Restore the view
-	call winrestview(savedView)
-endfunction
-
-func! s:Debug_Print(level, message)
-	if g:CTagsHighlighterDebug >= a:level
-		echomsg a:message
-	endif
-endfunc
-
-func! s:FindExePath(file)
-	if has("win32")
-		if a:file =~ '.exe$'
-			let short_file = fnamemodify(a:file, ':p:t')
-		else
-			let short_file = fnamemodify(a:file . '.exe', ':p:t')
-		endif
-		let path = substitute($PATH, '\\\?;', ',', 'g')
-
-		call s:Debug_Print(g:DBG_Status, "Looking for " . short_file . " in " . path)
-
-		let file_exe_list = split(globpath(path, short_file), '\n')
-		if len(file_exe_list) > 0
-			call s:Debug_Print(g:DBG_Status, "Success.")
-			let file_exe = file_exe_list[0]
-		else
-			call s:Debug_Print(g:DBG_Status, "Not found.")
-			let file_exe = ''
-		endif
-
-		" If file is not in the path, look for it in vimfiles/
-		if !filereadable(file_exe)
-			call s:Debug_Print(g:DBG_Status, "Looking for " . a:file . " in " . &rtp)
-			let file_exe_list = split(globpath(&rtp, a:file . '.exe'), '\n')
-			if len(file_exe_list) > 0
-				call s:Debug_Print(g:DBG_Status, "Success.")
-				let file_exe = file_exe_list[0]
-			else
-				call s:Debug_Print(g:DBG_Status, "Not found.")
-			endif
-		endif
-
-		if filereadable(file_exe)
-			call s:Debug_Print(g:DBG_Status, "Success.")
-			let file_path = shellescape(fnamemodify(file_exe, ':p:h'))
-		else
-			call s:Debug_Print(g:DBG_Critical, "Could not find " . short_file)
-			throw "Cannot find file " . short_file
-		endif
-	else
-		let path = substitute($PATH, ':', ',', 'g')
-		if has("win32unix")
-			let short_file = fnamemodify(a:file . '.exe', ':p:t')
-		else
-			let short_file = fnamemodify(a:file, ':p:t')
-		endif
-
-		call s:Debug_Print(g:DBG_Status, "Looking for " . short_file . " in " . path)
-
-		let file_exe_list = split(globpath(path, short_file), '\n')
-
-		if len(file_exe_list) > 0
-			call s:Debug_Print(g:DBG_Status, "Success.")
-			let file_exe = file_exe_list[0]
-		else
-			call s:Debug_Print(g:DBG_Status, "Not found.")
-			let file_exe = ''
-		endif
-
-		if filereadable(file_exe)
-			call s:Debug_Print(g:DBG_Status, "Success.")
-			let file_path = fnamemodify(file_exe, ':p:h')
-		else
-			call s:Debug_Print(g:DBG_Critical, "Could not find " . short_file)
-			throw "Cannot find file " . short_file
-		endif
-	endif
-
-	let file_path = substitute(file_path, '\\', '/', 'g')
-
-	return file_path
-endfunc
-
-func! UpdateTypesFile(recurse, skiptags)
-	let s:vrc = globpath(&rtp, "mktypes.py")
-
-	call s:Debug_Print(g:DBG_Status, "Starting UpdateTypesFile revision " . s:CTagsHighlighterVersion)
-
-	if type(s:vrc) == type("")
-		let mktypes_py_file = s:vrc
-	elseif type(s:vrc) == type([])
-		let mktypes_py_file = s:vrc[0]
-	endif
-
-	let sysroot = 'python ' . shellescape(mktypes_py_file)
-	let syscmd = ''
-
-	let ctags_option = s:GetOption('TypesFileCtagsExecutable', '')
-	if ctags_option == ''
-		" Option not set: search for 'ctags' in the path
-		let ctags_path = s:FindExePath('ctags')
-		let syscmd .= ' --ctags-dir=' . ctags_path
-	elseif ctags_option =~ '[\\/]'
-		" Option set and includes '/' or '\': must be explicit
-		" path to named executable: just pass to mktypes
-		let syscmd .= ' --ctags-executable=' . ctags_option
-	else
-		" Option set but doesn't include path separator: search
-		" in the path
-		let ctags_path = s:FindExePath(ctags_option)
-		let syscmd .= ' --ctags-path=' . ctags_path
-		let syscmd .= ' --ctags-executable=' . ctags_option
-	endif
-	
-	if exists('b:TypesFileRecurse')
-		if b:TypesFileRecurse == 1
-			let syscmd .= ' -r'
-		endif
-	else
-		if a:recurse == 1
-			let syscmd .= ' -r'
-		endif
-	endif
-
-	if exists('b:TypesFileLanguages')
-		for lang in b:TypesFileLanguages
-			let syscmd .= ' --include-language=' . lang
-		endfor
-	endif
-
-	let TypesFileIncludeSynMatches = s:GetOption('TypesFileIncludeSynMatches', 0)
-	if TypesFileIncludeSynMatches == 1
-		let syscmd .= ' --include-invalid-keywords-as-matches'
-	endif
-
-	let TypeFileSkipVimKeywords = s:GetOption('TypesFileSkipVimKeywords', 0)
-	if TypeFileSkipVimKeywords == 1
-		let syscmd .= ' --exclude-vim-keywords'
-	endif
-
-	let TypesFileIncludeLocals = s:GetOption('TypesFileIncludeLocals', 1)
-	if TypesFileIncludeLocals == 1
-		let syscmd .= ' --include-locals'
-	endif
-
-	let TypesFileDoNotGenerateTags = s:GetOption('TypesFileDoNotGenerateTags', 0)
-	if TypesFileDoNotGenerateTags == 1
-		let syscmd .= ' --use-existing-tagfile'
-	elseif a:skiptags == 1
-		let syscmd .= ' --use-existing-tagfile'
-	endif
-
-	let syscmd .= ' --ctags-file ' . s:GetOption('TypesCTagsFile', 'tags')
-	let syscmd .= ' --types-prefix ' . s:GetOption('TypesPrefix', 'types')
-
-	let CheckForCScopeFiles = s:GetOption('CheckForCScopeFiles', 0)
-	if CheckForCScopeFiles == 1
-		if cscope_connection()
-			" Kill all existing cscope connections so that the database can be
-			" rebuilt.  Because we run cscope in the background (from python)
-			" we can't just re-add the cscope database as it might not have
-			" finished yet.  Otherwise, we'd parse the output of 'cs show'
-			" and re-add the database at the end of the function.
-			cs kill -1
-		endif
-		let syscmd .= ' --build-cscopedb-if-cscope-file-exists'
-		let syscmd .= ' --cscope-dir=' 
-		let cscope_path = s:FindExePath('extra_source/cscope_win/cscope')
-		let syscmd .= cscope_path
-	endif
-
-	let sysoutput = system(sysroot . syscmd) 
-	echo sysroot . syscmd
-	if sysoutput =~ 'python.*is not recognized as an internal or external command'
-		let sysroot = g:VIMFILESDIR . '/extra_source/mktypes/dist/mktypes.exe'
-		let sysoutput = sysoutput . "\nUsing compiled mktypes\n" . system(sysroot . syscmd)
-	endif
-
-	echo sysoutput
-
-	if g:CTagsHighlighterDebug >= g:DBG_None
-		echomsg sysoutput
-		messages
-	endif
-
-	" There should be a try catch endtry
-	" above, with the fall-back using the
-	" exe on windows or the full system('python') etc
-	" on Linux
-
-endfunc
-
-let tagnames = 
-			\ [
-			\ 		'CTagsAnchor',
-			\ 		'CTagsAutoCommand',
-			\ 		'CTagsBlockData',
-			\ 		'CTagsClass',
-			\ 		'CTagsCommand',
-			\ 		'CTagsCommonBlocks',
-			\ 		'CTagsComponent',
-			\ 		'CTagsConstant',
-			\ 		'CTagsCursor',
-			\ 		'CTagsData',
-			\ 		'CTagsDefinedName',
-			\ 		'CTagsDomain',
-			\ 		'CTagsEntity',
-			\ 		'CTagsEntryPoint',
-			\ 		'CTagsEnumeration',
-			\ 		'CTagsEnumerationName',
-			\ 		'CTagsEnumerationValue',
-			\ 		'CTagsEnumerator',
-			\ 		'CTagsEnumeratorName',
-			\ 		'CTagsEvent',
-			\ 		'CTagsException',
-			\ 		'CTagsExtern',
-			\ 		'CTagsFeature',
-			\ 		'CTagsField',
-			\ 		'CTagsFileDescription',
-			\ 		'CTagsFormat',
-			\ 		'CTagsFragment',
-			\ 		'CTagsFunction',
-			\ 		'CTagsFunctionObject',
-			\ 		'CTagsGlobalConstant',
-			\ 		'CTagsGlobalVariable',
-			\ 		'CTagsGroupItem',
-			\ 		'CTagsIndex',
-			\ 		'CTagsInterface',
-			\ 		'CTagsInterfaceComponent',
-			\ 		'CTagsLabel',
-			\ 		'CTagsLocalVariable',
-			\ 		'CTagsMacro',
-			\ 		'CTagsMap',
-			\ 		'CTagsMember',
-			\ 		'CTagsMethod',
-			\ 		'CTagsModule',
-			\ 		'CTagsNamelist',
-			\ 		'CTagsNamespace',
-			\ 		'CTagsNetType',
-			\ 		'CTagsPackage',
-			\ 		'CTagsParagraph',
-			\ 		'CTagsPattern',
-			\ 		'CTagsPort',
-			\ 		'CTagsProgram',
-			\ 		'CTagsProperty',
-			\ 		'CTagsPrototype',
-			\ 		'CTagsPublication',
-			\ 		'CTagsRecord',
-			\ 		'CTagsRegisterType',
-			\ 		'CTagsSection',
-			\ 		'CTagsService',
-			\ 		'CTagsSet',
-			\ 		'CTagsSignature',
-			\ 		'CTagsSingleton',
-			\ 		'CTagsSlot',
-			\ 		'CTagsStructure',
-			\ 		'CTagsSubroutine',
-			\ 		'CTagsSynonym',
-			\ 		'CTagsTable',
-			\ 		'CTagsTask',
-			\ 		'CTagsTrigger',
-			\ 		'CTagsType',
-			\ 		'CTagsTypeComponent',
-			\ 		'CTagsUnion',
-			\ 		'CTagsVariable',
-			\ 		'CTagsView',
-			\ 		'CTagsVirtualPattern',
-			\ ]
-
-for tagname in tagnames
-	let simplename = substitute(tagname, '^CTags', '', '')
-	exe 'hi default link' tagname simplename
-	exe 'hi default link' simplename 'Keyword'
-endfor
-mktypes.py	[[[1
-893
-#!/usr/bin/env python
-#  Author:  A. S. Budden
-## Date::   6th May 2011         ##
-## RevTag:: r461                 ##
-
-import os
-import sys
-import optparse
-import re
-import fnmatch
-import glob
-import subprocess
-
-revision = "## RevTag:: r461 ##".strip('# ').replace('RevTag::', 'revision')
-
-field_processor = re.compile(
-r'''
-	^                 # Start of the line
-	(?P<keyword>.*?)  # Capture the first field: everything up to the first tab
-	\t                # Field separator: a tab character
-	.*?               # Second field (uncaptured): everything up to the next tab
-	\t                # Field separator: a tab character
-	(?P<search>.*?)   # Any character at all, but as few as necessary (i.e. catch everything up to the ;")
-	;"                # The end of the search specifier (see http://ctags.sourceforge.net/FORMAT)
-	(?=\t)            # There MUST be a tab character after the ;", but we want to match it with zero width
-	.*\t              # There can be other fields before "kind", so catch them here.
-	                  # Also catch the tab character from the previous line as there MUST be a tab before the field
-	(kind:)?          # This is the "kind" field; "kind:" is optional
-	(?P<kind>\w)      # The kind is a single character: catch it
-	(\t|$)            # It must be followed either by a tab or by the end of the line
-	.*                # If it is followed by a tab, soak up the rest of the line; replace with the syntax keyword line
-''', re.VERBOSE)
-
-field_keyword = re.compile(r'syntax keyword (?P<kind>CTags\w+) (?P<keyword>.*)')
-field_const = re.compile(r'\bconst\b')
-
-vim_synkeyword_arguments = [
-		'contains',
-		'oneline',
-		'fold',
-		'display',
-		'extend',
-		'contained',
-		'containedin',
-		'nextgroup',
-		'transparent',
-		'skipwhite',
-		'skipnl',
-		'skipempty'
-		]
-
-ctags_exe = 'ctags'
-cscope_exe = 'cscope'
-
-# Used for timing a function; from http://www.daniweb.com/code/snippet368.html
-import time
-def print_timing(func):
-	def wrapper(*arg):
-		t1 = time.time()
-		res = func(*arg)
-		t2 = time.time()
-		print '%s took %0.3f ms' % (func.func_name, (t2-t1)*1000.0)
-		return res
-	return wrapper
-
-def GetCommandArgs(options):
-	Configuration = {}
-	Configuration['CTAGS_OPTIONS'] = ''
-
-	if options.ctags_file:
-		Configuration['CTAGS_OPTIONS'] += ' -f %s ' % options.ctags_file
-
-	if options.recurse:
-		Configuration['CTAGS_OPTIONS'] += '--recurse'
-		if options.include_locals:
-			Configuration['CTAGS_OPTIONS'] += ' --c-kinds=+l'
-			Configuration['CTAGS_OPTIONS'] += ' --java-kinds=+l'
-			Configuration['CTAGS_OPTIONS'] += ' --c++-kinds=+l'
-			Configuration['CTAGS_OPTIONS'] += ' --c#-kinds=+l'
-			Configuration['CTAGS_OPTIONS'] += ' --java-kinds=+l'
-		Configuration['CTAGS_FILES'] = ['.']
-	else:
-		if options.include_locals:
-			Configuration['CTAGS_OPTIONS'] = '--c-kinds=+l'
-		Configuration['CTAGS_FILES'] = glob.glob('*')
-	if not options.include_docs:
-		Configuration['CTAGS_OPTIONS'] += r" --exclude=docs --exclude=Documentation"
-	return Configuration
-
-key_regexp = re.compile('^(?P<keyword>.*?)\t(?P<remainder>.*\t(?P<kind>[a-zA-Z])(?:\t|$).*)')
-
-def ctags_key(ctags_line):
-	match = key_regexp.match(ctags_line)
-	if match is None:
-		return ctags_line
-	return match.group('keyword') + match.group('kind') + match.group('remainder')
-
-def CreateCScopeFile(options):
-	cscope_options = '-b'
-	run_cscope = False
-
-	if options.build_cscopedb:
-		run_cscope = True
-
-	if os.path.exists('cscope.files'):
-		if options.build_cscopedb_if_file_exists:
-			run_cscope = True
-	else:
-		cscope_options += 'R'
-
-	if run_cscope:
-		print "Spawning cscope"
-		os.spawnl(os.P_NOWAIT, cscope_exe, 'cscope', cscope_options)
-
-#@print_timing
-def CreateTagsFile(config, languages, options):
-	print "Generating Tags"
-
-	ctags_languages = languages[:]
-	if 'c' in ctags_languages:
-		ctags_languages.append('c++')
-
-	ctags_cmd = '%s %s %s %s' % (ctags_exe, config['CTAGS_OPTIONS'], "--languages=" + ",".join(ctags_languages), " ".join(config['CTAGS_FILES']))
-
-#	fh = open('ctags_cmd.txt', 'w')
-#	fh.write(ctags_cmd)
-#	fh.write('\n')
-#	fh.close()
-
-	#os.system(ctags_cmd)
-	subprocess.call(ctags_cmd, shell = (os.name != 'nt'))
-
-	tagFile = open(options.ctags_file, 'r')
-	tagLines = [line.strip() for line in tagFile]
-	tagFile.close()
-
-	# Also sort the file a bit better (tag, then kind, then filename)
-	tagLines.sort(key=ctags_key)
-
-	tagFile = open(options.ctags_file, 'w')
-	for line in tagLines:
-		tagFile.write(line + "\n")
-	tagFile.close()
-
-def GetLanguageParameters(lang):
-	params = {}
-	# Default value for iskeyword
-	params['iskeyword'] = '@,48-57,_,192-255'
-	if lang == 'c':
-		params['suffix'] = 'c'
-		params['name'] = 'c'
-		params['extensions'] = r'(c|cc|cpp|h|hpp|cxx|hxx)'
-	elif lang == 'python':
-		params['suffix'] = 'py'
-		params['name'] = 'python'
-		params['extensions'] = r'pyw?'
-	elif lang == 'ruby':
-		params['suffix'] = 'ruby'
-		params['name'] = 'ruby'
-		params['extensions'] = 'rb'
-	elif lang == 'java':
-		params['suffix'] = 'java'
-		params['name'] = 'java'
-		params['extensions'] = 'java'
-	elif lang == 'perl':
-		params['suffix'] = 'pl'
-		params['name'] = 'perl'
-		params['extensions'] = r'p[lm]'
-	elif lang == 'vhdl':
-		params['suffix'] = 'vhdl'
-		params['name'] = 'vhdl'
-		params['extensions'] = r'vhdl?'
-	elif lang == 'php':
-		params['suffix'] = 'php'
-		params['name'] = 'php'
-		params['extensions'] = r'php'
-	elif lang == 'c#':
-		params['suffix'] = 'cs'
-		params['name'] = 'c#'
-		params['extensions'] = 'cs'
-	else:
-		raise AttributeError('Language not recognised %s' % lang)
-	return params
-
-def GenerateValidKeywordRange(iskeyword):
-	ValidKeywordSets = iskeyword.split(',')
-	rangeMatcher = re.compile('^(?P<from>(?:\d+|\S))-(?P<to>(?:\d+|\S))$')
-	falseRangeMatcher = re.compile('^^(?P<from>(?:\d+|\S))-(?P<to>(?:\d+|\S))$')
-	validList = []
-	for valid in ValidKeywordSets:
-		m = rangeMatcher.match(valid)
-		fm = falseRangeMatcher.match(valid)
-		if valid == '@':
-			for ch in [chr(i) for i in range(0,256)]:
-				if ch.isalpha():
-					validList.append(ch)
-		elif m is not None:
-			# We have a range of ascii values
-			if m.group('from').isdigit():
-				rangeFrom = int(m.group('from'))
-			else:
-				rangeFrom = ord(m.group('from'))
-
-			if m.group('to').isdigit():
-				rangeTo = int(m.group('to'))
-			else:
-				rangeTo = ord(m.group('to'))
-
-			validRange = range(rangeFrom, rangeTo+1)
-			for ch in [chr(i) for i in validRange]:
-				validList.append(ch)
-
-		elif fm is not None:
-			# We have a range of ascii values: remove them!
-			if fm.group('from').isdigit():
-				rangeFrom = int(fm.group('from'))
-			else:
-				rangeFrom = ord(fm.group('from'))
-
-			if fm.group('to').isdigit():
-				rangeTo = int(fm.group('to'))
-			else:
-				rangeTo = ord(fm.group('to'))
-
-			validRange = range(rangeFrom, rangeTo+1)
-			for ch in [chr(i) for i in validRange]:
-				for i in range(validList.count(ch)):
-					validList.remove(ch)
-
-		elif len(valid) == 1:
-			# Just a char
-			validList.append(valid)
-
-		else:
-			raise ValueError('Unrecognised iskeyword part: ' + valid)
-
-	return validList
-
-
-def IsValidKeyword(keyword, iskeyword):
-	for char in keyword:
-		if not char in iskeyword:
-			return False
-	return True
-
-#@print_timing
-def CreateTypesFile(config, Parameters, options):
-	outfile = '%s_%s.vim' % (options.types_prefix, Parameters['suffix'])
-	print "Generating " + outfile
-	lineMatcher = re.compile(r'^.*?\t[^\t]*\.(?P<extension>' + Parameters['extensions'] + ')\t')
-
-	#p = os.popen(ctags_cmd, "r")
-	p = open(options.ctags_file, "r")
-
-	if options.include_locals:
-		LocalTagType = ',CTagsLocalVariable'
-	else:
-		LocalTagType = ''
-
-	KindList = GetKindList()[Parameters['name']]
-	ctags_entries = []
-	while 1:
-		line = p.readline()
-		if not line:
-			break
-
-		if not lineMatcher.match(line):
-			continue
-
-		m = field_processor.match(line.strip())
-		if m is not None:
-			try:
-				vimmed_line = 'syntax keyword ' + KindList['ctags_' + m.group('kind')] + ' ' + m.group('keyword')
-
-				if options.parse_constants and (Parameters['suffix'] == 'c') and (m.group('kind') == 'v'):
-					if field_const.search(m.group('search')) is not None:
-						vimmed_line = vimmed_line.replace('CTagsGlobalVariable', 'CTagsConstant')
-
-				if Parameters['suffix'] != 'c' or m.group('kind') != 'p':
-					ctags_entries.append(vimmed_line)
-			except KeyError:
-				ctags_entries.append('''" Skipping unrecognised kind '%c' ''' % (m.group('kind'),))
-
-	p.close()
-
-	# Essentially a uniq() function
-	ctags_entries = dict.fromkeys(ctags_entries).keys()
-	# Sort the list
-	ctags_entries.sort()
-
-	if len(ctags_entries) == 0:
-		print "No tags found"
-		return
-
-	keywordDict = {}
-	for line in ctags_entries:
-		m = field_keyword.match(line)
-		if m is not None:
-			if not keywordDict.has_key(m.group('kind')):
-				keywordDict[m.group('kind')] = []
-			keywordDict[m.group('kind')].append(m.group('keyword'))
-
-	if options.check_keywords:
-		iskeyword = GenerateValidKeywordRange(Parameters['iskeyword'])
-	
-	matchEntries = []
-	vimtypes_entries = []
-
-	clear_string = 'silent! syn clear '
-
-	patternCharacters = "/@#':"
-	charactersToEscape = '\\' + '~[]*.$^'
-
-	if not options.include_locals:
-		remove_list = []
-		for key, value in KindList.iteritems():
-			if value == 'CTagsLocalVariable':
-				remove_list.append(key)
-		for key in remove_list:
-			try:
-				del(KindList[key])
-			except KeyError:
-				pass
-
-	UsedTypes = KindList.values()
-
-	clear_string += " ".join(UsedTypes)
-
-	vimtypes_entries.append(clear_string)
-
-
-	# Specified highest priority first
-	Priority = [
-			'CTagsNamespace', 'CTagsClass', 'CTagsDefinedName',
-			'CTagsType', 'CTagsMethod', 'CTagsFunction',
-			'CTagsEnumerationValue', 'CTagsEnumeratorName',
-			'CTagsConstant', 'CTagsGlobalVariable',
-			'CTagsUnion', 'CTagsProperty', 'CTagsMember',
-			'CTagsStructure',
-			]
-
-	# Reverse the list as highest priority should be last!
-	Priority.reverse()
-
-	typeList = sorted(keywordDict.keys())
-
-	# Reorder type list according to sort order
-	allTypes = []
-	for thisType in Priority:
-		if thisType in typeList:
-			allTypes.append(thisType)
-			typeList.remove(thisType)
-	for thisType in typeList:
-		allTypes.append(thisType)
-	#print allTypes
-
-	for thisType in allTypes:
-		if thisType not in UsedTypes:
-			continue
-
-		keystarter = 'syntax keyword ' + thisType
-		keycommand = keystarter
-		for keyword in keywordDict[thisType]:
-			if options.check_keywords:
-				# In here we should check that the keyword only matches
-				# vim's \k parameter (which will be different for different
-				# languages).  This is quite slow so is turned off by
-				# default; however, it is useful for some things where the
-				# default generated file contains a lot of rubbish.  It may
-				# be worth optimising IsValidKeyword at some point.
-				if not IsValidKeyword(keyword, iskeyword):
-					matchDone = False
-
-					for patChar in patternCharacters:
-						if keyword.find(patChar) == -1:
-							escapedKeyword = keyword
-							for ch in charactersToEscape:
-								escapedKeyword = escapedKeyword.replace(ch, '\\' + ch)
-							if not options.skip_matches:
-								matchEntries.append('syntax match ' + thisType + ' ' + patChar + escapedKeyword + patChar)
-							matchDone = True
-							break
-
-					if not matchDone:
-						print "Skipping keyword '" + keyword + "'"
-
-					continue
-
-
-			if keyword.lower() in vim_synkeyword_arguments:
-				if not options.skip_vimkeywords:
-					matchEntries.append('syntax match ' + thisType + ' /' + keyword + '/')
-				continue
-
-			temp = keycommand + " " + keyword
-			if len(temp) >= 512:
-				vimtypes_entries.append(keycommand)
-				keycommand = keystarter
-			keycommand = keycommand + " " + keyword
-		if keycommand != keystarter:
-			vimtypes_entries.append(keycommand)
-
-	# Essentially a uniq() function
-	matchEntries = dict.fromkeys(matchEntries).keys()
-	# Sort the list
-	matchEntries.sort()
-
-	vimtypes_entries.append('')
-	for thisMatch in matchEntries:
-		vimtypes_entries.append(thisMatch)
-
-	AddList = 'add='
-
-	for thisType in allTypes:
-		if thisType in UsedTypes:
-			if AddList != 'add=':
-				AddList += ','
-			AddList += thisType;
-
-	if Parameters['suffix'] in ['c',]:
-		vimtypes_entries.append('')
-		vimtypes_entries.append("if exists('b:hlrainbow') && !exists('g:nohlrainbow')")
-		vimtypes_entries.append('\tsyn cluster cBracketGroup ' + AddList + LocalTagType)
-		vimtypes_entries.append('\tsyn cluster cCppBracketGroup ' + AddList + LocalTagType)
-		vimtypes_entries.append('\tsyn cluster cCurlyGroup ' + AddList + LocalTagType)
-		vimtypes_entries.append('\tsyn cluster cParenGroup ' + AddList + LocalTagType)
-		vimtypes_entries.append('\tsyn cluster cCppParenGroup ' + AddList + LocalTagType)
-		vimtypes_entries.append('endif')
-
-	if Parameters['suffix'] in ['java',]:
-		vimtypes_entries.append('')
-		vimtypes_entries.append('syn cluster javaTop ' + AddList + LocalTagType)
-
-	try:
-		fh = open(outfile, 'wb')
-	except IOError:
-		sys.stderr.write("ERROR: Couldn't create %s\n" % (outfile))
-		sys.exit(1)
-	
-	try:
-		for line in vimtypes_entries:
-			fh.write(line)
-			fh.write('\n')
-	except IOError:
-		sys.stderr.write("ERROR: Couldn't write %s contents\n" % (outfile))
-		sys.exit(1)
-	finally:
-		fh.close()
-
-def main():
-	import optparse
-	parser = optparse.OptionParser(version=("Types File Creator (%%prog) %s" % revision))
-	parser.add_option('-r','-R','--recurse',
-			action="store_true",
-			default=False,
-			dest="recurse",
-			help="Recurse into subdirectories")
-	parser.add_option('--ctags-file',
-			action='store',
-			default='tags',
-			dest='ctags_file',
-			help='CTAGS output filename')
-	parser.add_option('--types-prefix',
-			action='store',
-			default='types',
-			dest='types_prefix',
-			help='Vim Types file prefix')
-	parser.add_option('--ctags-dir',
-			action='store',
-			default=None,
-			dest='ctags_dir',
-			type='string',
-			help='CTAGS Executable Directory')
-	parser.add_option('--ctags-executable',
-			action='store',
-			default='ctags',
-			dest='ctags_executable',
-			type='string',
-			help='Name of the CTAGS executable, with or without a full path')
-	parser.add_option('--include-docs',
-			action='store_true',
-			default=False,
-			dest='include_docs',
-			help='Include docs or Documentation directory (stripped by default for speed)')
-	parser.add_option('--do-not-check-keywords',
-			action='store_false',
-			default=True,
-			dest='check_keywords',
-			help="Do not check validity of keywords (for speed)")
-	parser.add_option('--include-invalid-keywords-as-matches',
-			action='store_false',
-			default=True,
-			dest='skip_matches',
-			help='Include invalid keywords as regular expression matches (may slow it loading)')
-	parser.add_option('--exclude-vim-keywords',
-			action='store_true',
-			default=False,
-			dest='skip_vimkeywords',
-			help="Don't include Vim keywords (they have to be matched with regular expression matches, which is slower)")
-	parser.add_option('--do-not-analyse-constants',
-			action='store_false',
-			default=True,
-			dest='parse_constants',
-			help="Do not treat constants as separate entries")
-	parser.add_option('--include-language',
-			action='append',
-			dest='languages',
-			type='string',
-			default=[],
-			help='Only include specified languages')
-	parser.add_option('--build-cscopedb',
-			action='store_true',
-			default=False,
-			dest='build_cscopedb',
-			help="Also build a cscope database")
-	parser.add_option('--build-cscopedb-if-cscope-file-exists',
-			action='store_true',
-			default=False,
-			dest='build_cscopedb_if_file_exists',
-			help="Also build a cscope database if cscope.files exists")
-	parser.add_option('--cscope-dir',
-			action='store',
-			default=None,
-			dest='cscope_dir',
-			type='string',
-			help='CSCOPE Executable Directory')
-	parser.add_option('--include-locals',
-			action='store_true',
-			default=False,
-			dest='include_locals',
-			help='Include local variables in the database')
-	parser.add_option('--use-existing-tagfile',
-			action='store_true',
-			default=False,
-			dest='use_existing_tagfile',
-			help="Do not generate tags if a tag file already exists")
-
-	options, remainder = parser.parse_args()
-
-	global ctags_exe
-	if '/' in options.ctags_executable:
-		ctags_exe = options.ctags_executable
-	elif options.ctags_dir is not None:
-		ctags_exe = os.path.join(options.ctags_dir, options.ctags_executable)
-	else:
-		ctags_exe = options.ctags_executable
-
-
-	if options.cscope_dir is not None:
-		global cscope_exe
-		cscope_exe = options.cscope_dir + '/' + 'cscope'
-
-	Configuration = GetCommandArgs(options)
-
-	CreateCScopeFile(options)
-
-	full_language_list = ['c', 'java', 'perl', 'python', 'ruby', 'vhdl', 'php', 'c#']
-	if len(options.languages) == 0:
-		# Include all languages
-		language_list = full_language_list
-	else:
-		language_list = [i for i in full_language_list if i in options.languages]
-
-	if options.use_existing_tagfile and not os.path.exists(options.ctags_file):
-		options.use_existing_tagfile = False
-
-	if not options.use_existing_tagfile:
-		CreateTagsFile(Configuration, language_list, options)
-
-	for language in language_list:
-		Parameters = GetLanguageParameters(language)
-		CreateTypesFile(Configuration, Parameters, options)
-
-def GetKindList():
-	LanguageKinds = {}
-	LanguageKinds['asm'] = \
-	{
-		'ctags_d': 'CTagsDefinedName',
-		'ctags_l': 'CTagsLabel',
-		'ctags_m': 'CTagsMacro',
-		'ctags_t': 'CTagsType',
-	}
-	LanguageKinds['asp'] = \
-	{
-		'ctags_c': 'CTagsConstant',
-		'ctags_f': 'CTagsFunction',
-		'ctags_s': 'CTagsSubroutine',
-		'ctags_v': 'CTagsVariable',
-	}
-	LanguageKinds['awk'] = \
-	{
-		'ctags_f': 'CTagsFunction',
-	}
-	LanguageKinds['basic'] = \
-	{
-		'ctags_c': 'CTagsConstant',
-		'ctags_f': 'CTagsFunction',
-		'ctags_l': 'CTagsLabel',
-		'ctags_t': 'CTagsType',
-		'ctags_v': 'CTagsVariable',
-		'ctags_g': 'CTagsEnumeration',
-	}
-	LanguageKinds['beta'] = \
-	{
-		'ctags_f': 'CTagsFragment',
-		'ctags_p': 'CTagsPattern',
-		'ctags_s': 'CTagsSlot',
-		'ctags_v': 'CTagsVirtualPattern',
-	}
-	LanguageKinds['c'] = \
-	{
-		'ctags_c': 'CTagsClass',
-		'ctags_d': 'CTagsDefinedName',
-		'ctags_e': 'CTagsEnumerationValue',
-		'ctags_f': 'CTagsFunction',
-		'ctags_g': 'CTagsEnumeratorName',
-		'ctags_k': 'CTagsConstant',
-		'ctags_l': 'CTagsLocalVariable',
-		'ctags_m': 'CTagsMember',
-		'ctags_n': 'CTagsNamespace',
-		'ctags_p': 'CTagsFunction',
-		'ctags_s': 'CTagsStructure',
-		'ctags_t': 'CTagsType',
-		'ctags_u': 'CTagsUnion',
-		'ctags_v': 'CTagsGlobalVariable',
-		'ctags_x': 'CTagsExtern',
-		'ctags_F': 'CTagsFile',
-	}
-	LanguageKinds['c++'] = \
-	{
-		'ctags_c': 'CTagsClass',
-		'ctags_d': 'CTagsDefinedName',
-		'ctags_e': 'CTagsEnumerationValue',
-		'ctags_f': 'CTagsFunction',
-		'ctags_g': 'CTagsEnumerationName',
-		'ctags_k': 'CTagsConstant',
-		'ctags_l': 'CTagsLocalVariable',
-		'ctags_m': 'CTagsMember',
-		'ctags_n': 'CTagsNamespace',
-		'ctags_p': 'CTagsFunction',
-		'ctags_s': 'CTagsStructure',
-		'ctags_t': 'CTagsType',
-		'ctags_u': 'CTagsUnion',
-		'ctags_v': 'CTagsGlobalVariable',
-		'ctags_x': 'CTagsExtern',
-		'ctags_F': 'CTagsFile',
-	}
-	LanguageKinds['c#'] = \
-	{
-		'ctags_c': 'CTagsClass',
-		'ctags_d': 'CTagsDefinedName',
-		'ctags_e': 'CTagsEnumerationValue',
-		'ctags_E': 'CTagsEvent',
-		'ctags_f': 'CTagsField',
-		'ctags_g': 'CTagsEnumerationName',
-		'ctags_i': 'CTagsInterface',
-		'ctags_l': 'CTagsLocalVariable',
-		'ctags_m': 'CTagsMethod',
-		'ctags_n': 'CTagsNamespace',
-		'ctags_p': 'CTagsProperty',
-		'ctags_s': 'CTagsStructure',
-		'ctags_t': 'CTagsType',
-	}
-	LanguageKinds['cobol'] = \
-	{
-		'ctags_d': 'CTagsData',
-		'ctags_f': 'CTagsFileDescription',
-		'ctags_g': 'CTagsGroupItem',
-		'ctags_p': 'CTagsParagraph',
-		'ctags_P': 'CTagsProgram',
-		'ctags_s': 'CTagsSection',
-	}
-	LanguageKinds['eiffel'] = \
-	{
-		'ctags_c': 'CTagsClass',
-		'ctags_f': 'CTagsFeature',
-		'ctags_l': 'CTagsEntity',
-	}
-	LanguageKinds['erlang'] = \
-	{
-		'ctags_d': 'CTagsDefinedName',
-		'ctags_f': 'CTagsFunction',
-		'ctags_m': 'CTagsModule',
-		'ctags_r': 'CTagsRecord',
-	}
-	LanguageKinds['fortran'] = \
-	{
-		'ctags_b': 'CTagsBlockData',
-		'ctags_c': 'CTagsCommonBlocks',
-		'ctags_e': 'CTagsEntryPoint',
-		'ctags_f': 'CTagsFunction',
-		'ctags_i': 'CTagsInterfaceComponent',
-		'ctags_k': 'CTagsTypeComponent',
-		'ctags_l': 'CTagsLabel',
-		'ctags_L': 'CTagsLocalVariable',
-		'ctags_m': 'CTagsModule',
-		'ctags_n': 'CTagsNamelist',
-		'ctags_p': 'CTagsProgram',
-		'ctags_s': 'CTagsSubroutine',
-		'ctags_t': 'CTagsType',
-		'ctags_v': 'CTagsGlobalVariable',
-	}
-	LanguageKinds['html'] = \
-	{
-		'ctags_a': 'CTagsAnchor',
-		'ctags_f': 'CTagsFunction',
-	}
-	LanguageKinds['java'] = \
-	{
-		'ctags_c': 'CTagsClass',
-		'ctags_e': 'CTagsEnumerationValue',
-		'ctags_f': 'CTagsField',
-		'ctags_g': 'CTagsEnumeratorName',
-		'ctags_i': 'CTagsInterface',
-		'ctags_l': 'CTagsLocalVariable',
-		'ctags_m': 'CTagsMethod',
-		'ctags_p': 'CTagsPackage',
-	}
-	LanguageKinds['javascript'] = \
-	{
-		'ctags_f': 'CTagsFunction',
-		'ctags_c': 'CTagsClass',
-		'ctags_m': 'CTagsMethod',
-		'ctags_p': 'CTagsProperty',
-		'ctags_v': 'CTagsGlobalVariable',
-	}
-	LanguageKinds['lisp'] = \
-	{
-		'ctags_f': 'CTagsFunction',
-	}
-	LanguageKinds['lua'] = \
-	{
-		'ctags_f': 'CTagsFunction',
-	}
-	LanguageKinds['make'] = \
-	{
-		'ctags_m': 'CTagsFunction',
-	}
-	LanguageKinds['pascal'] = \
-	{
-		'ctags_f': 'CTagsFunction',
-		'ctags_p': 'CTagsFunction',
-	}
-	LanguageKinds['perl'] = \
-	{
-		'ctags_c': 'CTagsGlobalConstant',
-		'ctags_f': 'CTagsFormat',
-		'ctags_l': 'CTagsLabel',
-		'ctags_p': 'CTagsPackage',
-		'ctags_s': 'CTagsFunction',
-		'ctags_d': 'CTagsFunction',
-	}
-	LanguageKinds['php'] = \
-	{
-		'ctags_c': 'CTagsClass',
-		'ctags_i': 'CTagsInterface',
-		'ctags_d': 'CTagsGlobalConstant',
-		'ctags_f': 'CTagsFunction',
-		'ctags_v': 'CTagsGlobalVariable',
-		'ctags_j': 'CTagsFunction',
-	}
-	LanguageKinds['python'] = \
-	{
-		'ctags_c': 'CTagsClass',
-		'ctags_f': 'CTagsFunction',
-		'ctags_i': 'CTagsImport',
-		'ctags_m': 'CTagsMember',
-		'ctags_v': 'CTagsGlobalVariable',
-	}
-	LanguageKinds['rexx'] = \
-	{
-		'ctags_s': 'CTagsFunction',
-	}
-	LanguageKinds['ruby'] = \
-	{
-		'ctags_c': 'CTagsClass',
-		'ctags_f': 'CTagsMethod',
-		'ctags_m': 'CTagsModule',
-		'ctags_F': 'CTagsSingleton',
-	}
-	LanguageKinds['scheme'] = \
-	{
-		'ctags_f': 'CTagsFunction',
-		'ctags_s': 'CTagsSet',
-	}
-	LanguageKinds['sh'] = \
-	{
-		'ctags_f': 'CTagsFunction',
-		'ctags_F': 'CTagsFile',
-	}
-	LanguageKinds['slang'] = \
-	{
-		'ctags_f': 'CTagsFunction',
-		'ctags_n': 'CTagsNamespace',
-	}
-	LanguageKinds['sml'] = \
-	{
-		'ctags_e': 'CTagsException',
-		'ctags_f': 'CTagsFunction',
-		'ctags_c': 'CTagsFunctionObject',
-		'ctags_s': 'CTagsSignature',
-		'ctags_r': 'CTagsStructure',
-		'ctags_t': 'CTagsType',
-		'ctags_v': 'CTagsGlobalVariable',
-	}
-	LanguageKinds['sql'] = \
-	{
-		'ctags_c': 'CTagsCursor',
-		'ctags_d': 'CTagsFunction',
-		'ctags_f': 'CTagsFunction',
-		'ctags_F': 'CTagsField',
-		'ctags_l': 'CTagsLocalVariable',
-		'ctags_L': 'CTagsLabel',
-		'ctags_P': 'CTagsPackage',
-		'ctags_p': 'CTagsFunction',
-		'ctags_r': 'CTagsRecord',
-		'ctags_s': 'CTagsType',
-		'ctags_t': 'CTagsTable',
-		'ctags_T': 'CTagsTrigger',
-		'ctags_v': 'CTagsGlobalVariable',
-		'ctags_i': 'CTagsIndex',
-		'ctags_e': 'CTagsEvent',
-		'ctags_U': 'CTagsPublication',
-		'ctags_R': 'CTagsService',
-		'ctags_D': 'CTagsDomain',
-		'ctags_V': 'CTagsView',
-		'ctags_n': 'CTagsSynonym',
-	}
-	LanguageKinds['tcl'] = \
-	{
-		'ctags_c': 'CTagsClass',
-		'ctags_m': 'CTagsMethod',
-		'ctags_p': 'CTagsFunction',
-	}
-	LanguageKinds['vera'] = \
-	{
-		'ctags_c': 'CTagsClass',
-		'ctags_d': 'CTagsDefinedName',
-		'ctags_e': 'CTagsEnumerationValue',
-		'ctags_f': 'CTagsFunction',
-		'ctags_g': 'CTagsEnumeratorName',
-		'ctags_l': 'CTagsLocalVariable',
-		'ctags_m': 'CTagsMember',
-		'ctags_p': 'CTagsProgram',
-		'ctags_P': 'CTagsFunction',
-		'ctags_t': 'CTagsTask',
-		'ctags_T': 'CTagsType',
-		'ctags_v': 'CTagsGlobalVariable',
-		'ctags_x': 'CTagsExtern',
-	}
-	LanguageKinds['verilog'] = \
-	{
-		'ctags_c': 'CTagsGlobalConstant',
-		'ctags_e': 'CTagsEvent',
-		'ctags_f': 'CTagsFunction',
-		'ctags_m': 'CTagsModule',
-		'ctags_n': 'CTagsNetType',
-		'ctags_p': 'CTagsPort',
-		'ctags_r': 'CTagsRegisterType',
-		'ctags_t': 'CTagsTask',
-	}
-	LanguageKinds['vhdl'] = \
-	{
-		'ctags_c': 'CTagsGlobalConstant',
-		'ctags_t': 'CTagsType',
-		'ctags_T': 'CTagsTypeComponent',
-		'ctags_r': 'CTagsRecord',
-		'ctags_e': 'CTagsEntity',
-		'ctags_C': 'CTagsComponent',
-		'ctags_d': 'CTagsPrototype',
-		'ctags_f': 'CTagsFunction',
-		'ctags_p': 'CTagsFunction',
-		'ctags_P': 'CTagsPackage',
-		'ctags_l': 'CTagsLocalVariable',
-	}
-	LanguageKinds['vim'] = \
-	{
-		'ctags_a': 'CTagsAutoCommand',
-		'ctags_c': 'CTagsCommand',
-		'ctags_f': 'CTagsFunction',
-		'ctags_m': 'CTagsMap',
-		'ctags_v': 'CTagsGlobalVariable',
-	}
-	LanguageKinds['yacc'] = \
-	{
-		'ctags_l': 'CTagsLabel',
-	}
-	return LanguageKinds
-
-if __name__ == "__main__":
-	main()
-
-# vim: noet ts=4 sw=4
-extra_source/mktypes/mktypes.spec	[[[1
-19
-# -*- mode: python -*-
-a = Analysis([os.path.join(HOMEPATH,'support\\_mountzlib.py'), os.path.join(HOMEPATH,'support\\useUnicode.py'), '../../mktypes.py'],
-             pathex=['.'])
-pyz = PYZ(a.pure)
-exe = EXE(pyz,
-          a.scripts,