Fix all doxygen warnings
Bug: tint:282 Change-Id: I6c243c30f4477bb972dc737c8b3ff9cc2e0a91f2 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31568 Reviewed-by: dan sinclair <dsinclair@chromium.org> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
cd5e4a8083
commit
2d89d98fe1
src
|
@ -37,20 +37,31 @@ inline bool operator>=(Severity a, Severity b) {
|
||||||
/// message.
|
/// message.
|
||||||
class Diagnostic {
|
class Diagnostic {
|
||||||
public:
|
public:
|
||||||
|
/// severity is the severity of the diagnostic message.
|
||||||
Severity severity = Severity::Error;
|
Severity severity = Severity::Error;
|
||||||
|
/// source is the location of the diagnostic.
|
||||||
Source source;
|
Source source;
|
||||||
|
/// message is the text associated with the diagnostic.
|
||||||
std::string message;
|
std::string message;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// List is a container of Diagnostic messages.
|
/// List is a container of Diagnostic messages.
|
||||||
class List {
|
class List {
|
||||||
public:
|
public:
|
||||||
|
/// iterator is the type used for range based iteration.
|
||||||
using iterator = std::vector<Diagnostic>::const_iterator;
|
using iterator = std::vector<Diagnostic>::const_iterator;
|
||||||
|
|
||||||
|
/// Constructs the list with no elements.
|
||||||
List();
|
List();
|
||||||
|
|
||||||
|
/// Constructs the list with a copy of the diagnostics in |list|.
|
||||||
|
/// @param list the list of diagnostics to copy into this list.
|
||||||
List(std::initializer_list<Diagnostic> list);
|
List(std::initializer_list<Diagnostic> list);
|
||||||
|
|
||||||
~List();
|
~List();
|
||||||
|
|
||||||
|
/// adds a diagnostic to the end of this list.
|
||||||
|
/// @param diag the diagnostic to append to this list.
|
||||||
void add(Diagnostic&& diag) {
|
void add(Diagnostic&& diag) {
|
||||||
entries_.emplace_back(std::move(diag));
|
entries_.emplace_back(std::move(diag));
|
||||||
if (diag.severity >= Severity::Error) {
|
if (diag.severity >= Severity::Error) {
|
||||||
|
|
|
@ -81,9 +81,12 @@ class ParserImpl {
|
||||||
/// TypedIdentifier holds a parsed identifier and type. Returned by
|
/// TypedIdentifier holds a parsed identifier and type. Returned by
|
||||||
/// variable_ident_decl().
|
/// variable_ident_decl().
|
||||||
struct TypedIdentifier {
|
struct TypedIdentifier {
|
||||||
ast::type::Type* type = nullptr; /// Parsed type.
|
/// Parsed type.
|
||||||
std::string name; /// Parsed identifier.
|
ast::type::Type* type = nullptr;
|
||||||
Source source; /// Source to the identifier.
|
/// Parsed identifier.
|
||||||
|
std::string name;
|
||||||
|
/// Source to the identifier.
|
||||||
|
Source source;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Creates a new parser using the given file
|
/// Creates a new parser using the given file
|
||||||
|
|
23
src/source.h
23
src/source.h
|
@ -44,12 +44,11 @@ class Source {
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Location holds a 1-based line and column index.
|
/// Location holds a 1-based line and column index.
|
||||||
/// 0's for |line| or |column| represent invalid values.
|
|
||||||
class Location {
|
class Location {
|
||||||
public:
|
public:
|
||||||
/// The line number, 1-based
|
/// the 1-based line number. 0 represents no line information.
|
||||||
size_t line = 0;
|
size_t line = 0;
|
||||||
/// The column number, 1-based
|
/// the 1-based column number. 0 represents no column information.
|
||||||
size_t column = 0;
|
size_t column = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -60,12 +59,12 @@ class Source {
|
||||||
inline Range() = default;
|
inline Range() = default;
|
||||||
|
|
||||||
/// Constructs a zero-length Range starting at |loc|.
|
/// Constructs a zero-length Range starting at |loc|.
|
||||||
/// @param loc the location to use to build the range
|
/// @param loc the start and end location for the range.
|
||||||
inline explicit Range(const Location& loc) : begin(loc), end(loc) {}
|
inline explicit Range(const Location& loc) : begin(loc), end(loc) {}
|
||||||
|
|
||||||
/// Constructs the Range beginning at |b| and ending at |e|.
|
/// Constructs the Range beginning at |b| and ending at |e|.
|
||||||
/// @param b the beginning of the range
|
/// @param b the range start location.
|
||||||
/// @param e the end of the range
|
/// @param e the range end location.
|
||||||
inline Range(const Location& b, const Location& e) : begin(b), end(e) {}
|
inline Range(const Location& b, const Location& e) : begin(b), end(e) {}
|
||||||
|
|
||||||
/// The location of the first character in the range.
|
/// The location of the first character in the range.
|
||||||
|
@ -78,21 +77,21 @@ class Source {
|
||||||
inline Source() = default;
|
inline Source() = default;
|
||||||
|
|
||||||
/// Constructs the Source with the Range |rng| and a null File.
|
/// Constructs the Source with the Range |rng| and a null File.
|
||||||
/// @param rng the range to assign to the source
|
/// @param rng the source range
|
||||||
inline explicit Source(const Range& rng) : range(rng) {}
|
inline explicit Source(const Range& rng) : range(rng) {}
|
||||||
|
|
||||||
/// Constructs the Source with the Range |loc| and a null File.
|
/// Constructs the Source with the Range |loc| and a null File.
|
||||||
/// @param loc the location to assign to the source
|
/// @param loc the start and end location for the source range
|
||||||
inline explicit Source(const Location& loc) : range(Range(loc)) {}
|
inline explicit Source(const Location& loc) : range(Range(loc)) {}
|
||||||
|
|
||||||
/// Constructs the Source with the Range |rng| and File |f|.
|
/// Constructs the Source with the Range |rng| and File |f|.
|
||||||
/// @param rng the range for the source
|
/// @param rng the source range
|
||||||
/// @param f the file for the source
|
/// @param f the source file
|
||||||
inline Source(const Range& rng, File const* f) : range(rng), file(f) {}
|
inline Source(const Range& rng, File const* f) : range(rng), file(f) {}
|
||||||
|
|
||||||
/// Line/column range for this source
|
/// range is the span of text this source refers to in |file|
|
||||||
Range range;
|
Range range;
|
||||||
/// Source file
|
/// file is the source file this source refers to
|
||||||
File const* file = nullptr;
|
File const* file = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue