summaryrefslogtreecommitdiff
path: root/parser/expr.go
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2025-12-04 13:28:22 +0100
committerMarc Vertes <mvertes@free.fr>2025-12-04 13:28:22 +0100
commitf07fc0178831432b68f1b9bd6c96b257aa2e9abe (patch)
treedc445dbf1b8946d09be7444b4f141a78e23a568f /parser/expr.go
parent90284c5bedc5ab7bb442b34ef470744578dcd266 (diff)
chore: move symbol types and functions in its own package.HEADmain
Diffstat (limited to 'parser/expr.go')
-rw-r--r--parser/expr.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/parser/expr.go b/parser/expr.go
index 1732b8d..5958279 100644
--- a/parser/expr.go
+++ b/parser/expr.go
@@ -7,6 +7,7 @@ import (
"github.com/mvertes/parscan/lang"
"github.com/mvertes/parscan/scanner"
+ "github.com/mvertes/parscan/symbol"
"github.com/mvertes/parscan/vm"
)
@@ -42,7 +43,7 @@ func (p *Parser) parseExpr(in Tokens) (out Tokens, err error) {
continue
}
// resolve symbol if not a selector rhs.
- _, sc, ok := p.GetSym(t.Str, p.scope)
+ _, sc, ok := p.Symbols.Get(t.Str, p.scope)
if ok {
if sc != "" {
t.Str = sc + "/" + t.Str
@@ -111,7 +112,7 @@ func (p *Parser) parseExpr(in Tokens) (out Tokens, err error) {
if err != nil {
return out, ErrInvalidType
}
- p.AddSymbol(UnsetAddr, typ.String(), vm.NewValue(typ), SymType, typ, p.funcScope != "")
+ p.Symbols.Add(symbol.UnsetAddr, typ.String(), vm.NewValue(typ), symbol.Type, typ, p.funcScope != "")
out = append(out, t, scanner.Token{Tok: lang.Ident, Pos: t.Pos, Str: typ.String()})
i = ti
vl += 2