File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -142,8 +142,9 @@ export namespace syxparser {
142142
143143 if ( t . type === TokenType . Comma && at ( ) . type !== TokenType . Identifier ) throw new CompilerError ( t . range , 'Expected identifier after comma.' ) ;
144144 else if ( t . type === TokenType . Comma && statement . formats . length === 0 ) throw new CompilerError ( t . range , 'Can\'t start with comma.' ) ;
145+ else if ( t . type === TokenType . Comma ) { }
145146 else if ( t . type === TokenType . Identifier ) statement . formats . push ( t . value ) ;
146- else throw new CompilerError ( t . range , 'Unexpected token.' ) ;
147+ else throw new CompilerError ( t . range , `Expected comma or identifier but found ${ t . type } .` ) ;
147148 }
148149 tokens . shift ( ) ; // skip CloseParen
149150
@@ -169,6 +170,7 @@ export namespace syxparser {
169170
170171 if ( t . type === TokenType . Comma && at ( ) . type !== TokenType . Identifier ) throw new CompilerError ( t . range , 'Expected identifier after comma.' ) ;
171172 else if ( t . type === TokenType . Comma && statement . formats . length === 0 ) throw new CompilerError ( t . range , 'Can\'t start with comma.' ) ;
173+ else if ( t . type === TokenType . Comma ) { }
172174 else if ( t . type === TokenType . Identifier ) statement . formats . push ( t . value ) ;
173175 else throw new CompilerError ( t . range , 'Unexpected token.' ) ;
174176 }
You can’t perform that action at this time.
0 commit comments