5#ifndef QQMLJSENGINE_P_H
6#define QQMLJSENGINE_P_H
20#include <private/qqmljssourcelocation_p.h>
22#include <private/qqmljsmemorypool_p.h>
24#include <QtCore/qstring.h>
25#include <QtCore/qset.h>
62 Lexer *_lexer =
nullptr;
63 Directives *_directives =
nullptr;
65 QList<SourceLocation> _comments;
66 QStringList _extraCode;
70 void setCode(
const QString &code) { _code = code; }
76 _comments.append(QQmlJS::SourceLocation(pos, len, line, col));
81 Lexer *
lexer()
const {
return _lexer; }
82 void setLexer(Lexer *lexer) { _lexer = lexer; }
85 void setDirectives(Directives *directives) { _directives = directives; }
92 return QStringView{_code}.mid(position, size);
97 _extraCode.append(text);
98 return QStringView{_extraCode.last()};
103 return newStringRef(QString(chars, size));
QStringView newStringRef(const QChar *chars, int size)
const MemoryPool * pool() const
void addComment(int pos, int len, int line, int col)
const QString & code() const
QStringView midRef(int position, int size)
QStringView newStringRef(const QString &text)
QList< SourceLocation > comments() const
void setCode(const QString &code)
void setLexer(Lexer *lexer)
void setDirectives(Directives *directives)
Directives * directives() const
#define QML_PARSER_EXPORT
static int regExpFlagFromChar(const QChar &ch)
static bool isIdentifierPart(uint ch)
static QChar convertHex(QChar c1, QChar c2)
static const int uriTokens[]
static bool isUriToken(int token)
static unsigned char convertHex(ushort c)
static bool isIdentifierStart(uint ch)