Skip to content

Commit

Permalink
all: gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
sbinet committed Jul 3, 2013
1 parent e096a03 commit b7876ac
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 44 deletions.
48 changes: 24 additions & 24 deletions cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (c Cursor) Spelling() string {
* \brief Retrieve the display name for the entity referenced by this cursor.
*
* The display name contains extra information that helps identify the cursor,
* such as the parameters of a function or template or the arguments of a
* such as the parameters of a function or template or the arguments of a
* class template specialization.
*/
func (c Cursor) DisplayName() string {
Expand Down Expand Up @@ -299,7 +299,7 @@ func (c CursorSet) Insert(cursor Cursor) bool {
*
* The semantic parent of a cursor is the cursor that semantically contains
* the given \p cursor. For many declarations, the lexical and semantic parents
* are equivalent (the lexical parent is returned by
* are equivalent (the lexical parent is returned by
* \c clang_getCursorLexicalParent()). They diverge when declarations or
* definitions are provided out-of-line. For example:
*
Expand All @@ -311,10 +311,10 @@ func (c CursorSet) Insert(cursor Cursor) bool {
* void C::f() { }
* \endcode
*
* In the out-of-line definition of \c C::f, the semantic parent is the
* In the out-of-line definition of \c C::f, the semantic parent is the
* the class \c C, of which this function is a member. The lexical parent is
* the place where the declaration actually occurs in the source code; in this
* case, the definition occurs in the translation unit. In general, the
* case, the definition occurs in the translation unit. In general, the
* lexical parent for a given entity can change without affecting the semantics
* of the program, and the lexical parent of different declarations of the
* same entity may be different. Changing the semantic parent of a declaration,
Expand All @@ -337,7 +337,7 @@ func (c Cursor) SemanticParent() Cursor {
*
* The lexical parent of a cursor is the cursor in which the given \p cursor
* was actually written. For many declarations, the lexical and semantic parents
* are equivalent (the semantic parent is returned by
* are equivalent (the semantic parent is returned by
* \c clang_getCursorSemanticParent()). They diverge when declarations or
* definitions are provided out-of-line. For example:
*
Expand All @@ -349,10 +349,10 @@ func (c Cursor) SemanticParent() Cursor {
* void C::f() { }
* \endcode
*
* In the out-of-line definition of \c C::f, the semantic parent is the
* In the out-of-line definition of \c C::f, the semantic parent is the
* the class \c C, of which this function is a member. The lexical parent is
* the place where the declaration actually occurs in the source code; in this
* case, the definition occurs in the translation unit. In general, the
* case, the definition occurs in the translation unit. In general, the
* lexical parent for a given entity can change without affecting the semantics
* of the program, and the lexical parent of different declarations of the
* same entity may be different. Changing the semantic parent of a declaration,
Expand Down Expand Up @@ -402,11 +402,11 @@ func (c Cursor) LexicalParent() Cursor {
* \param cursor A cursor representing an Objective-C or C++
* method. This routine will compute the set of methods that this
* method overrides.
*
*
* \param overridden A pointer whose pointee will be replaced with a
* pointer to an array of cursors, representing the set of overridden
* methods. If there are no overridden methods, the pointee will be
* set to NULL. The pointee must be freed via a call to
* set to NULL. The pointee must be freed via a call to
* \c clang_disposeOverriddenCursors().
*
* \param num_overridden A pointer to the number of overridden
Expand Down Expand Up @@ -595,7 +595,7 @@ func (c Cursor) AccessSpecifier() AccessSpecifier {
}

/**
* \brief Determine the number of overloaded declarations referenced by a
* \brief Determine the number of overloaded declarations referenced by a
* \c CXCursor_OverloadedDeclRef cursor.
*
* \param cursor The cursor whose overloaded declarations are being queried.
Expand All @@ -617,8 +617,8 @@ func (c Cursor) NumOverloadedDecls() int {
* \param index The zero-based index into the set of overloaded declarations in
* the cursor.
*
* \returns A cursor representing the declaration referenced by the given
* \c cursor at the specified \c index. If the cursor does not have an
* \returns A cursor representing the declaration referenced by the given
* \c cursor at the specified \c index. If the cursor does not have an
* associated set of overloaded declarations, or if the index is out of bounds,
* returns \c clang_getNullCursor();
*/
Expand Down Expand Up @@ -847,10 +847,10 @@ func (c Cursor) IsDefinition() bool {
* };
* \endcode
*
* The declarations and the definition of \c X are represented by three
* different cursors, all of which are declarations of the same underlying
* The declarations and the definition of \c X are represented by three
* different cursors, all of which are declarations of the same underlying
* entity. One of these cursor is considered the "canonical" cursor, which
* is effectively the representative for the underlying entity. One can
* is effectively the representative for the underlying entity. One can
* determine if two cursors are declarations of the same underlying entity by
* comparing their canonical cursors.
*
Expand Down Expand Up @@ -892,7 +892,7 @@ func (c Cursor) BriefCommentText() string {
*/

/**
* \brief Determine if a C++ member function or member function template is
* \brief Determine if a C++ member function or member function template is
* declared 'static'.
*/
func (c Cursor) CXXMethod_IsStatic() bool {
Expand Down Expand Up @@ -943,26 +943,26 @@ func (c Cursor) TemplateCursorKind() CursorKind {
* of a template, retrieve the cursor that represents the template that it
* specializes or from which it was instantiated.
*
* This routine determines the template involved both for explicit
* This routine determines the template involved both for explicit
* specializations of templates and for implicit instantiations of the template,
* both of which are referred to as "specializations". For a class template
* specialization (e.g., \c std::vector<bool>), this routine will return
* specialization (e.g., \c std::vector<bool>), this routine will return
* either the primary template (\c std::vector) or, if the specialization was
* instantiated from a class template partial specialization, the class template
* partial specialization. For a class template partial specialization and a
* function template specialization (including instantiations), this
* this routine will return the specialized template.
*
* For members of a class template (e.g., member functions, member classes, or
* static data members), returns the specialized or instantiated member.
* static data members), returns the specialized or instantiated member.
* Although not strictly "templates" in the C++ language, members of class
* templates have the same notions of specializations and instantiations that
* templates do, so this routine treats them similarly.
*
* \param C A cursor that may be a specialization of a template or a member
* of a template.
*
* \returns If the given cursor is a specialization or instantiation of a
* \returns If the given cursor is a specialization or instantiation of a
* template or a member thereof, the template or member that it specializes or
* from which it was instantiated. Otherwise, returns a NULL cursor.
*/
Expand All @@ -977,11 +977,11 @@ func (c Cursor) SpecializedCursorTemplate() Cursor {
*
* \param C A cursor pointing to a member reference, a declaration reference, or
* an operator call.
* \param NameFlags A bitset with three independent flags:
* \param NameFlags A bitset with three independent flags:
* CXNameRange_WantQualifier, CXNameRange_WantTemplateArgs, and
* CXNameRange_WantSinglePiece.
* \param PieceIndex For contiguous names or when passing the flag
* CXNameRange_WantSinglePiece, only one piece with index 0 is
* \param PieceIndex For contiguous names or when passing the flag
* CXNameRange_WantSinglePiece, only one piece with index 0 is
* available. When the CXNameRange_WantSinglePiece flag is not passed for a
* non-contiguous names, this index can be used to retreive the individual
* pieces of the name. See also CXNameRange_WantSinglePiece.
Expand All @@ -1005,7 +1005,7 @@ const (
NR_WantQualifier = C.CXNameRange_WantQualifier

/**
* \brief Include the explicit template arguments, e.g. <int> in x.f<int>, in
* \brief Include the explicit template arguments, e.g. <int> in x.f<int>, in
* the range.
*/
NR_WantTemplateArgs = C.CXNameRange_WantTemplateArgs
Expand Down
12 changes: 6 additions & 6 deletions cursorkind.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const (
*/
CK_TypeRef = C.CXCursor_TypeRef
CK_CXXBaseSpecifier = C.CXCursor_CXXBaseSpecifier
/**
/**
* \brief A reference to a class template, function template, template
* template parameter, or class template partial specialization.
*/
Expand All @@ -141,14 +141,14 @@ const (
*/
CK_NamespaceRef = C.CXCursor_NamespaceRef
/**
* \brief A reference to a member of a struct, union, or class that occurs in
* \brief A reference to a member of a struct, union, or class that occurs in
* some non-expression context, e.g., a designated initializer.
*/
CK_MemberRef = C.CXCursor_MemberRef
/**
* \brief A reference to a labeled statement.
*
* This cursor kind is used to describe the jump to "start_over" in the
* This cursor kind is used to describe the jump to "start_over" in the
* goto statement in the following example:
*
* \code
Expand Down Expand Up @@ -194,7 +194,7 @@ const (
* argument-dependent lookup (e.g., the "swap" function at the end of the
* example).
*
* The functions \c clang_getNumOverloadedDecls() and
* The functions \c clang_getNumOverloadedDecls() and
* \c clang_getOverloadedDecl() can be used to retrieve the definitions
* referenced by this cursor.
*/
Expand Down Expand Up @@ -461,9 +461,9 @@ const (
*/
CK_UnexposedStmt = C.CXCursor_UnexposedStmt

/** \brief A labelled statement in a function.
/** \brief A labelled statement in a function.
*
* This cursor kind is used to describe the "start_over:" label statement in
* This cursor kind is used to describe the "start_over:" label statement in
* the following example:
*
* \code
Expand Down
2 changes: 1 addition & 1 deletion cxstring.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package clang
// #include "clang-c/Index.h"
import "C"
import (
//"unsafe"
//"unsafe"
)

// cxstring is a character string.
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// const displayDiagnostics = 1
// idx := clang.NewIndex(excludeDeclarationsFromPCH, displayDiagnostics)
// defer idx.Dispose()
//
//
// args := []string{}
// tu := idx.Parse("somefile.cxx", args)
// defer tu.Dispose()
Expand Down
20 changes: 10 additions & 10 deletions token.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ import "C"

// TokenKind describes a kind of token
type TokenKind uint32

const (
/**
* \brief A token that contains some kind of punctuation.
*/
/**
* \brief A token that contains some kind of punctuation.
*/
TK_Punctuation = C.CXToken_Punctuation

/**
* \brief A language keyword.
*/
/**
* \brief A language keyword.
*/
TK_Keyword = C.CXToken_Keyword

/**
Expand Down Expand Up @@ -104,8 +105,8 @@ func Tokenize(tu TranslationUnit, src SourceRange) Tokens {
// an array of tokens
type Tokens struct {
tu C.CXTranslationUnit
c *C.CXToken
n C.uint
c *C.CXToken
n C.uint
}

/**
Expand Down Expand Up @@ -142,7 +143,7 @@ func (t Tokens) Annotate() []Cursor {
c_cursors := make([]C.CXCursor, int(t.n))
C.clang_annotateTokens(t.tu, t.c, t.n, &c_cursors[0])
cursors := make([]Cursor, int(t.n))
for i,_ := range cursors {
for i, _ := range cursors {
cursors[i] = Cursor{C._go_clang_ocursor_at(&c_cursors[0], C.int(i))}
}
return cursors
Expand All @@ -155,5 +156,4 @@ func (t Tokens) Dispose() {
C.clang_disposeTokens(t.tu, t.c, t.n)
}


// EOF
4 changes: 2 additions & 2 deletions type.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (t Type) CanonicalType() Type {
return Type{o}
}

// IsConstQualified determines whether a Type has the "const" qualifier set,
// IsConstQualified determines whether a Type has the "const" qualifier set,
// without looking through typedefs that may have added "const" at a
// different level.
func (t Type) IsConstQualified() bool {
Expand All @@ -120,7 +120,7 @@ func (t Type) IsConstQualified() bool {
return false
}

// IsVolatileQualified determines whether a Type has the "volatile" qualifier
// IsVolatileQualified determines whether a Type has the "volatile" qualifier
// set, without looking through typedefs that may have added "volatile" at a
// different level.
func (t Type) IsVolatileQualified() bool {
Expand Down

0 comments on commit b7876ac

Please sign in to comment.