| CMakeLists.txt |
|
2080 |
- |
| qqmldom_fwd_p.h |
|
2076 |
- |
| qqmldom_global.h |
|
566 |
- |
| qqmldom_utils.cpp |
|
1282 |
- |
| qqmldom_utils_p.h |
|
1262 |
- |
| qqmldomastcreator.cpp |
Avoid crashing on files with JS-elements that are not implemented yet.
Might be removed (definition + usages) once all script elements are implemented.
|
124717 |
- |
| qqmldomastcreator_p.h |
!
\internal
Contains a ScriptElementVariant, that can be used everywhere in the DOM representation, or a
List that should always be inside of something else, e.g., that cannot be the root of the
script element DOM representation.
Also, it makes sure you do not mistreat a list as a regular script element and vice versa.
The reason for this is that Lists can get pretty unintuitive, as a List could be a Block of
statements or a list of variable declarations (let i = 3, j = 4, ...) or something completely
different. Instead, always put lists inside named construct (BlockStatement,
VariableDeclaration, ...).
|
27522 |
- |
| qqmldomastdumper.cpp |
!
\internal
\enum QQmlJS::AstDumperOption
This enum type specifies the options for the AstDumper.
The values can be combined with the '|' operator, and checked using the '&' operator.
\value None
Default dumping options
\value NoLocations
Does not dump SourceLocations, allowing one to compare equivalent AST
generated by code formatted differently
\value NoAnnotations
Does not dump annotations
\value DumpNode
Does dump a <Node></Node> in preVisit/postVisit
|
48042 |
- |
| qqmldomastdumper_p.h |
|
1948 |
- |
| qqmldomcodeformatter.cpp |
|
48582 |
- |
| qqmldomcodeformatter_p.h |
|
9657 |
- |
| qqmldomcomments.cpp |
!
\internal
\class QQmlJS::Dom::AstComments
\brief Associates comments with AST::Node *
Comments are associated to the largest closest node with the
following algorithm:
\list
\li comments of a node can either be preComments or postComments (before
or after the element)
\li define start and end for each element, if two elements start (or end)
at the same place the first (larger) wins.
\li associate the comments either with the element just before or
just after unless the comments is *inside* an element (meaning that
going back there is a start before finding an end, or going forward an
end is met before a start).
\li to choose between the element before or after, we look at the start
of the comment, if it is on a new line then associating it as
preComment to the element after is preferred, otherwise post comment
of the previous element (inline element).
This is the only space dependent choice, making comment assignment
quite robust
\li if the comment is intrinsically inside all elements then it is moved
to before the smallest element.
This is the largest reorganization performed, and it is still quite
small and difficult to trigger.
\li the comments are stored with the whitespace surrounding them, from
the preceding newline (and recording if a newline is required before
it) until the newline after.
This allows a better reproduction of the comments.
\endlist
|
36699 |
- |
| qqmldomcomments_p.h |
// Returns the location starting from // or /*
QQmlJS::SourceLocation sourceLocation() const { return commentLocation; }
quint32 commentBegin = 0;
quint32 commentEnd = 0;
quint32 commentContentBegin = 0;
quint32 commentContentEnd = 0;
QStringView commentStartStr;
QStringView commentEndStr;
bool hasStartNewline = false;
bool hasEndNewline = false;
int nContentNewlines = 0;
QStringView rawComment;
QStringList warnings;
QQmlJS::SourceLocation commentLocation;
};
/*!
\internal
Anchor comments at an AST::Node* (DefaultLocation) or at an QQmlJS::SourceLocation inside of the
AST::Node*. In the latter case, the member location takes the value of the anchor's
QQmlJS::SourceLocation::offset, so that the formatter can differentiate between multiple anchors
inside the same AST::Node*.
|
12202 |
- |
| qqmldomcompare.cpp |
|
9467 |
- |
| qqmldomcompare_p.h |
|
2462 |
- |
| qqmldomconstants.cpp |
|
346 |
- |
| qqmldomconstants_p.h |
enum A { B, C }
*
EnumItem is marked with * |
12080 |
- |
| qqmldomelements.cpp |
|
79359 |
- |
| qqmldomelements_p.h |
|
40910 |
- |
| qqmldomerrormessage.cpp |
!
\internal
\macro NewErrorGroup
\param groupId a double qouted string giving the groupId for this group
\brief convenience macro creating a new ErrorGroup and registering its groupId as translatable string
|
15044 |
- |
| qqmldomerrormessage_p.h |
|
7874 |
- |
| qqmldomexternalitems.cpp |
lineno = |
10500 |
- |
| qqmldomexternalitems_p.h |
!
\internal
\class QQmlJS::Dom::ExternalOwningItem
\brief A OwningItem that refers to an external resource (file,...)
Every owning item has a file or directory it refers to.
|
13598 |
- |
| qqmldomfieldfilter.cpp |
!
\internal
\class QQmljs::Dom::FieldFilter
\brief Class that represent a filter on DomItem, when dumping or comparing
DomItem can be duped or compared, but often one is interested only in a subset
of them, FieldFilter is a simple way to select a subset of them.
It uses two basic elements: the type of the object (internalKind) and the
name of fields.
A basic filter can be represented by <op><typeName>:<fieldName> or <op><fieldName>
where op is either + or - (if the matching elements should be added or removed)
Both typeName and fieldName can be the empty string (meaning any value matches).
Basic filters are ordered from the most specific to the least specific as follow:
type+field > type > field > empty.
When combining several filters the most specific always wins, so
-code,+ScriptExpression:code is the same as +ScriptExpression:code,-code and means
that normally the field code is not outputted but for a ScriptExpression DomItem
it is.
It is possible to get the string representation of the current filter with
FieldFilter::describeFieldsFilter(), and change the current filter with
FieldFilter::addFilter(), but after it one should call FieldFilter::setFiltred()
to ensure that the internal cache used to speed up comparisons is correct.
|
10155 |
- |
| qqmldomfieldfilter_p.h |
|
2050 |
- |
| qqmldomfilelocations.cpp |
!
\internal
\namespace QQmlJS::Dom::FileLocations
\brief Provides entities to maintain mappings between elements and their location in a file
The location information is associated with the element it refers to via ::Node
There are free functions to simplify the handling of the FileLocations tree.
|
7250 |
- |
| qqmldomfilelocations_p.h |
|
3397 |
- |
| qqmldomfilewriter.cpp |
|
3680 |
- |
| qqmldomfilewriter_p.h |
|
1560 |
- |
| qqmldomformatdirectivescanner.cpp |
|
4704 |
- |
| qqmldomformatdirectivescanner_p.h |
|
960 |
- |
| qqmldomfunctionref_p.h |
|
1712 |
- |
| qqmldomindentinglinewriter.cpp |
|
5206 |
- |
| qqmldomindentinglinewriter_p.h |
|
2050 |
- |
| qqmldomitem.cpp |
!
\internal
\class QQmljs::Dom::ElementT
\brief A variant that contains all the Dom elements that an DomItem can contain.
Types in this variant are divided in two categories: normal Dom elements and internal Dom
elements.
The first ones are inheriting directly or indirectly from DomBase, and are the usual elements
that a DomItem can wrap around, like a QmlFile or an QmlObject. They should all appear in
ElementT as pointers, e.g. QmlFile*.
The internal Dom elements are a little bit special. They appear in ElementT without pointer, do
not inherit from DomBase \b{but} should behave like a smart DomBase-pointer. That is, they should
dereference as if they were a DomBase* pointing to a normal DomElement by implementing
operator->() and operator*().
Adding types here that are neither inheriting from DomBase nor implementing a smartpointer to
DomBase will throw compilation errors in the std::visit()-calls on this type.
|
110492 |
- |
| qqmldomitem_p.h |
|
80733 |
- |
| qqmldomlinewriter.cpp |
|
11687 |
- |
| qqmldomlinewriter_p.h |
|
6337 |
- |
| qqmldomlinewriterfactory_p.h |
|
1082 |
- |
| qqmldommock.cpp |
|
4203 |
- |
| qqmldommock_p.h |
|
3460 |
- |
| qqmldomoutwriter.cpp |
\internal
\brief Utility function to determine if two source locations overlap
|
13015 |
- |
| qqmldomoutwriter_p.h |
|
5091 |
- |
| qqmldompath.cpp |
|
37049 |
- |
| qqmldompath_p.h |
|
23747 |
- |
| qqmldomreformatter.cpp |
|
36271 |
- |
| qqmldomreformatter_p.h |
|
9120 |
- |
| qqmldomscanner.cpp |
|
14526 |
- |
| qqmldomscanner_p.h |
|
2504 |
- |
| qqmldomscriptelements.cpp |
!
\internal
\class ScriptElementBase
The base class for all script elements.
Derived classes should implement createFileLocations, DomElement::updatePathFromOwner and
DomBase::iterateDirectSubpaths. Furthermore, they need their own DomType enum.
updatePathFromOwner and createFileLocations should be called on the script element root node
after it was constructed for the DomItem-wrapping to work correctly. Without it, methods like
iterateDirectSubpaths and all the stuff in DomItem will not work.
createFileLocations does not work without having the pathFromOwner set
first via updatePathFromOwner.
In derived classes, the updatePathFromOwner-implementation should call the base implementation
and also call recursively updatePathFromOwner on the derived class's children.
See \l ScriptElementBase::createFileLocations for the createFileLocations implementation in
derived classes.
Derived classes need to implement iterateDirectSubpaths to comply with the DomItem interface.
|
12765 |
- |
| qqmldomscriptelements_p.h |
Pretty prints the current DomItem. Currently, for script elements, this is done entirely on
the parser representation (via the AST classes), but it could be moved here if needed.
|
15137 |
- |
| qqmldomstringdumper.cpp |
!
\internal
\fn QQmlJS::Dom::Sink
\brief A Sink is a function that accepts a QStringView as input
A Sink it the core element of a text based stream oriented output.
It is simply a function accepting a QStringView as input.
|
5052 |
- |
| qqmldomstringdumper_p.h |
|
3688 |
- |
| qqmldomtop.cpp |
!
\internal
\brief QQml::Dom::DomTop::loadFile
\param filePath
the file path to load
\param logicalPath
the path from the
\param callback
a callback called with an canonical path, the old value, and the current value.
\param loadOptions are
if force is true the file is always read
|
64704 |
- |
| qqmldomtop_p.h |
|
38152 |
- |