7#include <QtQml/private/qqmljsast_p.h>
8#include <QtQml/private/qqmljsengine_p.h>
9#include <QtQml/private/qqmljslexer_p.h>
10#include <QtQml/private/qqmljsparser_p.h>
11#include <QtQml/private/qqmlimportresolver_p.h>
13#include <QtCore/qfileinfo.h>
14#include <QtCore/qdebug.h>
31 const bool isJavaScript = isESModule || lowerSuffix ==
QLatin1String(
"js");
41 lexer.
setCode(code, 1, !isJavaScript);
42 QQmlJS::Parser parser(&
engine);
44 const bool success = isJavaScript ? (isESModule ? parser.parseModule()
45 : parser.parseProgram())
60 scope, m_importer, &logger,
62 rootNode->
accept(membersVisitor.get());
void close() override
Calls QFileDevice::flush() and closes the file.
\inmodule QtCore \reentrant
QString baseName() const
Returns the base name of the file without the path.
QString suffix() const
Returns the suffix (extension) of the file.
bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
QByteArray readAll()
Reads all remaining data from the device, and returns it as a byte array.
static QString implicitImportDirectory(const QString &localFile, QQmlJSResourceFileMapper *mapper)
std::unique_ptr< QQmlJSImportVisitor > makeImportVisitor(const QQmlJSScope::Ptr &target, QQmlJSImporter *importer, QQmlJSLogger *logger, const QString &implicitImportDirectory, const QStringList &qmldirFiles=QStringList())
QQmlJSResourceFileMapper * resourceFileMapper() const
void setCode(const QString &code)
void setSilent(bool silent)
void setFileName(const QString &fileName)
bool operator()(const QSharedPointer< QQmlJSScope > &scope)
void accept(BaseVisitor *visitor)
void setCode(const QString &code, int lineno, bool qmlMode=true, CodeContinuation codeContinuation=CodeContinuation::Reset)
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
QString toLower() const &
QString chopped(qsizetype n) const
Combined button and popup list for selecting options.
QLatin1StringView QLatin1String
#define QStringLiteral(str)
QFileInfo info(fileName)
[8]