@@ -508,7 +508,7 @@ def name(self):
508
508
@staticmethod
509
509
def from_id (id ):
510
510
if id >= len (CursorKind ._kinds ) or CursorKind ._kinds [id ] is None :
511
- raise ValueError ,'Unknown cursor kind'
511
+ raise ValueError ,'Unknown cursor kind %d' % id
512
512
return CursorKind ._kinds [id ]
513
513
514
514
@staticmethod
@@ -721,10 +721,14 @@ def __repr__(self):
721
721
# A reference to a labeled statement.
722
722
CursorKind .LABEL_REF = CursorKind (48 )
723
723
724
- # A reference toa a set of overloaded functions or function templates
724
+ # A reference to a set of overloaded functions or function templates
725
725
# that has not yet been resolved to a specific function or function template.
726
726
CursorKind .OVERLOADED_DECL_REF = CursorKind (49 )
727
727
728
+ # A reference to a variable that occurs in some non-expression
729
+ # context, e.g., a C++ lambda capture list.
730
+ CursorKind .VARIABLE_REF = CursorKind (50 )
731
+
728
732
###
729
733
# Invalid/Error Kinds
730
734
@@ -908,6 +912,26 @@ def __repr__(self):
908
912
# pack.
909
913
CursorKind .SIZE_OF_PACK_EXPR = CursorKind (143 )
910
914
915
+ # Represents a C++ lambda expression that produces a local function
916
+ # object.
917
+ #
918
+ # \code
919
+ # void abssort(float *x, unsigned N) {
920
+ # std::sort(x, x + N,
921
+ # [](float a, float b) {
922
+ # return std::abs(a) < std::abs(b);
923
+ # });
924
+ # }
925
+ # \endcode
926
+ CursorKind .LAMBDA_EXPR = CursorKind (144 )
927
+
928
+ # Objective-c Boolean Literal.
929
+ CursorKind .OBJ_BOOL_LITERAL_EXPR = CursorKind (145 )
930
+
931
+ # Represents the "self" expression in a ObjC method.
932
+ CursorKind .OBJ_SELF_EXPR = CursorKind (146 )
933
+
934
+
911
935
# A statement whose specific kind is not exposed via this interface.
912
936
#
913
937
# Unexposed statements have the same operations as any other kind of statement;
@@ -999,6 +1023,9 @@ def __repr__(self):
999
1023
# Windows Structured Exception Handling's finally statement.
1000
1024
CursorKind .SEH_FINALLY_STMT = CursorKind (228 )
1001
1025
1026
+ # A MS inline assembly statement extension.
1027
+ CursorKind .MS_ASM_STMT = CursorKind (229 )
1028
+
1002
1029
# The null statement.
1003
1030
CursorKind .NULL_STMT = CursorKind (230 )
1004
1031
@@ -1036,6 +1063,12 @@ def __repr__(self):
1036
1063
CursorKind .MACRO_INSTANTIATION = CursorKind (502 )
1037
1064
CursorKind .INCLUSION_DIRECTIVE = CursorKind (503 )
1038
1065
1066
+ ###
1067
+ # Extra declaration
1068
+
1069
+ # A module import declaration.
1070
+ CursorKind .MODULE_IMPORT_DECL = CursorKind (600 )
1071
+
1039
1072
### Cursors ###
1040
1073
1041
1074
class Cursor (Structure ):
@@ -1918,7 +1951,7 @@ def __del__(self):
1918
1951
1919
1952
def read (self , path ):
1920
1953
"""Load a TranslationUnit from the given AST file."""
1921
- return TranslationUnit .from_ast (path , self )
1954
+ return TranslationUnit .from_ast_file (path , self )
1922
1955
1923
1956
def parse (self , path , args = None , unsaved_files = None , options = 0 ):
1924
1957
"""Load the translation unit from the given source code file by running
0 commit comments