Spicy
doc-only.h
1 // Copyright (c) 2020-2021 by the Zeek Project. See LICENSE for details.
2 
3 #pragma once
4 
5 #include <string>
6 #include <utility>
7 
8 #include <hilti/ast/type.h>
9 
10 namespace hilti {
11 namespace type {
12 
19 class DocOnly : public TypeBase {
20 public:
21  DocOnly(std::string desc, Meta m = Meta()) : TypeBase(std::move(m)), _description(std::move(desc)) {}
22 
23  auto description() const { return _description; }
24 
25  bool operator==(const DocOnly& /* other */) const { return false; }
26 
27  // Type interface.
28  auto isEqual(const Type& other) const { return node::isEqual(this, other); }
30  auto _isResolved(ResolvedState* rstate) const { return true; }
32  auto properties() const { return node::Properties{}; }
33 
34 private:
35  std::string _description;
36 };
37 
38 } // namespace type
39 } // namespace hilti
Definition: doc-only.h:19
Definition: meta.h:18
auto _isResolved(ResolvedState *rstate) const
Definition: doc-only.h:30
Definition: type.h:159
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:99
auto properties() const
Definition: doc-only.h:32
Definition: type.h:198