Fixed line number of DSLParser struct errors
RedeclareStructTypeWithName was reporting an error on the wrong line. Change-Id: Ibe954ca5013dbedca8cf015660cf3d28fa97987d Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445101 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This commit is contained in:
parent
b9c6489133
commit
38ccf67b7b
@ -545,15 +545,14 @@ skstd::optional<DSLType> DSLParser::structDeclaration() {
|
||||
|
||||
/* structDeclaration ((IDENTIFIER varDeclarationEnd) | SEMICOLON) */
|
||||
SkTArray<dsl::DSLGlobalVar> DSLParser::structVarDeclaration(const DSLModifiers& modifiers) {
|
||||
PositionInfo pos = this->position(this->peek());
|
||||
skstd::optional<DSLType> type = this->structDeclaration();
|
||||
if (!type) {
|
||||
return {};
|
||||
}
|
||||
Token name;
|
||||
if (this->checkNext(Token::Kind::TK_IDENTIFIER, &name)) {
|
||||
return this->varDeclarationEnd<DSLGlobalVar>(pos, modifiers, std::move(*type),
|
||||
this->text(name));
|
||||
return this->varDeclarationEnd<DSLGlobalVar>(this->position(name), modifiers,
|
||||
std::move(*type), this->text(name));
|
||||
}
|
||||
this->expect(Token::Kind::TK_SEMICOLON, "';'");
|
||||
return {};
|
||||
|
Loading…
Reference in New Issue
Block a user