You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
Fix shader tokenizer/compiler reporting wrong error location
Raname shader tokenizer methods for clarity
This commit is contained in:
@@ -332,14 +332,14 @@ private:
|
||||
void get_error(String *r_error, int *r_line, int *r_column) {
|
||||
|
||||
*r_error=error;
|
||||
*r_line=get_token(pos).line;
|
||||
*r_column=get_token(pos).col;
|
||||
*r_line=get_next_token(0).line;
|
||||
*r_column=get_next_token(0).col;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Token get_token(int ofs=0) const { int idx=pos+ofs; if (idx<0 || idx>=tokens.size()) return Token(TK_ERROR); return tokens[idx]; }
|
||||
TokenType get_token_type(int ofs=0) const { int idx=pos+ofs; if (idx<0 || idx>=tokens.size()) return TK_ERROR; return tokens[idx].type; }
|
||||
Token get_next_token(int ofs=0) const { int idx=pos+ofs; if (idx<0 || idx>=tokens.size()) return Token(TK_ERROR); return tokens[idx]; }
|
||||
TokenType get_next_token_type(int ofs=0) const { int idx=pos+ofs; if (idx<0 || idx>=tokens.size()) return TK_ERROR; return tokens[idx].type; }
|
||||
void advance(int p_amount=1) { pos+=p_amount; }
|
||||
bool is_at_end() const { return pos>=tokens.size(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user