Xuefu Zhang, thank you for your comment sir!
I agree with you. In fact, this issue doesn't exist when the schema definition is used inside the AS clause in a LOAD statement because the grammar looks for a right parenthesis and throws a parser exception if it doesn't find one. Unfortunately, I didn't have a good idea to detect this in the grammar itself when the schema definition is used alone.
For the context, I have a load func that takes the schema string as an option, and I use this helper function to parse it. One user accidentally omitted a comma, and that resulted in some surprising side-effects in downstream ETL processes. So I put some quick fix to prevent such unfortunate event again.
But yes, I agree that this is probably not the best approach. I will cancel the patch for now.