gosh-lang / gosh

Gosh is an interpreted language for Go ecosystem written in Go
https://gosh-lang.org
Mozilla Public License 2.0
62 stars 8 forks source link

Do not treat true and false as special token types and keywords #30

Open AlekSi opened 5 years ago

AlekSi commented 5 years ago

Currently true and false are treated as keywords: https://github.com/gosh-lang/gosh/blob/5198cfb34427a8fd46e06b811a8fd4525c2b4eef/scanner/scanner.go#L61-L63

But they are normal predeclared identifiers like println. We should treat them as such. We also should remove special token types for them.

Scanner and parser should return them as identifiers, and they should be added into built-in objects.

JacksonIsaac commented 5 years ago

Working on this. Hope I can get the environment setup for running and testing.

JacksonIsaac commented 5 years ago

I somehow managed to run 'make', had to also use 'sudo make'. I am stuck after this step. I tried to find any getting started or documentation but didn't find any.

Any help would be appreciated.

AlekSi commented 5 years ago

Normally, you should not use sudo. How you installed Go? Do you have GOPATH set? Did you download Gosh with go get -v gosh-lang.org/gosh?;

JacksonIsaac commented 5 years ago

I installed go via MacPorts.

I tried to setup gosh by doing a git clone and ran make. I had to also uncomment go:generate stringer -type Type for it to build once in the beginning. After that I was getting permission denied for some go related files, hence had to do sudo make (which is not the best way to do it, though).

AlekSi commented 5 years ago

It is probably easier to remove everything and start from scratch.

If something does not work, please put an output of the all commands above plus go env.

AlekSi commented 5 years ago

@JacksonIsaac How can I help you with this?