4#ifndef QQMLDOMCOMMENTS_P_H
5#define QQMLDOMCOMMENTS_P_H
24#include <QtQml/private/qqmljsast_p.h>
25#include <QtQml/private/qqmljsengine_p.h>
27#include <QtCore/QMultiMap>
28#include <QtCore/QHash>
29#include <QtCore/QStack>
30#include <QtCore/QCoreApplication>
50 return rawComment.
mid(commentContentBegin, commentContentEnd - commentContentEnd);
55 return rawComment.
mid(commentEnd, rawComment.size() - commentEnd);
64 bool hasStartNewline =
false;
65 bool hasEndNewline =
false;
74 constexpr static DomType kindValue = DomType::Comment;
78 : m_commentStr(
c), m_comment(m_commentStr), m_newlinesBefore(newlinesBefore)
94 return c1.m_newlinesBefore ==
c2.m_newlinesBefore && c1.m_comment ==
c2.m_comment;
101 int m_newlinesBefore;
107 constexpr static DomType kindValue = DomType::CommentedElement;
131 constexpr static DomType kindValue = DomType::RegionComments;
147 auto &preList = regionComments[regionName].preComments;
149 preList.append(comment);
150 return Path::Field(Fields::regionComments)
152 .
field(Fields::preComments)
158 auto &postList = regionComments[regionName].postComments;
160 postList.append(comment);
161 return Path::Field(Fields::regionComments)
163 .
field(Fields::postComments)
175 return std::make_shared<AstComments>(*
this);
179 constexpr static DomType kindValue = DomType::AstComments;
184 return std::static_pointer_cast<AstComments>(doCopy(self));
190 std::shared_ptr<AstComments> collectComments,
194 :
OwningItem(
o), m_engine(
o.m_engine), m_commentedElements(
o.m_commentedElements)
200 return m_commentedElements;
204 if (m_commentedElements.contains(
n))
205 return &(m_commentedElements[
n]);
211 std::shared_ptr<Engine> m_engine;
void accept(BaseVisitor *visitor)
std::shared_ptr< AttachedInfoT< FileLocations > > Tree
Path key(QString name) const
Path field(QString name) const
Path index(index_type i) const
A vistor that visits all the AST:Node.
void endVisit(AST::Elision *el) override
bool visit(AST::UiPublicMember *el) override
bool visit(AST::UiParameterList *el) override
bool visit(AST::UiEnumDeclaration *el) override
void throwRecursionDepthError() override
bool visit(AST::UiQualifiedId *el) override
bool visit(AST::UiScriptBinding *el) override
bool visit(AST::TemplateLiteral *el) override
bool visit(AST::UiObjectBinding *el) override
static QSet< int > uiKinds()
returns a set with all Ui* Nodes (i.e.
void endVisit(AST::UiEnumMemberList *el) override
bool visit(AST::UiObjectDefinition *el) override
void endVisit(AST::UiPublicMember *el) override
bool visit(AST::UiInlineComponent *el) override
void endVisit(AST::UiParameterList *el) override
void endVisit(AST::UiImport *el) override
bool visit(AST::UiArrayBinding *el) override
bool visit(AST::UiSourceElement *el) override
constexpr QStringView mid(qsizetype pos, qsizetype n=-1) const noexcept
Returns the substring of length length starting at position start in this object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
#define Q_DECLARE_TR_FUNCTIONS(context)
GLuint const GLint * locations
const QQuickItem * rootItem(const I &item)
gzip write("uncompressed data")