[cfe-commits] r156722 - /cfe/trunk/bindings/python/clang/cindex.py
Gregory Szorc
gregory.szorc at gmail.com
Sat May 12 13:49:13 PDT 2012
Author: gps
Date: Sat May 12 15:49:13 2012
New Revision: 156722
URL: http://llvm.org/viewvc/llvm-project?rev=156722&view=rev
Log:
[clang.py] Followup to TranslationUnit refactor
* Document index argument in TranslationUnit.from_source
* Add numeric error code to TranslationUnitSaveError string representation
* Use None instead of [] for default argument value in
TranslationUnit.codeComplete
Modified:
cfe/trunk/bindings/python/clang/cindex.py
Modified: cfe/trunk/bindings/python/clang/cindex.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/bindings/python/clang/cindex.py?rev=156722&r1=156721&r2=156722&view=diff
==============================================================================
--- cfe/trunk/bindings/python/clang/cindex.py (original)
+++ cfe/trunk/bindings/python/clang/cindex.py Sat May 12 15:49:13 2012
@@ -126,7 +126,7 @@
"value supported." % enumeration)
self.save_error = enumeration
- Exception.__init__(self, message)
+ Exception.__init__(self, 'Error %d: %s' % (enumeration, message))
### Structures and Utility Classes ###
@@ -1739,6 +1739,9 @@
options is a bitwise or of TranslationUnit.PARSE_XXX flags which will
control parsing behavior.
+ index is an Index instance to utilize. If not provided, a new Index
+ will be created for this TranslationUnit.
+
To parse source from the filesystem, the filename of the file to parse
is specified by the filename argument. Or, filename could be None and
the args list would contain the filename(s) to parse.
@@ -1925,7 +1928,7 @@
raise TranslationUnitSaveError(result,
'Error saving TranslationUnit.')
- def codeComplete(self, path, line, column, unsaved_files=[], options=0):
+ def codeComplete(self, path, line, column, unsaved_files=None, options=0):
"""
Code complete in this translation unit.
More information about the cfe-commits
mailing list