airportyh/fun-lang

var dict = { [object Object]: "George", [object Object]: 12 }; dict.fun example

kitaboon opened this issue · 2 comments

Hello !
I watched all videos about nearley they are just amazing !
I came here to see the fun-lang, but when i run the dictionnary example, there is a problem :

var dict = { [object Object]: "George", [object Object]: 12 };

Here is the fun code : (file: mytest.fun)

proc main() [
    dict = { name: "George", age: 12 }
    dict["name"] = "Barnes"
    print(dict["name"])
]

Command i run

node scripts/run.js mytest.fun

Thank you for the comment and the bug report! Fixed in master. It was due to the key of a dictionary entry being change (at some point) from a string to a token. Haven't covered tokens in the videos yet. Plan to.

👍 Thank you very much !
Your videos are awesome, I was searching simple and good tutorials for months when, one day, i found your channel: best channel for the subject