Made another DSLParser error non-fatal

This allows processing to continue in the face of invalid array sizes,
matching the error reporting behavior of SkSLParser.

Change-Id: Ifc0572aecf829563e4a77f01962a6e05aa9e98e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444761
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This commit is contained in:
Ethan Nicholas 2021-09-01 15:48:42 -04:00 committed by SkCQ
parent f80ef38d0f
commit 709ecd53ca

View File

@ -581,7 +581,7 @@ skstd::optional<DSLWrapper<DSLParameter>> DSLParser::parameter() {
SKSL_INT arraySize;
if (!SkSL::stoi(arraySizeFrag, &arraySize)) {
this->error(sizeToken, "array size is too large: " + arraySizeFrag);
return skstd::nullopt;
arraySize = 1;
}
type = Array(*type, arraySize, this->position(name));
if (!this->expect(Token::Kind::TK_RBRACKET, "']'")) {