Added more tests

This commit is contained in:
2024-07-05 17:11:30 +02:00
parent d771708693
commit cc66b02bf8
7 changed files with 17 additions and 4 deletions

View File

@ -61,7 +61,7 @@ func toASTNode(tokens token.List) (Node, error) {
switch {
case IsVariableDefinition(expr):
if len(expr.Children) < 2 {
return nil, errors.New(errors.MissingAssignValue, nil, expr.Token.End())
return nil, errors.New(errors.MissingOperand, nil, expr.Token.End())
}
name := expr.Children[0].Token
@ -70,7 +70,7 @@ func toASTNode(tokens token.List) (Node, error) {
case IsAssignment(expr):
if len(expr.Children) < 2 {
return nil, errors.New(errors.MissingAssignValue, nil, expr.Token.End())
return nil, errors.New(errors.MissingOperand, nil, expr.Token.End())
}
name := expr.Children[0].Token