From 362f7c9c45598b429c92e67756f41b690043e0c4 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Fri, 22 Mar 2024 16:59:25 +0100 Subject: feat: add initial support for import, provide minimal fmt (#6) The `import` statement is now parsed. It only provides minimal support for the `fmt` package (only `Println` symbol is defined). This should be sufficient to pass a few tests. Full support of package namespaces, source and binary imports will be supported later, based on this work. --- scanner/scan.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scanner/scan.go') diff --git a/scanner/scan.go b/scanner/scan.go index ea7fc37..4c787fb 100644 --- a/scanner/scan.go +++ b/scanner/scan.go @@ -40,7 +40,8 @@ func (t *Token) Name() string { func (t *Token) String() string { s := t.Id.String() - if t.Id.IsLiteral() || t.Id.IsBlock() || t.Id == lang.Ident || t.Id == lang.Comment { + if t.Id.IsLiteral() || t.Id.IsBlock() || t.Id == lang.Ident || t.Id == lang.Comment || + t.Id == lang.Period || t.Id == lang.Label || t.Id == lang.Goto { s += strconv.Quote(t.Str) } return s -- cgit v1.2.3