コード例 #1
0
ファイル: diagnostics.go プロジェクト: zimmski/go-clang
/**
 * \brief Retrieve a source range associated with the diagnostic.
 *
 * A diagnostic's source ranges highlight important elements in the source
 * code. On the command line, Clang displays source ranges by
 * underlining them with '~' characters.
 *
 * \param Diagnostic the diagnostic whose range is being extracted.
 *
 * \param Range the zero-based index specifying which range to
 *
 * \returns the requested source range.
 */
func (d Diagnostic) Ranges() (ret []SourceRange) {
	ret = make([]SourceRange, C.clang_getDiagnosticNumRanges(d.c))
	for i := range ret {
		ret[i].c = C.clang_getDiagnosticRange(d.c, C.uint(i))
	}
	return
}
コード例 #2
0
ファイル: diagnostic_gen.go プロジェクト: go-clang/v3.4
// Determine the number of source ranges associated with the given diagnostic.
func (d Diagnostic) NumRanges() uint32 {
	return uint32(C.clang_getDiagnosticNumRanges(d.c))
}