fix imports

This commit is contained in:
Neemek 2025-03-31 10:58:13 +02:00
parent 49c15f6fb6
commit c364e09fc9
Signed by: neemek
GPG key ID: 28360A8951CD0E9B
3 changed files with 48 additions and 20 deletions

View file

@ -87,6 +87,7 @@ func NewParser(source string, tokens []Token) *Parser {
type Program struct {
Imports []string
Block *BlockNode
Path string
}
func (p *Program) String() string {
@ -104,7 +105,7 @@ func (p *Program) String() string {
return builder.String()
}
func (p *Parser) Parse() (*Program, error) {
func (p *Parser) Parse(path string) (*Program, error) {
imports := make([]string, 0)
// top level statements
@ -138,6 +139,7 @@ func (p *Parser) Parse() (*Program, error) {
0,
p.curr.Start + p.curr.Length,
},
path,
}, nil
}