Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map Index Assignment: no prefix parse function for = found #116

Closed
duckbrain opened this issue Sep 17, 2020 · 2 comments
Closed

Map Index Assignment: no prefix parse function for = found #116

duckbrain opened this issue Sep 17, 2020 · 2 comments

Comments

@duckbrain
Copy link
Contributor

Plush doesn't seem to support assigning to map indexes.

package main

import (
	"github.com/gobuffalo/plush"
)

func run(s string) {
	ctx := plush.NewContext()
	err := plush.RunScript(s, ctx)
	if err != nil {
		panic(err)
	}
}

func main() {
	run(`
	let a = "hello"
	println(a)
	a = "world"
	println(a)
	`)
	run(`
	let a = "Hello"
	let b = {}
	b[a] = "world"
	println(b)
	`)
}
~/tmp 1 $ go run main.go
hello
world
panic: line 4: no prefix parse function for = found

goroutine 1 [running]:
main.run(0x7f84a2, 0x3b)
	/home/jonathan/tmp/main.go:11 +0x85
main.main()
	/home/jonathan/tmp/main.go:22 +0x4f
exit status 2
@Mido-sys
Copy link
Contributor

@duckbrain

Sent a pull request #129. The new pull request will allow map and array assignment.

@paganotoni
Copy link
Member

Merged. Closing this issue. Thanks again @Mido-sys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants