GDScript: Remove unused values from Token
This commit is contained in:
parent
607b230ffe
commit
356de8fec3
@ -357,7 +357,6 @@ GDScriptTokenizer::Token GDScriptTokenizerText::make_token(Token::Type p_type) {
|
||||
token.end_column = column;
|
||||
token.leftmost_column = leftmost_column;
|
||||
token.rightmost_column = rightmost_column;
|
||||
token.source = String(_start, _current - _start);
|
||||
|
||||
if (p_type != Token::ERROR && cursor_line > -1) {
|
||||
// Also count whitespace after token.
|
||||
@ -370,7 +369,6 @@ GDScriptTokenizer::Token GDScriptTokenizerText::make_token(Token::Type p_type) {
|
||||
if (start_line == line) {
|
||||
// Single line token.
|
||||
if (cursor_line == start_line && cursor_column >= start_column && cursor_column <= last_column) {
|
||||
token.cursor_position = cursor_column - start_column;
|
||||
if (cursor_column == start_column) {
|
||||
token.cursor_place = CURSOR_BEGINNING;
|
||||
} else if (cursor_column < column) {
|
||||
@ -383,7 +381,6 @@ GDScriptTokenizer::Token GDScriptTokenizerText::make_token(Token::Type p_type) {
|
||||
// Multi line token.
|
||||
if (cursor_line == start_line && cursor_column >= start_column) {
|
||||
// Is in first line.
|
||||
token.cursor_position = cursor_column - start_column;
|
||||
if (cursor_column == start_column) {
|
||||
token.cursor_place = CURSOR_BEGINNING;
|
||||
} else {
|
||||
@ -391,7 +388,6 @@ GDScriptTokenizer::Token GDScriptTokenizerText::make_token(Token::Type p_type) {
|
||||
}
|
||||
} else if (cursor_line == line && cursor_column <= last_column) {
|
||||
// Is in last line.
|
||||
token.cursor_position = cursor_column - start_column;
|
||||
if (cursor_column < column) {
|
||||
token.cursor_place = CURSOR_MIDDLE;
|
||||
} else {
|
||||
@ -399,7 +395,7 @@ GDScriptTokenizer::Token GDScriptTokenizerText::make_token(Token::Type p_type) {
|
||||
}
|
||||
} else if (cursor_line > start_line && cursor_line < line) {
|
||||
// Is in middle line.
|
||||
token.cursor_position = CURSOR_MIDDLE;
|
||||
token.cursor_place = CURSOR_MIDDLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -480,7 +476,7 @@ GDScriptTokenizer::Token GDScriptTokenizerText::annotation() {
|
||||
_advance();
|
||||
}
|
||||
Token annotation = make_token(Token::ANNOTATION);
|
||||
annotation.literal = StringName(annotation.source);
|
||||
annotation.literal = StringName(String(_start, _current - _start));
|
||||
return annotation;
|
||||
}
|
||||
|
||||
|
@ -170,12 +170,10 @@ public:
|
||||
};
|
||||
|
||||
Type type = EMPTY;
|
||||
Variant literal;
|
||||
int start_line = 0, end_line = 0, start_column = 0, end_column = 0;
|
||||
int leftmost_column = 0, rightmost_column = 0; // Column span for multiline tokens.
|
||||
int cursor_position = -1;
|
||||
CursorPlace cursor_place = CURSOR_NONE;
|
||||
String source;
|
||||
Variant literal;
|
||||
|
||||
const char *get_name() const;
|
||||
bool can_precede_bin_op() const;
|
||||
|
Loading…
Reference in New Issue
Block a user