summaryrefslogtreecommitdiff
path: root/scanner/scan_test.go
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2023-09-06 08:49:19 +0200
committerMarc Vertes <mvertes@free.fr>2023-09-06 08:49:19 +0200
commit6dd78f44adf6fb032d0ecd9db813651b9524fcac (patch)
treed1d4b3305db708614f147b2294b4b0e28336a55d /scanner/scan_test.go
parent4241593b42bffac2f8fcb63f1e88621fe025e360 (diff)
chore: refactor some APIs
The scanner returns a slice of pointers to tokens instead of a slice of tokens. The parser now pass the initial node context.
Diffstat (limited to 'scanner/scan_test.go')
-rw-r--r--scanner/scan_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/scanner/scan_test.go b/scanner/scan_test.go
index bdd3176..41ee62e 100644
--- a/scanner/scan_test.go
+++ b/scanner/scan_test.go
@@ -79,7 +79,7 @@ func TestScan(t *testing.T) {
}
}
-func tokStr(tokens []Token) (s string) {
+func tokStr(tokens []*Token) (s string) {
for _, t := range tokens {
s += fmt.Sprintf("%#v ", t.content)
}
@@ -155,4 +155,7 @@ def"`,
}, { // #21
src: `println("in f")`,
tok: `"println" "(\"in f\")" `,
+}, { // #22
+ src: "a, b = 1, 2",
+ tok: `"a" "," "b" "=" "1" "," "2" `,
}}