about summary refs log tree commit diff
path: root/pkg/lang/parser/exprs.go
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-07-27 22:20:28 +0000
committerMel <einebeere@gmail.com>2022-07-27 22:50:42 +0000
commit4f23155ca7f8591cae0be6938610386513d24b7f (patch)
tree7a18b5297dc7d2a9304c802a429abf0869080a79 /pkg/lang/parser/exprs.go
parentbe281507daf2d1d7f66f32daa42ef78daa48c5dd (diff)
downloadjinx-4f23155ca7f8591cae0be6938610386513d24b7f.tar.zst
jinx-4f23155ca7f8591cae0be6938610386513d24b7f.zip
Put correct token strings in parser errors
Diffstat (limited to 'pkg/lang/parser/exprs.go')
-rw-r--r--pkg/lang/parser/exprs.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/lang/parser/exprs.go b/pkg/lang/parser/exprs.go
index 56904a1..d0725f6 100644
--- a/pkg/lang/parser/exprs.go
+++ b/pkg/lang/parser/exprs.go
@@ -176,7 +176,7 @@ func (p *Parser) parseUnitExpr() (ast.Expr, error) {
 	case token.KwTrue, token.KwFalse, token.KwNull, token.KwThis:
 		return p.parseValueLitExpr()
 	default:
-		panic(fmt.Errorf("unexpected token %+v, wanted unit expression start", p.peek()))
+		panic(fmt.Errorf("unexpected token '%v', wanted unit expression start", p.peek()))
 	}
 }
 
@@ -371,6 +371,6 @@ func (p *Parser) parseValueLitExpr() (ast.Expr, error) {
 			Value: ast.ExprThis{},
 		}, nil
 	default:
-		panic(fmt.Errorf("unexpected token %+v, wanted value literal", tok))
+		panic(fmt.Errorf("unexpected token '%v', wanted value literal", tok))
 	}
 }