-
Notifications
You must be signed in to change notification settings - Fork 3
/
Location.h
52 lines (34 loc) · 972 Bytes
/
Location.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
#ifndef LOCATION_H
#define LOCATION_H
#include <private/qqmljsast_p.h>
#include "parser.h"
using namespace QQmlJS;
using namespace QQmlJS::AST;
using namespace Parser;
class Location {
protected:
void set(int column, int line, int offset, int length_);
public:
int startColumn = 0;
int startLine = 0;
int startOffset = 0;
int endColumn = 0;
int endLine = 0;
int endOffset = 0;
int length = 0;
Location();
Location(int column, int line, int offset, int length);
Location(int startColumn, int startLine, int startOffset, int endColumn,
int endLine, int endOffset);
Location(SourceLocation const &loc);
Location(SourceLocation const &locStart, SourceLocation const &locEnd);
Location(json const &loc);
bool isValid() const;
operator json();
Location operator+(int size);
Location operator-(int size);
Location mergeWith(const Location &loc) const;
json toJson() const;
};
#endif // LOCATION_H