From ae58deb5da1fa2ae5e461783ce592a9b962da778 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Mon, 20 Nov 2023 19:28:31 +0100 Subject: parser: add pointer support (work in progress) This is incomplete because the scalar variables are not addressable right now. To be addressable they must be represented as reflect values, not interfaces. --- parser/expr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'parser/expr.go') diff --git a/parser/expr.go b/parser/expr.go index 207f38b..806fd75 100644 --- a/parser/expr.go +++ b/parser/expr.go @@ -42,7 +42,7 @@ func (p *Parser) ParseExpr(in Tokens) (out Tokens, err error) { case lang.Int, lang.String: out = append(out, t) vl++ - case lang.Define, lang.Add, lang.Sub, lang.Assign, lang.Equal, lang.Greater, lang.Less, lang.Mul, lang.Land, lang.Lor, lang.Shl, lang.Shr, lang.Not: + case lang.Define, lang.Add, lang.Sub, lang.Assign, lang.Equal, lang.Greater, lang.Less, lang.Mul, lang.Land, lang.Lor, lang.Shl, lang.Shr, lang.Not, lang.And: if i == 0 || in[i-1].Id.IsOperator() { // An operator preceded by an operator or no token is unary. t.Id = lang.UnaryOp[t.Id] -- cgit v1.2.3